linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Staging: cpc-usb: depends on PROC_FS
@ 2009-05-21 11:44 Alexander Beregalov
  2009-05-21 11:44 ` [PATCH 2/2] Staging: cpc-usb: fix printk format warnings Alexander Beregalov
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Beregalov @ 2009-05-21 11:44 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-next, Alexander Beregalov

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'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 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(-)

diff --git a/drivers/staging/cpc-usb/Kconfig b/drivers/staging/cpc-usb/Kconfig
index 00924ce..2be0bc9 100644
--- a/drivers/staging/cpc-usb/Kconfig
+++ b/drivers/staging/cpc-usb/Kconfig
@@ -1,4 +1,4 @@
 config USB_CPC
 	tristate "CPC CAN USB driver"
-	depends on USB
+	depends on USB && PROC_FS
 	default n
diff --git a/drivers/staging/cpc-usb/cpc-usb_drv.c b/drivers/staging/cpc-usb/cpc-usb_drv.c
index 14aca39..d337a97 100644
--- a/drivers/staging/cpc-usb/cpc-usb_drv.c
+++ b/drivers/staging/cpc-usb/cpc-usb_drv.c
@@ -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;
diff --git a/drivers/staging/cpc-usb/cpc_int.h b/drivers/staging/cpc-usb/cpc_int.h
index dfdbed1..a0d60c0 100644
--- a/drivers/staging/cpc-usb/cpc_int.h
+++ b/drivers/staging/cpc-usb/cpc_int.h
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] Staging: cpc-usb: fix printk format warnings
  2009-05-21 11:44 [PATCH 1/2] Staging: cpc-usb: depends on PROC_FS Alexander Beregalov
@ 2009-05-21 11:44 ` Alexander Beregalov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Beregalov @ 2009-05-21 11:44 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-next, Alexander Beregalov

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'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 drivers/staging/cpc-usb/cpc-usb_drv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cpc-usb/cpc-usb_drv.c b/drivers/staging/cpc-usb/cpc-usb_drv.c
index d337a97..8e312c7 100644
--- a/drivers/staging/cpc-usb/cpc-usb_drv.c
+++ b/drivers/staging/cpc-usb/cpc-usb_drv.c
@@ -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);
 
-- 
1.6.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-21 11:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-21 11:44 [PATCH 1/2] Staging: cpc-usb: depends on PROC_FS Alexander Beregalov
2009-05-21 11:44 ` [PATCH 2/2] Staging: cpc-usb: fix printk format warnings Alexander Beregalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).