mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH] Staging: speakup: Added EXPORT_SYMBOL_GPL() markings.
@ 2010-10-11 22:36 Tracey Dent
  2010-10-11 23:00 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: Tracey Dent @ 2010-10-11 22:36 UTC (permalink / raw)
  To: greg; +Cc: w.d.hubbs, chris, kirk, samuel.thibault, linux-kernel, Tracey Dent

Changed drivers/char/selection.c so that drivers/staging/speakup/selections.c
could export. Also delete some lines that were unessary since I used
EXPORT_SYMBOL_GPL().

Greg can you review this and tell me if I did it right.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
---
 drivers/char/selection.c            |    7 +++++++
 drivers/staging/speakup/selection.c |   29 +++++++----------------------
 2 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index ebae344..a17aa42 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -64,6 +64,8 @@ sel_pos(int n)
 				use_unicode);
 }
 
+EXPORT_SYMBOL_GPL(sel_pos);
+
 /* remove the current selection highlight, if any,
    from the console holding the selection. */
 void
@@ -75,6 +77,8 @@ clear_selection(void) {
 	}
 }
 
+EXPORT_SYMBOL_GPL(clear_selection);
+
 /*
  * User settable table: what characters are to be considered alphabetic?
  * 256 bits
@@ -106,12 +110,15 @@ static inline int atedge(const int p, int size_row)
 	return (!(p % size_row)	|| !((p + 2) % size_row));
 }
 
+EXPORT_SYMBOL_GPL(atedge);
+
 /* constrain v such that v <= u */
 static inline unsigned short limit(const unsigned short v, const unsigned short u)
 {
 	return (v > u) ? u : v;
 }
 
+EXPORT_SYMBOL_GPL(limit);
 /* stores the char in UTF8 and returns the number of bytes used (1-3) */
 static int store_utf8(u16 c, char *p)
 {
diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
index 1b865ff..9195709 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -3,6 +3,7 @@
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/selection.h>
+#include <linux/module.h>
 
 #include "speakup.h"
 
@@ -21,27 +22,11 @@ static int sel_end;
 static int sel_buffer_lth;
 static char *sel_buffer;
 
-static unsigned char sel_pos(int n)
-{
-	return inverse_translate(spk_sel_cons, screen_glyph(spk_sel_cons, n), 0);
-}
-
-void speakup_clear_selection(void)
-{
-	sel_start = -1;
-}
+extern u16 sel_pos(int n);
+extern void clear_selection(void);
+extern inline int atedge(const int p, int size_row);
+extern inline unsigned short limit(const unsigned short v, const unsigned short u);
 
-/* does screen address p correspond to character at LH/RH edge of screen? */
-static int atedge(const int p, int size_row)
-{
-	return (!(p % size_row) || !((p + 2) % size_row));
-}
-
-/* constrain v such that v <= u */
-static unsigned short limit(const unsigned short v, const unsigned short u)
-{
-	return (v > u) ? u : v;
-}
 
 int speakup_set_selection(struct tty_struct *tty)
 {
@@ -65,7 +50,7 @@ int speakup_set_selection(struct tty_struct *tty)
 	}
 
 	if (spk_sel_cons != vc_cons[fg_console].d) {
-		speakup_clear_selection();
+		clear_selection();
 		spk_sel_cons = vc_cons[fg_console].d;
 		printk(KERN_WARNING
 			"Selection: mark console not the same as cut\n");
@@ -95,7 +80,7 @@ int speakup_set_selection(struct tty_struct *tty)
 	bp = kmalloc((sel_end-sel_start)/2+1, GFP_ATOMIC);
 	if (!bp) {
 		printk(KERN_WARNING "selection: kmalloc() failed\n");
-		speakup_clear_selection();
+		clear_selection();
 		return -ENOMEM;
 	}
 	kfree(sel_buffer);
-- 
1.7.3.1.104.gc752e


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

* Re: [RFC PATCH] Staging: speakup: Added EXPORT_SYMBOL_GPL() markings.
  2010-10-11 22:36 [RFC PATCH] Staging: speakup: Added EXPORT_SYMBOL_GPL() markings Tracey Dent
@ 2010-10-11 23:00 ` Samuel Thibault
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2010-10-11 23:00 UTC (permalink / raw)
  To: Tracey Dent; +Cc: greg, w.d.hubbs, chris, kirk, linux-kernel

Tracey Dent, le Mon 11 Oct 2010 18:36:30 -0400, a écrit :
> -void speakup_clear_selection(void)
> -{
> -	sel_start = -1;
> -}

Mmm, this won't be so simple actually, as speakup_set_selection and
speakup_paste_selection will still be using speakup/selection.c's
sel_start variable.  I guess all speakup/selection.c will need to be
migrated to using drivers/char/selection.c functions at the same time.

speakup_paste_selection is basically like paste_selection, except that
it can be called with in_atomic() being true.  Yes, it's a hack.  The
calls to speakup_past_selection should first be moved to a helper
thread, and then the main paste_selection function can be used instead.

speakup_set_selection is basically like set_selection, except that it
doesn't take a userland structure, but gets the values from kernelland
speakup.  A kernel-land variant of set_selection should probably be
defined that takes a kernelland structure. Apart from that, I don't
think speakup_set_selection has anything particular compared to the main
version.  Kirk, can you confirm?

Samuel

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

end of thread, other threads:[~2010-10-11 23:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-11 22:36 [RFC PATCH] Staging: speakup: Added EXPORT_SYMBOL_GPL() markings Tracey Dent
2010-10-11 23:00 ` Samuel Thibault

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

all inboxes | Powered by JetHome®