public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] misc ISAPNP cleanups
@ 2004-11-13  3:02 Adrian Bunk
  2004-11-16  5:03 ` Adam Belay
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2004-11-13  3:02 UTC (permalink / raw)
  To: perex; +Cc: ambx1, linux-kernel

The patch below removes some completely unused code and makes some 
needlessly global code static in drivers/pnp/isapnp/core.c .

Please review whether this patch is correct or whether it conflicts with 
pending ISAPNP updates/usages.


diffstat output:
 drivers/pnp/isapnp/core.c |   47 ++++++++------------------------------
 include/linux/isapnp.h    |   20 ----------------
 2 files changed, 11 insertions(+), 56 deletions(-)


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.10-rc1-mm5-full/include/linux/isapnp.h.old	2004-11-13 03:28:53.000000000 +0100
+++ linux-2.6.10-rc1-mm5-full/include/linux/isapnp.h	2004-11-13 03:34:16.000000000 +0100
@@ -100,16 +100,7 @@
 int isapnp_cfg_begin(int csn, int device);
 int isapnp_cfg_end(void);
 unsigned char isapnp_read_byte(unsigned char idx);
-unsigned short isapnp_read_word(unsigned char idx);
-unsigned int isapnp_read_dword(unsigned char idx);
 void isapnp_write_byte(unsigned char idx, unsigned char val);
-void isapnp_write_word(unsigned char idx, unsigned short val);
-void isapnp_write_dword(unsigned char idx, unsigned int val);
-void isapnp_wake(unsigned char csn);
-void isapnp_device(unsigned char device);
-void isapnp_activate(unsigned char device);
-void isapnp_deactivate(unsigned char device);
-void *isapnp_alloc(long size);
 
 #ifdef CONFIG_PROC_FS
 int isapnp_proc_init(void);
@@ -119,9 +110,6 @@
 static inline int isapnp_proc_done(void) { return 0; }
 #endif
 
-/* init/main.c */
-int isapnp_init(void);
-
 /* compat */
 struct pnp_card *pnp_find_card(unsigned short vendor,
 			       unsigned short device,
@@ -138,15 +126,7 @@
 static inline int isapnp_cfg_begin(int csn, int device) { return -ENODEV; }
 static inline int isapnp_cfg_end(void) { return -ENODEV; }
 static inline unsigned char isapnp_read_byte(unsigned char idx) { return 0xff; }
-static inline unsigned short isapnp_read_word(unsigned char idx) { return 0xffff; }
-static inline unsigned int isapnp_read_dword(unsigned char idx) { return 0xffffffff; }
 static inline void isapnp_write_byte(unsigned char idx, unsigned char val) { ; }
-static inline void isapnp_write_word(unsigned char idx, unsigned short val) { ; }
-static inline void isapnp_write_dword(unsigned char idx, unsigned int val) { ; }
-static inline void isapnp_wake(unsigned char csn) { ; }
-static inline void isapnp_device(unsigned char device) { ; }
-static inline void isapnp_activate(unsigned char device) { ; }
-static inline void isapnp_deactivate(unsigned char device) { ; }
 
 static inline struct pnp_card *pnp_find_card(unsigned short vendor,
 					     unsigned short device,
--- linux-2.6.10-rc1-mm5-full/drivers/pnp/isapnp/core.c.old	2004-11-13 03:29:38.000000000 +0100
+++ linux-2.6.10-rc1-mm5-full/drivers/pnp/isapnp/core.c	2004-11-13 03:34:26.000000000 +0100
@@ -52,9 +52,9 @@
 #endif
 
 int isapnp_disable;			/* Disable ISA PnP */
-int isapnp_rdp;				/* Read Data Port */
-int isapnp_reset = 1;			/* reset all PnP cards (deactivate) */
-int isapnp_verbose = 1;			/* verbose mode */
+static int isapnp_rdp;			/* Read Data Port */
+static int isapnp_reset = 1;		/* reset all PnP cards (deactivate) */
+static int isapnp_verbose = 1;		/* verbose mode */
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Generic ISA Plug & Play support");
@@ -121,7 +121,7 @@
 	return read_data();
 }
 
-unsigned short isapnp_read_word(unsigned char idx)
+static unsigned short isapnp_read_word(unsigned char idx)
 {
 	unsigned short val;
 
@@ -130,38 +130,19 @@
 	return val;
 }
 
-unsigned int isapnp_read_dword(unsigned char idx)
-{
-	unsigned int val;
-
-	val = isapnp_read_byte(idx);
-	val = (val << 8) + isapnp_read_byte(idx+1);
-	val = (val << 8) + isapnp_read_byte(idx+2);
-	val = (val << 8) + isapnp_read_byte(idx+3);
-	return val;
-}
-
 void isapnp_write_byte(unsigned char idx, unsigned char val)
 {
 	write_address(idx);
 	write_data(val);
 }
 
-void isapnp_write_word(unsigned char idx, unsigned short val)
+static void isapnp_write_word(unsigned char idx, unsigned short val)
 {
 	isapnp_write_byte(idx, val >> 8);
 	isapnp_write_byte(idx+1, val);
 }
 
-void isapnp_write_dword(unsigned char idx, unsigned int val)
-{
-	isapnp_write_byte(idx, val >> 24);
-	isapnp_write_byte(idx+1, val >> 16);
-	isapnp_write_byte(idx+2, val >> 8);
-	isapnp_write_byte(idx+3, val);
-}
-
-void *isapnp_alloc(long size)
+static void *isapnp_alloc(long size)
 {
 	void *result;
 
@@ -196,24 +177,24 @@
 	isapnp_write_byte(0x02, 0x02);
 }
 
-void isapnp_wake(unsigned char csn)
+static void isapnp_wake(unsigned char csn)
 {
 	isapnp_write_byte(0x03, csn);
 }
 
-void isapnp_device(unsigned char logdev)
+static void isapnp_device(unsigned char logdev)
 {
 	isapnp_write_byte(0x07, logdev);
 }
 
-void isapnp_activate(unsigned char logdev)
+static void isapnp_activate(unsigned char logdev)
 {
 	isapnp_device(logdev);
 	isapnp_write_byte(ISAPNP_CFG_ACTIVATE, 1);
 	udelay(250);
 }
 
-void isapnp_deactivate(unsigned char logdev)
+static void isapnp_deactivate(unsigned char logdev)
 {
 	isapnp_device(logdev);
 	isapnp_write_byte(ISAPNP_CFG_ACTIVATE, 0);
@@ -972,13 +953,7 @@
 EXPORT_SYMBOL(isapnp_cfg_begin);
 EXPORT_SYMBOL(isapnp_cfg_end);
 EXPORT_SYMBOL(isapnp_read_byte);
-EXPORT_SYMBOL(isapnp_read_word);
-EXPORT_SYMBOL(isapnp_read_dword);
 EXPORT_SYMBOL(isapnp_write_byte);
-EXPORT_SYMBOL(isapnp_write_word);
-EXPORT_SYMBOL(isapnp_write_dword);
-EXPORT_SYMBOL(isapnp_wake);
-EXPORT_SYMBOL(isapnp_device);
 
 static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table *res)
 {
@@ -1070,7 +1045,7 @@
 	.disable = isapnp_disable_resources,
 };
 
-int __init isapnp_init(void)
+static int __init isapnp_init(void)
 {
 	int cards;
 	struct pnp_card *card;


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

* Re: [2.6 patch] misc ISAPNP cleanups
  2004-11-13  3:02 [2.6 patch] misc ISAPNP cleanups Adrian Bunk
@ 2004-11-16  5:03 ` Adam Belay
  2004-11-21 15:18   ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Belay @ 2004-11-16  5:03 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: perex, ambx1, linux-kernel

