lkml.org 
[lkml]   [2014]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3 v2] drivers/bus: Device driver for FSL-MC DPRC devices
Scott Wood wrote:
>>> > >+ if (num_child_objects_in_mc != 0) {
>> >
>> >Like here. Just do "if (num_child_objects_in_mc) {"

> This seems to be a place that is testing for zero as a value rather than
> as a stand-in for NULL, so I'd argue it's better style to leave it as
> is.

But in this case, zero means "none left", so this is a perfectly valid
use-case for omitting the !=.

strcmp() is the only time I can think of to put an explicit != 0,
because this:

if (!strcmp(s1, s2))

is counter-intuitive.


\
 
 \ /
  Last update: 2014-10-01 05:21    [W:0.062 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site