diff options
author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2021-10-29 17:50:29 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-29 06:54:39 -0600 |
commit | df75db1fc1e5608271397de37cab43371bb838d2 (patch) | |
tree | f0efa5f528e902350388f0b118bfa0f4144d938f | |
parent | 1b86db5f4e025840e0bf7cef2b10e84531954386 (diff) | |
download | linux-df75db1fc1e5608271397de37cab43371bb838d2.tar.gz linux-df75db1fc1e5608271397de37cab43371bb838d2.tar.bz2 linux-df75db1fc1e5608271397de37cab43371bb838d2.zip |
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.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1635501029-81391-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/ataflop.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index 2622803ef71a..d14bdc3589b2 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c @@ -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; |