On Sat, Nov 13, 2004 at 04:02:34AM +0100, Adrian Bunk wrote:
> The patch below removes some completely unused code and makes some 
> needlessly global code static in drivers/pnp/isapnp/core.c .
> 
> Please review whether this patch is correct or whether it conflicts with 
> pending ISAPNP updates/usages.
> 
> 
> diffstat output:
>  drivers/pnp/isapnp/core.c |   47 ++++++++------------------------------
>  include/linux/isapnp.h    |   20 ----------------
>  2 files changed, 11 insertions(+), 56 deletions(-)
> 
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 

I have to check that this doesn't break any obscure isapnp drivers.  Otherwise
it looks good.  Some of them, like "isapnp_alloc", look obvious.

Thanks,
Adam

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

* Re: [2.6 patch] misc ISAPNP cleanups
  2004-11-16  5:03 ` Adam Belay
@ 2004-11-21 15:18   ` Adrian Bunk
  0 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2004-11-21 15:18 UTC (permalink / raw)
  To: ambx1, perex, linux-kernel

On Tue, Nov 16, 2004 at 12:03:16AM -0500, Adam Belay wrote:
> On Sat, Nov 13, 2004 at 04:02:34AM +0100, Adrian Bunk wrote:
> > The patch below removes some completely unused code and makes some 
> > needlessly global code static in drivers/pnp/isapnp/core.c .
> > 
> > Please review whether this patch is correct or whether it conflicts with 
> > pending ISAPNP updates/usages.
> > 
> > 
> > diffstat output:
> >  drivers/pnp/isapnp/core.c |   47 ++++++++------------------------------
> >  include/linux/isapnp.h    |   20 ----------------
> >  2 files changed, 11 insertions(+), 56 deletions(-)
> > 
> > 
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> > 
> 
> I have to check that this doesn't break any obscure isapnp drivers.  Otherwise

