Re: [PATCH 3/4] Staging: bcm: Change conditions that check for NULL in nvm.c

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

 



On Tue, Jun 19, 2012 at 2:35 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> On Mon, Jun 18, 2012 at 11:21:55PM -0400, Kevin McKinney wrote:
>> This patch changes all conditions that check for NULL
>> from "if (variable == NULL)" or "if (NULL == variable)"
>> to "if (variable)" to make code more readable.
>>
>> Signed-off-by: Kevin McKinney <klmckinney1@xxxxxxxxx>
>> ---
>>  drivers/staging/bcm/nvm.c |   32 ++++++++++++++++----------------
>>  1 file changed, 16 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/staging/bcm/nvm.c b/drivers/staging/bcm/nvm.c
>> index 14fce10..b3765bd 100644
>> --- a/drivers/staging/bcm/nvm.c
>> +++ b/drivers/staging/bcm/nvm.c
>> @@ -1067,7 +1067,7 @@ static int BeceemFlashBulkWrite(struct bcm_mini_adapter *Adapter,
>>       uiSectBoundary = uiSectAlignAddr + Adapter->uiSectorSize;
>>
>>       pTempBuff = kmalloc(Adapter->uiSectorSize, GFP_KERNEL);
>> -     if (NULL == pTempBuff)
>> +     if (pTempBuff)
>>               goto BeceemFlashBulkWrite_EXIT;
>>       /*
>>        * check if the data to be written is overlapped across sectors
>
> Uh...  A bunch of these tests are reversed.  I think they could have
> been caught with Smatch but I haven't checked.
>
> kchecker --spammy drivers/staging/bcm/nvm.c
>
Yeah, I am sure Smatch will complain about this.  I will fix

Thanks,
Kevin
_______________________________________________
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