lkml.org 
[lkml]   [2013]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/1] Introduce Intel RAPL cooling device driver
On Tue, Apr 09, 2013 at 09:15:17AM -0700, Jacob Pan wrote:
> On Tue, 9 Apr 2013 08:26:38 -0700
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > > + if (NULL == rp->name || rp->flag & RAPL_PRIMITIVE_DUMMY)
> >
> > In Linux we do (rp->name == NULL), or even better yet (!rp->name),
> > please fix that up here and elsewhere in the driver.
> >
> I can fix that. I did that because checkpatch does not complain about
> it.

checkpatch doesn't catch everything.

> also it avoids common mistake as: rp->name = NULL

The compiler catches mistakes like that, and has for many years.

> > > +#define PRIMITIVE_INFO_INIT(p, m, s, i, u, f) {#p, m, s, i, u, p,
> > > f}
> >
> > C has named initializers, use them please.
> >
> this macro can save lots of repeated text.

text is free.


\
 
 \ /
  Last update: 2013-04-09 19:01    [W:0.085 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site