Why are these "obscure isapnp drivers" not included in the kernel?

> it looks good.  Some of them, like "isapnp_alloc", look obvious.
> 
> Thanks,
> Adam

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* [2.6 patch] misc ISAPNP cleanups
@ 2005-01-19  4:40 Adrian Bunk
  0 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2005-01-19  4:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: perex, ambx1, linux-kernel

This patch removes some completely unused code and makes some needlessly 
global code static in drivers/pnp/isapnp/core.c .

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

diffstat output:
 drivers/pnp/isapnp/core.c |   47 ++++++++------------------------------
 include/linux/isapnp.h    |   20 ----------------
 2 files changed, 11 insertions(+), 56 deletions(-)

This patch was already sent on:
- 13 Nov 2004

--- linux-2.6.10-rc1-mm5-full/include/linux/isapnp.h.old	2004-11-13 03:28:53.000000000 +0100
+++ linux-2.6.10-rc1-mm5-full/include/linux/isapnp.h	2004-11-13 03:34:16.000000000 +0100
@@ -100,16 +100,7 @@
 int isapnp_cfg_begin(int csn, int device);
 int isapnp_cfg_end(void);
 unsigned char isapnp_read_byte(unsigned char idx);
-unsigned short isapnp_read_word(unsigned char idx);
-unsigned int isapnp_read_dword(unsigned char idx);
 void isapnp_write_byte(unsigned char idx, unsigned char val);
-void isapnp_write_word(unsigned char idx, unsigned short val);
-void isapnp_write_dword(unsigned char idx, unsigned int val);
-void isapnp_wake(unsigned char csn);
-void isapnp_device(unsigned char device);
-void isapnp_activate(unsigned char device);
-void isapnp_deactivate(unsigned char device);
-void *isapnp_alloc(long size);
 
 #ifdef CONFIG_PROC_FS
 int isapnp_proc_init(void);
@@ -119,9 +110,6 @@
 static inline int isapnp_proc_done(void) { return 0; }
 #endif
 
