linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: ataflop: Fix warning comparing pointer to 0
@ 2021-10-29  9:50 Jiapeng Chong
  2021-10-29 12:54 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-10-29  9:50 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, Jiapeng Chong

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>
---
 drivers/block/ataflop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 2622803..d14bdc3 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;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: ataflop: Fix warning comparing pointer to 0
  2021-10-29  9:50 [PATCH] block: ataflop: Fix warning comparing pointer to 0 Jiapeng Chong
@ 2021-10-29 12:54 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-10-29 12:54 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: linux-block, linux-kernel

On Fri, 29 Oct 2021 17:50:29 +0800, Jiapeng Chong wrote:
> 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,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-29 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29  9:50 [PATCH] block: ataflop: Fix warning comparing pointer to 0 Jiapeng Chong
2021-10-29 12:54 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).