linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] drivers/macintosh/: possible cleanups
@ 2008-06-09 22:23 Adrian Bunk
  2008-06-10  0:21 ` Stephen Rothwell
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2008-06-09 22:23 UTC (permalink / raw)
  To: paulus, geert, zippel; +Cc: linuxppc-dev, linux-m68k, linux-kernel

This patch contains the following possible cleanups:
- make the following needlessly global code static:
  - adb.c: adb_controller
  - adb.c: adb_init()
  - adbhid.c: adb_to_linux_keycodes[]
  - via-pmu68k.c: backlight_level
  - via-pmu68k.c: backlight_enabled
- remove the following unused code:
  - via-pmu68k.c: sleep_notifier_list

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 drivers/macintosh/adb.c        |    5 ++---
 drivers/macintosh/adbhid.c     |    2 +-
 drivers/macintosh/via-pmu68k.c |    5 ++---
 include/linux/adb.h            |    1 -
 4 files changed, 5 insertions(+), 8 deletions(-)

45413fb42fb4215d80bb15f50a5bdc869465e9a1 diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index dbaad39..61b62a6 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -46,7 +46,6 @@
 #endif
 
 
-EXPORT_SYMBOL(adb_controller);
 EXPORT_SYMBOL(adb_client_list);
 
 extern struct adb_driver via_macii_driver;
@@ -80,7 +79,7 @@ static struct adb_driver *adb_driver_list[] = {
 
 static struct class *adb_dev_class;
 
-struct adb_driver *adb_controller;
+static struct adb_driver *adb_controller;
 BLOCKING_NOTIFIER_HEAD(adb_client_list);
 static int adb_got_sleep;
 static int adb_inited;
@@ -290,7 +289,7 @@ static int adb_resume(struct platform_device *dev)
 }
 #endif /* CONFIG_PM */
 
-int __init adb_init(void)
+static int __init adb_init(void)
 {
 	struct adb_driver *driver;
 	int i;
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index ef4c117..af72f97 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_notifier = {
 #define ADB_KEY_POWER_OLD	0x7e
 #define ADB_KEY_POWER		0x7f
 
-u16 adb_to_linux_keycodes[128] = {
+static u16 adb_to_linux_keycodes[128] = {
 	/* 0x00 */ KEY_A, 		/*  30 */
 	/* 0x01 */ KEY_S, 		/*  31 */
 	/* 0x02 */ KEY_D,		/*  32 */
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index e2f84da..b64741c 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -101,7 +101,6 @@ static int pmu_kind = PMU_UNKNOWN;
 static int pmu_fully_inited;
 
 int asleep;
-BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
 
 static int pmu_probe(void);
 static int pmu_init(void);
@@ -741,8 +740,8 @@ pmu_handle_data(unsigned char *data, int len)
 	}
 }
 
-int backlight_level = -1;
-int backlight_enabled = 0;
+static int backlight_level = -1;
+static int backlight_enabled = 0;
 
 #define LEVEL_TO_BRIGHT(lev)	((lev) < 1? 0x7f: 0x4a - ((lev) << 1))
 
diff --git a/include/linux/adb.h b/include/linux/adb.h
index 64d8878..63bca50 100644
--- a/include/linux/adb.h
+++ b/include/linux/adb.h
@@ -84,7 +84,6 @@ enum adb_message {
     ADB_MSG_PRE_RESET,	/* Called before resetting the bus */
     ADB_MSG_POST_RESET	/* Called after resetting the bus (re-do init & register) */
 };
-extern struct adb_driver *adb_controller;
 extern struct blocking_notifier_head adb_client_list;
 
 int adb_request(struct adb_request *req, void (*done)(struct adb_request *),

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

* Re: [2.6 patch] drivers/macintosh/: possible cleanups
  2008-06-09 22:23 [2.6 patch] drivers/macintosh/: possible cleanups Adrian Bunk
@ 2008-06-10  0:21 ` Stephen Rothwell
  2008-06-23 17:46   ` Adrian Bunk
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2008-06-10  0:21 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, linuxppc-dev, linux-m68k, geert, paulus

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

Hi Adrian,

On Tue, 10 Jun 2008 01:23:12 +0300 Adrian Bunk <bunk@kernel.org> wrote:
>
> +++ b/drivers/macintosh/adbhid.c
> @@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_notifier = {
>  #define ADB_KEY_POWER_OLD	0x7e
>  #define ADB_KEY_POWER		0x7f
>  
> -u16 adb_to_linux_keycodes[128] = {
> +static u16 adb_to_linux_keycodes[128] = {

This could be const as well.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* [2.6 patch] drivers/macintosh/: possible cleanups
  2008-06-10  0:21 ` Stephen Rothwell