-/* init/main.c */
-int isapnp_init(void);
-
 /* compat */
 struct pnp_card *pnp_find_card(unsigned short vendor,
 			       unsigned short device,
@@ -138,15 +126,7 @@
 static inline int isapnp_cfg_begin(int csn, int device) { return -ENODEV; }
 static inline int isapnp_cfg_end(void) { return -ENODEV; }
 static inline unsigned char isapnp_read_byte(unsigned char idx) { return 0xff; }
-static inline unsigned short isapnp_read_word(unsigned char idx) { return 0xffff; }
-static inline unsigned int isapnp_read_dword(unsigned char idx) { return 0xffffffff; }
 static inline void isapnp_write_byte(unsigned char idx, unsigned char val) { ; }
-static inline void isapnp_write_word(unsigned char idx, unsigned short val) { ; }
-static inline void isapnp_write_dword(unsigned char idx, unsigned int val) { ; }
-static inline void isapnp_wake(unsigned char csn) { ; }
-static inline void isapnp_device(unsigned char device) { ; }
-static inline void isapnp_activate(unsigned char device) { ; }
-static inline void isapnp_deactivate(unsigned char device) { ; }
 
 static inline struct pnp_card *pnp_find_card(unsigned short vendor,
 					     unsigned short device,
--- linux-2.6.10-rc1-mm5-full/drivers/pnp/isapnp/core.c.old	2004-11-13 03:29:38.000000000 +0100
+++ linux-2.6.10-rc1-mm5-full/drivers/pnp/isapnp/core.c	2004-11-13 03:34:26.000000000 +0100
@@ -52,9 +52,9 @@
 #endif
 
 int isapnp_disable;			/* Disable ISA PnP */
-int isapnp_rdp;				/* Read Data Port */
-int isapnp_reset = 1;			/* reset all PnP cards (deactivate) */
-int isapnp_verbose = 1;			/* verbose mode */
+static int isapnp_rdp;			/* Read Data Port */
+static int isapnp_reset = 1;		/* reset all PnP cards (deactivate) */
+static int isapnp_verbose = 1;		/* verbose mode */
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
 MODULE_DESCRIPTION("Generic ISA Plug & Play support");
@@ -121,7 +121,7 @@
 	return read_data();
 }
 
-unsigned short isapnp_read_word(unsigned char idx)
+static unsigned short isapnp_read_word(unsigned char idx)
 {
 	unsigned short val;
 
@@ -130,38 +130,19 @@
 	return val;
 }
 
-unsigned int isapnp_read_dword(unsigned char idx)
-{
-	unsigned int val;
-
-	val = isapnp_read_byte(idx);
-	val = (val << 8) + isapnp_read_byte(idx+1);
-	val = (val << 8) + isapnp_read_byte(idx+2);
-	val = (val << 8) + isapnp_read_byte(idx+3);
-	return val;
-}
-
 void isapnp_write_byte(unsigned char idx, unsigned char val)
 {
 	write_address(idx);
 	write_data(val);
 }
 
-void isapnp_write_word(unsigned char idx, unsigned short val)
+static void isapnp_write_word(unsigned char idx, unsigned short val)
 {
 	isapnp_write_byte(idx, val >> 8);
 	isapnp_write_byte(idx+1, val);
 }
 
-void isapnp_write_dword(unsigned char idx, unsigned int val)
-{
-	isapnp_write_byte(idx, val >> 24);
-	isapnp_write_byte(idx+1, val >> 16);
-	isapnp_write_byte(idx+2, val >> 8);
-	isapnp_write_byte(idx+3, val);
-}
-
-void *isapnp_alloc(long size)
+static void *isapnp_alloc(long size)
 {
 	void *result;
 
@@ -196,24 +177,24 @@
 	isapnp_write_byte(0x02, 0x02);
 }
 
-void isapnp_wake(unsigned char csn)
+static void isapnp_wake(unsigned char csn)
 {
 	isapnp_write_byte(0x03, csn);
 }
 
-void isapnp_device(unsigned char logdev)
+static void isapnp_device(unsigned char logdev)
 {
 	isapnp_write_byte(0x07, logdev);
 }
 
-void isapnp_activate(unsigned char logdev)
+static void isapnp_activate(unsigned char logdev)
 {
 	isapnp_device(logdev);
 	isapnp_write_byte(ISAPNP_CFG_ACTIVATE, 1);
 	udelay(250);
 }
 
-void isapnp_deactivate(unsigned char logdev)
+static void isapnp_deactivate(unsigned char logdev)
 {
 	isapnp_device(logdev);
 	isapnp_write_byte(ISAPNP_CFG_ACTIVATE, 0);
@@ -972,13 +953,7 @@
 EXPORT_SYMBOL(isapnp_cfg_begin);
 EXPORT_SYMBOL(isapnp_cfg_end);
 EXPORT_SYMBOL(isapnp_read_byte);
-EXPORT_SYMBOL(isapnp_read_word);
-EXPORT_SYMBOL(isapnp_read_dword);
 EXPORT_SYMBOL(isapnp_write_byte);
-EXPORT_SYMBOL(isapnp_write_word);
-EXPORT_SYMBOL(isapnp_write_dword);
-EXPORT_SYMBOL(isapnp_wake);
-EXPORT_SYMBOL(isapnp_device);
 
 static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table *res)
 {
@@ -1070,7 +1045,7 @@
 	.disable = isapnp_disable_resources,
 };
 
-int __init isapnp_init(void)
+static int __init isapnp_init(void)
 {
 	int cards;
 	struct pnp_card *card;


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

end of thread, other threads:[~2005-01-19  4:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-13  3:02 [2.6 patch] misc ISAPNP cleanups Adrian Bunk
2004-11-16  5:03 ` Adam Belay
2004-11-21 15:18   ` Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2005-01-19  4:40 Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox