Skip to contentSkip to conversation

staging: speakup: fix warning for static declaration

PATCH In review Gustavo A. R. Silva 3 participants 5 messages Mar 27, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: speakup: fix warning for static declaration

Fix the following sparse warning:
symbol 'spk_serial_out' was not declared. Should it be static?

---
 drivers/staging/speakup/serialio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/serialio.c +1 -1
index 5e31aca..3fab1c3 100644
@@ -243,7 +243,7 @@ unsigned char spk_serial_in_nowait(void)
 }
 EXPORT_SYMBOL_GPL(spk_serial_in_nowait);
 
-int spk_serial_out(struct spk_synth *in_synth, const char ch)
+static int spk_serial_out(struct spk_synth *in_synth, const char ch)
 {
 	if (in_synth->alive && spk_wait_for_xmitr(in_synth)) {
 		outb_p(ch, speakup_info.port_tts);
Signature · 1 line
2.5.0
#1 lore raw

Hi Gustavo,

Quoted 24 lines · Gustavo A. R. Silva

Fix the following sparse warning:
symbol 'spk_serial_out' was not declared. Should it be static?

---
 drivers/staging/speakup/serialio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/serialio.c +1 -1
index 5e31aca..3fab1c3 100644
@@ -243,7 +243,7 @@ unsigned char spk_serial_in_nowait(void)
 }
 EXPORT_SYMBOL_GPL(spk_serial_in_nowait);
 
-int spk_serial_out(struct spk_synth *in_synth, const char ch)
+static int spk_serial_out(struct spk_synth *in_synth, const char ch)
 {
 	if (in_synth->alive && spk_wait_for_xmitr(in_synth)) {
 		outb_p(ch, speakup_info.port_tts);
Signature · 1 line
2.5.0

Thanks for this :) Could you also move the function higher in the same file - above line 139 where all static functions are defined?

Okash

#2 lore raw
Quoted 2 lines · Okash Khawaja, on lun. 27 mars 2017 08:51:02 +0100, wrote:

Thanks for this :) Could you also move the function higher in the same file - above line 139 where all static functions are defined?

I'd say no need for this. spk_serial_in is just above. Moving functions just for the sake of static vs non-static does not make the code more readable to my eyes :)
(and it makes tracking changes harder in git annotate)

Samuel

#3 lore raw
Quoted 10 lines · Samuel Thibault
Quoted 2 lines · Okash Khawaja, on lun. 27 mars 2017 08:51:02 +0100, wrote:

Thanks for this :) Could you also move the function higher in the same file - above line 139 where all static functions are defined?

I'd say no need for this. spk_serial_in is just above. Moving functions just for the sake of static vs non-static does not make the code more readable to my eyes :)
(and it makes tracking changes harder in git annotate)

Samuel

Fair enough. When I marked it as static and moved it higher, I misinterpreted your comment as we neither want it static nor moved. You probably meant the latter :)

Reviewed-by on v1 1/1
#4 lore raw
In reply to Gustavo A. R. Silva
Quoted 4 lines · Gustavo A. R. Silva, on lun. 27 mars 2017 01:37:29 -0500, wrote:

Fix the following sparse warning:
symbol 'spk_serial_out' was not declared. Should it be static?

Yes, indeed.

Thanks

Quoted 20 lines
---
 drivers/staging/speakup/serialio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/serialio.c +1 -1
index 5e31aca..3fab1c3 100644
@@ -243,7 +243,7 @@ unsigned char spk_serial_in_nowait(void)
 }
 EXPORT_SYMBOL_GPL(spk_serial_in_nowait);
 
-int spk_serial_out(struct spk_synth *in_synth, const char ch)
+static int spk_serial_out(struct spk_synth *in_synth, const char ch)
 {
 	if (in_synth->alive && spk_wait_for_xmitr(in_synth)) {
 		outb_p(ch, speakup_info.port_tts);
Signature · 1 line
2.5.0
Signature · 5 lines
Samuel
 Je suis maintenant possesseur d'un ordinateur portable Compaq Armada
 1592DT avec port infra-rouge. Auriez-vous connaissance de programmes
 suceptibles d'utiliser ce port afin de servir de télécommande ?
 -+- JN in NPC : ben quoi, c'est pas à ça que ça sert ?