Re: [PATCH 2/2] staging: Android: Fix NULL pointer related warning in alarm-dev.c file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/06/2012, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> On Tue, Jun 05, 2012 at 01:56:44PM +0530, Sachin Kamat wrote:
>> Fixes the following sparse warning:
>> drivers/staging/android/alarm-dev.c:259:35: warning: Using plain integer
>> as NULL pointer
>>
>> Cc: Brian Swetland <swetland@xxxxxxxxxx>
>> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
>> ---
>>  drivers/staging/android/alarm-dev.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/staging/android/alarm-dev.c
>> b/drivers/staging/android/alarm-dev.c
>> index 53ce6ec..18d9b3f 100644
>> --- a/drivers/staging/android/alarm-dev.c
>> +++ b/drivers/staging/android/alarm-dev.c
>> @@ -256,7 +256,7 @@ static int alarm_release(struct inode *inode, struct
>> file *file)
>>  	unsigned long flags;
>>
>>  	spin_lock_irqsave(&alarm_slock, flags);
>> -	if (file->private_data != 0) {
>> +	if (file->private_data != NULL) {
>
> Better to just say:
>
> 	if (file->private_data) {
>
> The double negative of "if private_data is not NULL" is less
> readable.

Ok, I will re-send this one.

>
> regards,
> dan carpenter
>
>


-- 
With warm regards,
Sachin
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux