From: Robert Love <rml@tech9.net>

Now that dev_t is an unsigned long, MKDEV() correspondingly returns an
unsigned long.  This causes a compiler warning and potential bug on
64-bit architectures in drivers/scsi/sg.c :: sg_device_kdev_read().

This patch needs to be applied on top of the dev_t patches.



 drivers/scsi/sg.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/scsi/sg.c~sg-dev_t-fix drivers/scsi/sg.c
--- 25/drivers/scsi/sg.c~sg-dev_t-fix	2003-03-21 13:04:55.000000000 -0800
+++ 25-akpm/drivers/scsi/sg.c	2003-03-21 13:04:55.000000000 -0800
@@ -1331,9 +1331,11 @@ static ssize_t
 sg_device_kdev_read(struct device *driverfs_dev, char *page)
 {
 	Sg_device *sdp = list_entry(driverfs_dev, Sg_device, sg_driverfs_dev);
-	return sprintf(page, "%x\n", MKDEV(sdp->disk->major,
-					   sdp->disk->first_minor));
+
+	return sprintf(page, "%lx\n", MKDEV(sdp->disk->major,
+					sdp->disk->first_minor));
 }
+
 static DEVICE_ATTR(kdev,S_IRUGO,sg_device_kdev_read,NULL);
 
 static ssize_t

_