staging: speakup: Fix warning of line over 80 characters.
PATCH 1/1 staging: speakup: Fix warning of line over 80 characters.
This patch fixes the checkpatch.pl warning:
WARNING: line over 80 characters
All line over 80 characters in driver/staging/speakup/* are fixed
--- drivers/staging/speakup/main.c | 12 ++++++++---- drivers/staging/speakup/serialio.h | 3 ++- drivers/staging/speakup/speakup.h | 6 ++++-- drivers/staging/speakup/speakup_decext.c | 6 ++++-- drivers/staging/speakup/speakup_decpc.c | 6 ++++-- drivers/staging/speakup/spk_priv.h | 3 ++- drivers/staging/speakup/spk_types.h | 3 ++- drivers/staging/speakup/synth.c | 10 +++++----- 8 files changed, 31 insertions(+), 18 deletions(-)
drivers/staging/speakup/main.c +8 -4
@@ -422,8 +422,10 @@ static void announce_edge(struct vc_data *vc, int msg_id) {if (spk_bleeps &1 )bleep (spk_y); -if ((spk_bleeps &2 ) && (msg_id < edge_quiet)) -synth_printf ("%s\n" ,spk_msg_get (MSG_EDGE_MSGS_START + msg_id -1 )); +if ((spk_bleeps &2 ) && (msg_id < edge_quiet)) { +synth_printf ("%s\n" , +spk_msg_get (MSG_EDGE_MSGS_START + msg_id -1 )); + } }static void speak_char (u_char ch)
@@ -1131,7 +1133,8 @@ static void spkup_write(const char *in_buf, int count)if (in_count >2 && rep_count >2 ) {if (last_type &CH_RPT ) {synth_printf (" " ); -synth_printf (spk_msg_get (MSG_REPEAT_DESC2 ), ++rep_count); +synth_printf (spk_msg_get (MSG_REPEAT_DESC2 ), + ++rep_count);synth_printf (" " ); } rep_count =0 ;
@@ -1847,7 +1850,8 @@ static void speakup_win_set(struct vc_data *vc) win_right = spk_x; }snprintf (info,sizeof (info),spk_msg_get (MSG_WINDOW_BOUNDARY ), - (win_start) ?spk_msg_get (MSG_END ) :spk_msg_get (MSG_START ), + (win_start) ?spk_msg_get (MSG_END ) : +spk_msg_get (MSG_START ), (int )spk_y +1 , (int )spk_x +1 ); }synth_printf ("%s\n" , info);
drivers/staging/speakup/serialio.h +2 -1
@@ -34,6 +34,7 @@ struct old_serial_port {#define SPK_TIMEOUT 100#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) -#define spk_serial_tx_busy () ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY) +#define spk_serial_tx_busy () \ +((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)#endif
drivers/staging/speakup/speakup.h +4 -2
@@ -61,10 +61,12 @@ extern struct st_var_header *spk_get_var_header(enum var_id_t var_id);extern struct st_var_header *spk_var_header_by_name (const char *name);extern struct punc_var_t *spk_get_punc_var (enum var_id_t var_id);extern int spk_set_num_var (int val,struct st_var_header *var,int how); -extern int spk_set_string_var (const char *page,struct st_var_header *var,int len); +extern int spk_set_string_var (const char *page,struct st_var_header *var, +int len);extern int spk_set_mask_bits (const char *input,const int which,const int how);extern special_func spk_special_handler; -extern int spk_handle_help (struct vc_data *vc,u_char type,u_char ch,u_short key); +extern int spk_handle_help (struct vc_data *vc,u_char type,u_char ch, +u_short key);extern int synth_init (char *name);extern void synth_release (void );
drivers/staging/speakup/speakup_decext.c +4 -2
@@ -207,10 +207,12 @@ static void do_catch_up(struct spk_synth *synth)if (time_after_eq (jiffies, jiff_max)) {if (!in_escape)spk_serial_out (PROCSPEECH ); -spin_lock_irqsave (&speakup_info.spinlock, flags); +spin_lock_irqsave (&speakup_info.spinlock, + flags); jiffy_delta_val = jiffy_delta->u.n.value; delay_time_val = delay_time->u.n.value; -spin_unlock_irqrestore (&speakup_info.spinlock, flags); +spin_unlock_irqrestore (&speakup_info.spinlock, + flags);schedule_timeout (msecs_to_jiffies (delay_time_val)); jiff_max = jiffies + jiffy_delta_val;
drivers/staging/speakup/speakup_decpc.c +4 -2
@@ -423,10 +423,12 @@ static void do_catch_up(struct spk_synth *synth)if (time_after_eq (jiffies, jiff_max)) {if (!in_escape)dt_sendchar (PROCSPEECH ); -spin_lock_irqsave (&speakup_info.spinlock, flags); +spin_lock_irqsave (&speakup_info.spinlock, + flags); jiffy_delta_val = jiffy_delta->u.n.value; delay_time_val = delay_time->u.n.value; -spin_unlock_irqrestore (&speakup_info.spinlock, flags); +spin_unlock_irqrestore (&speakup_info.spinlock, + flags);schedule_timeout (msecs_to_jiffies (delay_time_val)); jiff_max = jiffies + jiffy_delta_val;
drivers/staging/speakup/spk_priv.h +2 -1
@@ -62,7 +62,8 @@ extern ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count);extern int spk_serial_synth_probe (struct spk_synth *synth); -extern const char *spk_synth_immediate (struct spk_synth *synth,const char *buff); +extern const char *spk_synth_immediate (struct spk_synth *synth, +const char *buff);extern void spk_do_catch_up (struct spk_synth *synth);extern void spk_synth_flush (struct spk_synth *synth);extern int spk_synth_is_alive_nop (struct spk_synth *synth);
drivers/staging/speakup/spk_types.h +2 -1
@@ -167,7 +167,8 @@ struct spk_synth {int *default_vol;int (*probe)(struct spk_synth *synth);void (*release)(void ); -const char *(*synth_immediate)(struct spk_synth *synth,const char *buff); +const char *(*synth_immediate)(struct spk_synth *synth, +const char *buff);void (*catch_up)(struct spk_synth *synth);void (*flush)(struct spk_synth *synth);int (*is_alive)(struct spk_synth *synth);
drivers/staging/speakup/synth.c +5 -5
@@ -30,12 +30,12 @@ struct speakup_info_t speakup_info = {* must be taken at each kernel->speakup transition and released at * each corresponding speakup->kernel transition. * -* The progression thread only interferes with the speakup machinery through -* the synth buffer, so only needs to take the lock while tinkering with -* the buffer. +* The progression thread only interferes with the speakup machinery +* through the synth buffer, so only needs to take the lock while +* tinkering with the buffer. * -* We use spin_lock/trylock_irqsave and spin_unlock_irqrestore with this -* spinlock because speakup needs to disable the keyboard IRQ. +* We use spin_lock/trylock_irqsave and spin_unlock_irqrestore with +* this spinlock because speakup needs to disable the keyboard IRQ. */ .spinlock = __SPIN_LOCK_UNLOCKED(speakup_info.spinlock), .flushing = 0,
Signature · 1 line
1.9.1
Quoted 6 lines · Shirish Gajera
drivers/staging/speakup/main.c +0
-0@@ -422,8 +422,10 @@ static void announce_edge(struct vc_data *vc, int msg_id) {
drivers/staging/speakup/main.c static void announce_edge(struct vc_data *vc, int msg_id) · line 430
Quoted 10 lines
drivers/staging/speakup/main.c +4
-2if (spk_bleeps &1 )bleep (spk_y); -if ((spk_bleeps &2 ) && (msg_id < edge_quiet)) -synth_printf ("%s\n" ,spk_msg_get (MSG_EDGE_MSGS_START + msg_id -1 )); +if ((spk_bleeps &2 ) && (msg_id < edge_quiet)) { +synth_printf ("%s\n" , +spk_msg_get (MSG_EDGE_MSGS_START + msg_id -1 )); + } }
You do not actually need to add the braces as this remains a single statement (mnemonic: without braces the if ends at the first semicolon).
Signature · 1 line
Robin Schroer
Quoted 11 lines · Robin Schroer
Quoted 10 lines · Shirish Gajera
drivers/staging/speakup/main.c +0
-2@@ -422,8 +422,10 @@ static void announce_edge(struct vc_data *vc, int msg_id) {if (spk_bleeps &1 )bleep (spk_y); -if ((spk_bleeps &2 ) && (msg_id < edge_quiet)) -synth_printf ("%s\n" ,spk_msg_get (MSG_EDGE_MSGS_START + msg_id -1 ));
Quoted 9 lines
drivers/staging/speakup/main.c static void announce_edge(struct vc_data *vc, int msg_id) · line 430
Quoted 6 lines
drivers/staging/speakup/main.c +4
-0+if ((spk_bleeps &2 ) && (msg_id < edge_quiet)) { +synth_printf ("%s\n" , +spk_msg_get (MSG_EDGE_MSGS_START + msg_id -1 )); + } }You do not actually need to add the braces as this remains a single statement (mnemonic: without braces the if ends at the first semicolon).
In staging (and most other trees), we prefer that the curly braces be there for multi-line indents. It makes it more readable.
regards,
dan carpenter
Quoted 5 lines · Shirish Gajera
This patch fixes the checkpatch.pl warning:
WARNING: line over 80 characters
All line over 80 characters in driver/staging/speakup/* are fixed
[...]
It is not important to fix all such warnings. The code seems perfectly readable as it is.
Ben.
Signature · 3 lines
Ben Hutchings
The generation of random numbers is too important to be left to chance.
- Robert CoveyouQuoted 10 lines · Ben Hutchings
Quoted 5 lines · Shirish Gajera
This patch fixes the checkpatch.pl warning:
WARNING: line over 80 characters
All line over 80 characters in driver/staging/speakup/* are fixed
[...]
It is not important to fix all such warnings. The code seems perfectly readable as it is.
You can't fight checkpatch (this is why I hate when checkpatch suggests you introduce bugs). In the end, people will keep sending these patches until we merge one and this patch is actually pretty good.
regards,
dan carpenter
A message that is not in the archive (sent off-list or not yet received): CAG77vrrbEmw7OR8N7bcmKEkDwXonsfmJeE6-epYxSMLT5uQpMw@mail.gmail.com
Quoted 2 lines · shirish gajera
I am confuse whether to wait till the patch got accepted or submit new patch set.
Just wait for Greg to get to the patch. We pretty much always apply long line fixes so just assume it's going to merged.
Quoted 2 lines
Also, how to identify whether the corresponding warning is real or not ?
It's all a matter of personal taste. The end code should look better than the original code. I thought your changes looked pretty good...
regards,
dan carpenter
Generally this patch is fine. There were a couple places which weren't perfect.
drivers/staging/speakup/main.c static void announce_edge(struct vc_data *vc, int msg_id) · line 428
Quoted 4 lines · Shirish Gajera
drivers/staging/speakup/main.c +4
-0+if ((spk_bleeps &2 ) && (msg_id < edge_quiet)) { +synth_printf ("%s\n" , +spk_msg_get (MSG_EDGE_MSGS_START + msg_id -1 )); + }
This should be:
if ((spk_bleeps & 2) && (msg_id < edge_quiet)) {
synth_printf("%s\n",
spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
}drivers/staging/speakup/serialio.h struct old_serial_port { · line 38
Quoted 2 lines
drivers/staging/speakup/serialio.h +2
-0+#define spk_serial_tx_busy () \ +((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
This should be:
#define spk_serial_tx_busy() \ ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
Otherwise this patch is nice. I'm fine with merging it as-is if people want.
regards,
dan carpenter
Greg KH
maintainerQuoted 7 lines · Shirish Gajera
This patch fixes the checkpatch.pl warning:
WARNING: line over 80 characters
All line over 80 characters in driver/staging/speakup/* are fixed
Signed-off-by Shirish Gajera <[email protected]>
Quoted 10 lines
--- drivers/staging/speakup/main.c | 12 ++++++++---- drivers/staging/speakup/serialio.h | 3 ++- drivers/staging/speakup/speakup.h | 6 ++++-- drivers/staging/speakup/speakup_decext.c | 6 ++++-- drivers/staging/speakup/speakup_decpc.c | 6 ++++-- drivers/staging/speakup/spk_priv.h | 3 ++- drivers/staging/speakup/spk_types.h | 3 ++- drivers/staging/speakup/synth.c | 10 +++++----- 8 files changed, 31 insertions(+), 18 deletions(-)
This patch fails to apply to my staging-testing branch of my staging.git tree, can you refresh it and resend, hopefully taking Dan's advice and fixing up those two specific issues he pointed out.
thanks,
greg k-h