Messages in this thread | | | Date | Tue, 30 Sep 2014 21:35:46 -0500 | From | Timur Tabi <> | Subject | Re: [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.
| |