[PATCH -mm] isdn hisax gcc 4.1 warning fix

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

 



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

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

Index: linux-2.6.16/drivers/isdn/hisax/config.c
===================================================================
--- linux-2.6.16.orig/drivers/isdn/hisax/config.c
+++ 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);
-
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