@ 2008-06-23 17:46   ` Adrian Bunk
  2008-06-23 18:14     ` Geert Uytterhoeven
  2008-06-24  0:38     ` Stephen Rothwell
  0 siblings, 2 replies; 5+ messages in thread
From: Adrian Bunk @ 2008-06-23 17:46 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-m68k, linux-kernel, linuxppc-dev, geert, paulus

On Tue, Jun 10, 2008 at 10:21:25AM +1000, Stephen Rothwell wrote:
> Hi Adrian,
> 
> On Tue, 10 Jun 2008 01:23:12 +0300 Adrian Bunk <bunk@kernel.org> wrote:
> >
> > +++ b/drivers/macintosh/adbhid.c
> > @@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_notifier = {
> >  #define ADB_KEY_POWER_OLD	0x7e
> >  #define ADB_KEY_POWER		0x7f
> >  
> > -u16 adb_to_linux_keycodes[128] = {
> > +static u16 adb_to_linux_keycodes[128] = {
> 
> This could be const as well.

Updated patch below.

cu
Adrian


<--  snip  -->


This patch contains the following possible cleanups:
- make the following needlessly global code static:
  - adb.c: adb_controller
  - adb.c: adb_init()
  - adbhid.c: adb_to_linux_keycodes[]  (also make it const)
  - via-pmu68k.c: backlight_level
  - via-pmu68k.c: backlight_enabled
- remove the following unused code:
  - via-pmu68k.c: sleep_notifier_list

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 drivers/macintosh/adb.c        |    5 ++---
 drivers/macintosh/adbhid.c     |    2 +-
 drivers/macintosh/via-pmu68k.c |    5 ++---
 include/linux/adb.h            |    1 -
 4 files changed, 5 insertions(+), 8 deletions(-)

45413fb42fb4215d80bb15f50a5bdc869465e9a1 diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index dbaad39..61b62a6 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -46,7 +46,6 @@
 #endif
 
 
-EXPORT_SYMBOL(adb_controller);
 EXPORT_SYMBOL(adb_client_list);
 
 extern struct adb_driver via_macii_driver;
@@ -80,7 +79,7 @@ static struct adb_driver *adb_driver_list[] = {
 
 static struct class *adb_dev_class;
 
-struct adb_driver *adb_controller;
+static struct adb_driver *adb_controller;
 BLOCKING_NOTIFIER_HEAD(adb_client_list);
 static int adb_got_sleep;
 static int adb_inited;
@@ -290,7 +289,7 @@ static int adb_resume(struct platform_device *dev)
 }
 #endif /* CONFIG_PM */
 
-int __init adb_init(void)
+static int __init adb_init(void)
 {
 	struct adb_driver *driver;
 	int i;
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index ef4c117..af72f97 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_notifier = {
 #define ADB_KEY_POWER_OLD	0x7e
 #define ADB_KEY_POWER		0x7f
 
-u16 adb_to_linux_keycodes[128] = {
+static const u16 adb_to_linux_keycodes[128] = {
 	/* 0x00 */ KEY_A, 		/*  30 */
 	/* 0x01 */ KEY_S, 		/*  31 */
 	/* 0x02 */ KEY_D,		/*  32 */
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index e2f84da..b64741c 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -101,7 +101,6 @@ static int pmu_kind = PMU_UNKNOWN;
 static int pmu_fully_inited;
 
 int asleep;
-BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
 
 static int pmu_probe(void);
 static int pmu_init(void);
@@ -741,8 +740,8 @@ pmu_handle_data(unsigned char *data, int len)
 	}
 }
 
-int backlight_level = -1;
-int backlight_enabled = 0;
+static int backlight_level = -1;
+static int backlight_enabled = 0;
 
 #define LEVEL_TO_BRIGHT(lev)	((lev) < 1? 0x7f: 0x4a - ((lev) << 1))
 
diff --git a/include/linux/adb.h b/include/linux/adb.h
index 64d8878..63bca50 100644
--- a/include/linux/adb.h
+++ b/include/linux/adb.h
@@ -84,7 +84,6 @@ enum adb_message {
     ADB_MSG_PRE_RESET,	/* Called before resetting the bus */
     ADB_MSG_POST_RESET	/* Called after resetting the bus (re-do init & register) */
 };
-extern struct adb_driver *adb_controller;
 extern struct blocking_notifier_head adb_client_list;
 
 int adb_request(struct adb_request *req, void (*done)(struct adb_request *),

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

* Re: [2.6 patch] drivers/macintosh/: possible cleanups
  2008-06-23 17:46   ` Adrian Bunk
