Skip to contentSkip to conversation

Staging: cpc-usb: depends on PROC_FS

PATCH New Alexander Beregalov 1 participant 2 messages May 21, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Staging: cpc-usb: depends on PROC_FS

Fix this build error when PROC_FS is not enabled:
cpc-usb_drv.c:61:2: error: #error "PROCFS needed" cpc-usb_drv.c:1159: error: implicit declaration of function 'proc_mkdir'

---
 drivers/staging/cpc-usb/Kconfig       |    2 +-
 drivers/staging/cpc-usb/cpc-usb_drv.c |    8 +-------
 drivers/staging/cpc-usb/cpc_int.h     |    4 +---
 3 files changed, 3 insertions(+), 11 deletions(-)
drivers/staging/cpc-usb/Kconfig +1 -1
index 00924ce..2be0bc9 100644
@@ -1,4 +1,4 @@
 config USB_CPC
 	tristate "CPC CAN USB driver"
-	depends on USB
+	depends on USB && PROC_FS
 	default n
drivers/staging/cpc-usb/cpc-usb_drv.c +1 -7
index 14aca39..d337a97 100644
@@ -30,9 +30,7 @@
 
 #include <linux/version.h>
 
-#ifdef CONFIG_PROC_FS
-#   include <linux/proc_fs.h>
-#endif
+#include <linux/proc_fs.h>
 
 #include "cpc.h"
 
@@ -57,10 +55,6 @@ MODULE_LICENSE("GPL v2");
 #define USB_CPCUSB_M16C_PRODUCT_ID    0x0888
 #define USB_CPCUSB_LPC2119_PRODUCT_ID 0x0444
 
-#ifndef CONFIG_PROC_FS
-#error "PROCFS needed"
-#endif
-
 #define CPC_USB_PROC_DIR     CPC_PROC_DIR "cpc-usb"
 
 static struct proc_dir_entry *procDir;
drivers/staging/cpc-usb/cpc_int.h +1 -3
index dfdbed1..a0d60c0 100644
@@ -15,9 +15,7 @@
 
 #define CPC_MSG_BUF_CNT	1500
 
-#ifdef CONFIG_PROC_FS
-#   define CPC_PROC_DIR "driver/"
-#endif
+#define CPC_PROC_DIR "driver/"
 
 #undef dbg
 #undef err
#1 lore raw

PATCH 2/2 Staging: cpc-usb: fix printk format warnings

Fix this warnings:
cpc-usb_drv.c:478: warning: format '%d' expects type 'int',
but argument 4 has type 'size_t'
cpc-usb_drv.c:1034: warning: format '%d' expects type 'int',
but argument 3 has type 'long unsigned int'

---
 drivers/staging/cpc-usb/cpc-usb_drv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/cpc-usb/cpc-usb_drv.c +2 -2
index d337a97..8e312c7 100644
@@ -475,7 +475,7 @@ static ssize_t cpcusb_write(struct file *file, const char *buffer,
 	unsigned char type = 0;
 	CPC_MSG_T *info = NULL;
 
-	dbg("%s - entered minor %d, count = %d, present = %d",
+	dbg("%s - entered minor %d, count = %zu, present = %d",
 	    __func__, card->minor, count, card->present);
 
 	if (count > sizeof(CPC_MSG_T))
@@ -1031,7 +1031,7 @@ static int cpcusb_probe(struct usb_interface *interface,
 		retval = -ENOMEM;
 		goto error;
 	}
-	info("Allocated memory for %d messages (%d kbytes)",
+	info("Allocated memory for %d messages (%lu kbytes)",
 	     CPC_MSG_BUF_CNT, (sizeof(CPC_MSG_T) * CPC_MSG_BUF_CNT) / 1000);
 	memset(chan->buf, 0, sizeof(CPC_MSG_T) * CPC_MSG_BUF_CNT);
 
Signature · 1 line
1.6.3.1