Re: [PATCH 4/4] Staging: bcm: Fix assignment vs. condition bug reported by checkpatch.pl.

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

 



Hi Joe,

On Thu, Oct 6, 2011 at 11:54 PM, Joe Perches <joe@xxxxxxxxxxx> wrote:
> On Thu, 2011-10-06 at 22:52 -0400, Kevin McKinney wrote:
>> This patch fixes an error where an assignment "="
>> was being used in an if statement instead of
>> a condition "==".
>>
>> Signed-off-by: Kevin McKinney <klmckinney1@xxxxxxxxx>
>> ---
>>  drivers/staging/bcm/Misc.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c
>> index 0882e04..449c1cb 100644
>> --- a/drivers/staging/bcm/Misc.c
>> +++ b/drivers/staging/bcm/Misc.c
>> @@ -1045,7 +1045,7 @@ int InitCardAndDownloadFirmware(PMINI_ADAPTER ps_adapter)
>>       }
>>
>>       /* Download Firmare */
>> -     if ((status = BcmFileDownload(ps_adapter, BIN_FILE, FIRMWARE_BEGIN_ADDR))) {
>> +     if ((status == BcmFileDownload(ps_adapter, BIN_FILE, FIRMWARE_BEGIN_ADDR))) {
>
> Very unlikely this is correct.
>
> More likely:
>
>        status = BcmFileDownload(...)
>        if (status) {
>                BCM_DEBUG_PRINT(...)
>                goto out;
>        }
>

Thanks for the feedback.  I will fix and resubmit ASAP.  I assume
BcmFileDownload returns a true when successful, so perhaps it should
be "if (!status)" ?  Either way, I will confirm, fix, and resubmit.

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