Skip to contentSkip to conversation

isdn hisax gcc 4.1 warning fix

PATCH New Daniel Walker 1 participant 1 message May 10, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isdn hisax gcc 4.1 warning fix

Fixes the following warnings,

drivers/isdn/hisax/config.c: In function 'HiSax_readstatus':
drivers/isdn/hisax/config.c:635: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result drivers/isdn/hisax/config.c:646: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result drivers/isdn/hisax/config.c: At top level:
drivers/isdn/hisax/config.c:1879: warning: 'hisax_pci_tbl' defined but not used

drivers/isdn/hisax/config.c +6 -4
Index: linux-2.6.16/drivers/isdn/hisax/config.c
===================================================================
@@ -632,7 +632,8 @@ static int HiSax_readstatus(u_char __use
 		count = cs->status_end - cs->status_read + 1;
 		if (count >= len)
 			count = len;
-		copy_to_user(p, cs->status_read, count);
+		if (copy_to_user(p, cs->status_read, count))
+			return -EFAULT;
 		cs->status_read += count;
 		if (cs->status_read > cs->status_end)
 			cs->status_read = cs->status_buf;
@@ -643,7 +644,8 @@ static int HiSax_readstatus(u_char __use
 				cnt = HISAX_STATUS_BUFSIZE;
 			else
 				cnt = count;
-			copy_to_user(p, cs->status_read, cnt);
+			if (copy_to_user(p, cs->status_read, cnt))
+				return -EFAULT;
 			p += cnt;
 			cs->status_read += cnt % HISAX_STATUS_BUFSIZE;
 			count -= cnt;
@@ -1873,7 +1875,7 @@ static void EChannel_proc_rcv(struct his
 	}
 }
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(MODULE)
 #include <linux/pci.h>
 
 static struct pci_device_id hisax_pci_tbl[] __initdata = {
@@ -1945,7 +1947,7 @@ static struct pci_device_id hisax_pci_tb
 };
 
 MODULE_DEVICE_TABLE(pci, hisax_pci_tbl);
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_PCI && MODULE */
 
 module_init(HiSax_init);
 module_exit(HiSax_exit);