@ 2008-06-23 18:14     ` Geert Uytterhoeven
  2008-06-24  0:38     ` Stephen Rothwell
  1 sibling, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2008-06-23 18:14 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Stephen Rothwell, linux-m68k, linux-kernel, linuxppc-dev, paulus

On Mon, 23 Jun 2008, Adrian Bunk wrote:
> On Tue, Jun 10, 2008 at 10:21:25AM +1000, Stephen Rothwell wrote:
> > On Tue, 10 Jun 2008 01:23:12 +0300 Adrian Bunk <bunk@kernel.org> wrote:
> > >
> > > +++ b/drivers/macintosh/adbhid.c
> > > @@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_notifier = {
> > >  #define ADB_KEY_POWER_OLD	0x7e
> > >  #define ADB_KEY_POWER		0x7f
> > >  
> > > -u16 adb_to_linux_keycodes[128] = {
> > > +static u16 adb_to_linux_keycodes[128] = {
> > 
> > This could be const as well.
> 
> Updated patch below.
> 
> cu
> Adrian
> 
> <--  snip  -->
> 
> This patch contains the following possible cleanups:
> - make the following needlessly global code static:
>   - adb.c: adb_controller
>   - adb.c: adb_init()
>   - adbhid.c: adb_to_linux_keycodes[]  (also make it const)
>   - via-pmu68k.c: backlight_level
>   - via-pmu68k.c: backlight_enabled
> - remove the following unused code:
>   - via-pmu68k.c: sleep_notifier_list
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

I assume Paulus will take it, as he controls more Macs?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [2.6 patch] drivers/macintosh/: possible cleanups
  2008-06-23 17:46   ` Adrian Bunk
  2008-06-23 18:14     ` Geert Uytterhoeven
@ 2008-06-24  0:38     ` Stephen Rothwell
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2008-06-24  0:38 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-m68k, linux-kernel, linuxppc-dev, geert, paulus

[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]

On Mon, 23 Jun 2008 20:46:57 +0300 Adrian Bunk <bunk@kernel.org> wrote:
>
> On Tue, Jun 10, 2008 at 10:21:25AM +1000, Stephen Rothwell wrote:
> > Hi Adrian,
> > 
> > On Tue, 10 Jun 2008 01:23:12 +0300 Adrian Bunk <bunk@kernel.org> wrote:
> > >
> > > +++ b/drivers/macintosh/adbhid.c
> > > @@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_notifier = {
> > >  #define ADB_KEY_POWER_OLD	0x7e
> > >  #define ADB_KEY_POWER		0x7f
> > >  
> > > -u16 adb_to_linux_keycodes[128] = {
> > > +static u16 adb_to_linux_keycodes[128] = {
> > 
> > This could be const as well.
> 
> Updated patch below.
> 
> cu
> Adrian
> 
> 
> <--  snip  -->
> 
> 
> This patch contains the following possible cleanups:
> - make the following needlessly global code static:
>   - adb.c: adb_controller
>   - adb.c: adb_init()
>   - adbhid.c: adb_to_linux_keycodes[]  (also make it const)
>   - via-pmu68k.c: backlight_level
>   - via-pmu68k.c: backlight_enabled
> - remove the following unused code:
>   - via-pmu68k.c: sleep_notifier_list
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2008-06-24  0:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-09 22:23 [2.6 patch] drivers/macintosh/: possible cleanups Adrian Bunk
2008-06-10  0:21 ` Stephen Rothwell
2008-06-23 17:46   ` Adrian Bunk
2008-06-23 18:14     ` Geert Uytterhoeven
2008-06-24  0:38     ` Stephen Rothwell

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).