Skip to contentSkip to conversation

block: ataflop: Fix warning comparing pointer to 0

PATCH Applied Jiapeng Chong 2 participants 2 messages Oct 29, 2021 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: ataflop: Fix warning comparing pointer to 0

Fix the following coccicheck warning:

./drivers/block/ataflop.c:1464:20-21: WARNING comparing pointer to 0.

---
 drivers/block/ataflop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/ataflop.c +1 -2
index 2622803..d14bdc3 100644
@@ -1460,8 +1460,7 @@ static int floppy_revalidate(struct gendisk *disk)
 	unsigned int drive = p - unit;
 
 	if (test_bit(drive, &changed_floppies) ||
-	    test_bit(drive, &fake_change) ||
-	    p->disktype == 0) {
+	    test_bit(drive, &fake_change) || !p->disktype) {
 		if (UD.flags & FTD_MSG)
 			printk(KERN_ERR "floppy: clear format %p!\n", UDT);
 		BufferDrive = -1;
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Jiapeng Chong

Fix the following coccicheck warning:

./drivers/block/ataflop.c:1464:20-21: WARNING comparing pointer to 0.

Applied, thanks!

[1/1] block: ataflop: Fix warning comparing pointer to 0

      commit: df75db1fc1e5608271397de37cab43371bb838d2

Best regards,

Signature · 1 line
Jens Axboe