Skip to contentSkip to conversation

MTD: fix printk warning

PATCH Applied Jeff Garzik 2 participants 2 messages Oct 1, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: fix printk warning

gcc spits out this warning:

drivers/mtd/mtd_blkdevs.c: In function ‘do_blktrans_request’:
drivers/mtd/mtd_blkdevs.c:72: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’

This could be fixed any number of ways, including use of BUG(). rq_data_dir() only returns 0 or 1, so this entire case is superfluous. I did the most simple fix.

drivers/mtd/mtd_blkdevs.c +1 -1
index 6baf5fe..178b53b 100644
@@ -69,7 +69,7 @@ static int do_blktrans_request(struct mt
 		return 1;
 
 	default:
-		printk(KERN_NOTICE "Unknown request %ld\n", rq_data_dir(req));
+		printk(KERN_NOTICE "Unknown request %u\n", rq_data_dir(req));
 		return 0;
 	}
 }
#1 lore raw

drivers/mtd/mtd_blkdevs.c static int do_blktrans_request(struct mt · line 72

Quoted 7 lines · Jeff Garzik

gcc spits out this warning:

drivers/mtd/mtd_blkdevs.c: In function ‘do_blktrans_request’:
drivers/mtd/mtd_blkdevs.c:72: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’

drivers/mtd/mtd_blkdevs.c +1 -1
-		printk(KERN_NOTICE "Unknown request %ld\n", rq_data_dir(req));
+		printk(KERN_NOTICE "Unknown request %u\n", rq_data_dir(req));

Applied; thanks. I'd applied it once already and reverted it because it seemed wrong -- but now the change which made it necessary is upstream.

Signature · 1 line
dwmw2