[PATCH -mm] megaraid gcc 4.1 warning fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes the following warning,

drivers/scsi/megaraid.c: In function â??issue_scbâ??:
drivers/scsi/megaraid.c:1153: warning: passing argument 2 of â??writelâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c: In function â??issue_scb_blockâ??:
drivers/scsi/megaraid.c:1216: warning: passing argument 2 of â??writelâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c:1229: warning: passing argument 2 of â??writelâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c:1231: warning: passing argument 1 of â??readlâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c: In function â??megaraid_isr_memmappedâ??:
drivers/scsi/megaraid.c:1361: warning: passing argument 1 of â??readlâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c:1368: warning: passing argument 2 of â??writelâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c:1387: warning: passing argument 2 of â??writelâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c:1391: warning: passing argument 1 of â??readlâ?? makes pointer from integer without a cast
drivers/scsi/megaraid.c: In function â??megadev_ioctlâ??:
drivers/scsi/megaraid.c:3665: warning: ignoring return value of â??copy_to_userâ??, declared with attribute warn_unused_result


Signed-Off-By: Daniel Walker <[email protected]>

Index: linux-2.6.16/drivers/scsi/megaraid.c
===================================================================
--- linux-2.6.16.orig/drivers/scsi/megaraid.c
+++ linux-2.6.16/drivers/scsi/megaraid.c
@@ -73,10 +73,10 @@ static unsigned short int max_mbox_busy_
 module_param(max_mbox_busy_wait, ushort, 0);
 MODULE_PARM_DESC(max_mbox_busy_wait, "Maximum wait for mailbox in microseconds if busy (default=MBOX_BUSY_WAIT=10)");
 
-#define RDINDOOR(adapter)		readl((adapter)->base + 0x20)
-#define RDOUTDOOR(adapter)		readl((adapter)->base + 0x2C)
-#define WRINDOOR(adapter,value)		writel(value, (adapter)->base + 0x20)
-#define WROUTDOOR(adapter,value)	writel(value, (adapter)->base + 0x2C)
+#define RDINDOOR(adapter)		readl((void*)((adapter)->base + 0x20))
+#define RDOUTDOOR(adapter)		readl((void*)((adapter)->base + 0x2C))
+#define WRINDOOR(adapter,value)		writel(value, (void *)((adapter)->base + 0x20))
+#define WROUTDOOR(adapter,value)	writel(value, (void*)((adapter)->base + 0x2C))
 
 /*
  * Global variables
@@ -3662,8 +3662,9 @@ megadev_ioctl(struct inode *inode, struc
 			 * Send the request sense data also, irrespective of
 			 * whether the user has asked for it or not.
 			 */
-			copy_to_user(upthru->reqsensearea,
-					pthru->reqsensearea, 14);
+			if (copy_to_user(upthru->reqsensearea,
+					pthru->reqsensearea, 14))
+				return -EFAULT;
 
 freemem_and_return:
 			if( pthru->dataxferlen ) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux