Skip to contentSkip to conversation

clang warning

U-Boot Jeroen Hofstee 2 participants 2 messages Oct 27, 2014 – Oct 28, 2014

lore
Share & tools
lore
#0 lore raw

Hello Nikita,

Commit dc383dd introduces the following clang warning:

drivers/block/dwc_ahsata.c:881:35: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]

         return readl(&(port_mmio->ssts)) && SATA_PORT_SSTS_DET_MASK;
                                                               ^ 

~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/dwc_ahsata.c:881:35: note: use '&' for a bitwise operation

Regards,
Jeroen

#1 lore raw

Hi Jeroen,

Quoted 6 lines · Jeroen Hofstee

Hello Nikita,

Commit dc383dd introduces the following clang warning:

drivers/block/dwc_ahsata.c:881:35: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]

Quoted 7 lines
         return readl(&(port_mmio->ssts)) && SATA_PORT_SSTS_DET_MASK;
                                                               ^

~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/dwc_ahsata.c:881:35: note: use '&' for a bitwise operation

Regards,
Jeroen

Thanks for catching this. Indeed, this should be a bitwise AND. Patch coming up.

Signature · 2 lines
Regards,
Nikita Kiryanov