All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ixj.c: EXPORT_SYMBOL of static functions
@ 2003-06-22  1:02 Adrian Bunk
  2003-06-22 11:23 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2003-06-22  1:02 UTC (permalink / raw)
  To: Ed Okerson; +Cc: linux-kernel, trivial

drivers/telephony/ixj.c EXPORT_SYMBOL's two static functions.

Does this make any sense or is the patch below OK?

cu
Adrian


--- linux-2.5.72-mm2/drivers/telephony/ixj.c.old	2003-06-22 02:47:07.000000000 +0200
+++ linux-2.5.72-mm2/drivers/telephony/ixj.c	2003-06-22 02:51:49.000000000 +0200
@@ -404,14 +404,10 @@
 	return 0;
 }
 
-static IXJ_REGFUNC ixj_DownloadG729 = &Stub;
-static IXJ_REGFUNC ixj_DownloadTS85 = &Stub;
 static IXJ_REGFUNC ixj_PreRead = &Stub;
 static IXJ_REGFUNC ixj_PostRead = &Stub;
 static IXJ_REGFUNC ixj_PreWrite = &Stub;
 static IXJ_REGFUNC ixj_PostWrite = &Stub;
-static IXJ_REGFUNC ixj_PreIoctl = &Stub;
-static IXJ_REGFUNC ixj_PostIoctl = &Stub;
 
 static void ixj_read_frame(IXJ *j);
 static void ixj_write_frame(IXJ *j);
@@ -790,97 +786,6 @@
 	return 0;
 }
 
-static int ixj_register(int index, IXJ_REGFUNC regfunc)
-{
-	int cnt;
-	int retval = 0;
-	switch (index) {
-	case G729LOADER:
-		ixj_DownloadG729 = regfunc;
-		for (cnt = 0; cnt < IXJMAX; cnt++) {
-			IXJ *j = get_ixj(cnt);
-			while(test_and_set_bit(cnt, (void *)&j->busyflags) != 0) {
-				set_current_state(TASK_INTERRUPTIBLE);
-				schedule_timeout(1);
-			}
-			ixj_DownloadG729(j, 0L);
-			clear_bit(cnt, &j->busyflags);
-		}
-		break;
-	case TS85LOADER:
-		ixj_DownloadTS85 = regfunc;
-		for (cnt = 0; cnt < IXJMAX; cnt++) {
-			IXJ *j = get_ixj(cnt);
-			while(test_and_set_bit(cnt, (void *)&j->busyflags) != 0) {
-				set_current_state(TASK_INTERRUPTIBLE);
-				schedule_timeout(1);
-			}
-			ixj_DownloadTS85(j, 0L);
-			clear_bit(cnt, &j->busyflags);
-		}
-		break;
-	case PRE_READ:
-		ixj_PreRead = regfunc;
-		break;
-	case POST_READ:
-		ixj_PostRead = regfunc;
-		break;
-	case PRE_WRITE:
-		ixj_PreWrite = regfunc;
-		break;
-	case POST_WRITE:
-		ixj_PostWrite = regfunc;
-		break;
-	case PRE_IOCTL:
-		ixj_PreIoctl = regfunc;
-		break;
-	case POST_IOCTL:
-		ixj_PostIoctl = regfunc;
-		break;
-	default:
-		retval = 1;
-	}
-	return retval;
-}
-
-EXPORT_SYMBOL(ixj_register);
-
-static int ixj_unregister(int index)
-{
-	int retval = 0;
-	switch (index) {
-	case G729LOADER:
-		ixj_DownloadG729 = &Stub;
-		break;
-	case TS85LOADER:
-		ixj_DownloadTS85 = &Stub;
-		break;
-	case PRE_READ:
-		ixj_PreRead = &Stub;
-		break;
-	case POST_READ:
-		ixj_PostRead = &Stub;
-		break;
-	case PRE_WRITE:
-		ixj_PreWrite = &Stub;
-		break;
-	case POST_WRITE:
-		ixj_PostWrite = &Stub;
-		break;
-	case PRE_IOCTL:
-		ixj_PreIoctl = &Stub;
-		break;
-	case POST_IOCTL:
-		ixj_PostIoctl = &Stub;
-		break;
-	default:
-		retval = 1;
-	}
-	return retval;
-}
-
-EXPORT_SYMBOL(ixj_unregister);
-
 static void ixj_init_timer(IXJ *j)
 {
 	init_timer(&j->timer);

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

* Re: [patch] ixj.c: EXPORT_SYMBOL of static functions
  2003-06-22  1:02 [patch] ixj.c: EXPORT_SYMBOL of static functions Adrian Bunk
@ 2003-06-22 11:23 ` Alan Cox
  2003-06-22 17:05   ` Kai Germaschewski
  2003-06-23  6:31   ` Rusty Russell
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Cox @ 2003-06-22 11:23 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Ed Okerson, Linux Kernel Mailing List, trivial

On Sul, 2003-06-22 at 02:02, Adrian Bunk wrote:
> drivers/telephony/ixj.c EXPORT_SYMBOL's two static functions.
> 
> Does this make any sense or is the patch below OK?

It's meant to export them. An exported static function is visible to
other modules.


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

* Re: [patch] ixj.c: EXPORT_SYMBOL of static functions
  2003-06-22 11:23 ` Alan Cox
@ 2003-06-22 17:05   ` Kai Germaschewski
  2003-06-23  6:31   ` Rusty Russell
  1 sibling, 0 replies; 4+ messages in thread
From: Kai Germaschewski @ 2003-06-22 17:05 UTC (permalink / raw)
  To: Alan Cox; +Cc: Adrian Bunk, Ed Okerson, Linux Kernel Mailing List, trivial

On 22 Jun 2003, Alan Cox wrote:

> On Sul, 2003-06-22 at 02:02, Adrian Bunk wrote:
> > drivers/telephony/ixj.c EXPORT_SYMBOL's two static functions.
> > 
> > Does this make any sense or is the patch below OK?
> 
> It's meant to export them. An exported static function is visible to
> other modules.

The exported functions shouldn't normally be declared static though, 
because that means that they will not be available to other modules in the 
built-in case.

So most likely the correct fix is to remove the "static". However, 
ixj_register() still doesn't seem to be used anywhere at all, at least not 
by in-tree modules.

--Kai



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

* Re: [patch] ixj.c: EXPORT_SYMBOL of static functions
  2003-06-22 11:23 ` Alan Cox
  2003-06-22 17:05   ` Kai Germaschewski
@ 2003-06-23  6:31   ` Rusty Russell
  1 sibling, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2003-06-23  6:31 UTC (permalink / raw)
  To: Alan Cox; +Cc: Ed Okerson, Linux Kernel Mailing List, trivial

In message <1056280986.2075.8.camel@dhcp22.swansea.linux.org.uk> you write:
> On Sul, 2003-06-22 at 02:02, Adrian Bunk wrote:
> > drivers/telephony/ixj.c EXPORT_SYMBOL's two static functions.
> > 
> > Does this make any sense or is the patch below OK?
> 
> It's meant to export them. An exported static function is visible to
> other modules.

But only to modules.  In general, exported shouldn't be static.

Someone care to clarify who uses these?
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

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

end of thread, other threads:[~2003-06-23  6:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-22  1:02 [patch] ixj.c: EXPORT_SYMBOL of static functions Adrian Bunk
2003-06-22 11:23 ` Alan Cox
2003-06-22 17:05   ` Kai Germaschewski
2003-06-23  6:31   ` Rusty Russell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.