lkml.org 
[lkml]   [2007]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/68] 0 -> NULL, for arch/arm
Jan Engelhardt wrote:
> On Jul 27 2007 10:59, Al Viro wrote:
>
>> On Fri, Jul 27, 2007 at 11:44:07AM +0200, Yoann Padioleau wrote:
>>
>>> buf = alloc_safe_buffer(device_info, ptr, size, dir);
>>> - if (buf == 0) {
>>> + if (buf == NULL) {
>>>
>> if (!buf)
>> surely...
>>
>
> Makes it look like it's used as a bool.
>
But the conditional checking for a pointer and a boolean is the same; 0
== NULL == 'false' and the rest is valid/'true'. So IMHO it is a cleaner
way to write it. But then again, some people like to abuse the '!' on
"regular" variables.

Richard Knutsson


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-01 11:59    [W:0.068 / U:24.032 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site