lkml.org 
[lkml]   [2018]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] block: Use NULL to compare with pointer-typed value rather than 0
Date
We should use NULL to compare with pointer-typed value rather than
0. The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/block/ataflop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index dfb2c26..cca93e3 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1355,7 +1355,7 @@ static int floppy_revalidate(struct gendisk *disk)

if (test_bit(drive, &changed_floppies) ||
test_bit(drive, &fake_change) ||
- p->disktype == 0) {
+ p->disktype == NULL) {
if (UD.flags & FTD_MSG)
printk(KERN_ERR "floppy: clear format %p!\n", UDT);
BufferDrive = -1;
--
1.7.12.4
\
 
 \ /
  Last update: 2018-08-17 15:40    [W:0.051 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site