All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: speakup: (coding style) Add spaces around operands (checkpatch checks)
@ 2015-11-19 13:40 Christian Colic
  2015-11-19 14:12 ` Luis de Bethencourt
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Colic @ 2015-11-19 13:40 UTC (permalink / raw)
  To: w.d.hubbs, chris, kirk, samuel.thibault, gregkh, luis
  Cc: speakup, devel, linux-kernel

Fix checkpatch check: CHECK: spaces preferred around that '-' (ctx:VxV)
Add spaces around operands to fix these warnings.

Signed-off-by: Christian Colic <colic.christian@gmail.com>
---
 drivers/staging/speakup/keyhelp.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/speakup/keyhelp.c b/drivers/staging/speakup/keyhelp.c
index 02d5c70..d14089a 100644
--- a/drivers/staging/speakup/keyhelp.c
+++ b/drivers/staging/speakup/keyhelp.c
@@ -74,7 +74,7 @@ static void build_key_data(void)
 		for (i = 0; i < nstates; i++, kp++) {
 			if (!*kp)
 				continue;
-			if ((state_tbl[i]&16) != 0 && *kp == SPK_KEY)
+			if ((state_tbl[i] & 16) != 0 && *kp == SPK_KEY)
 				continue;
 			counters[*kp]++;
 		}
@@ -83,7 +83,7 @@ static void build_key_data(void)
 		if (counters[i] == 0)
 			continue;
 		key_offsets[i] = offset;
-		offset += (counters[i]+1);
+		offset += (counters[i] + 1);
 		if (offset >= MAXKEYS)
 			break;
 	}
@@ -97,7 +97,7 @@ static void build_key_data(void)
 			ch1 = *kp++;
 			if (!ch1)
 				continue;
-			if ((state_tbl[i]&16) != 0 && ch1 == SPK_KEY)
+			if ((state_tbl[i] & 16) != 0 && ch1 == SPK_KEY)
 				continue;
 			key = (state_tbl[i] << 8) + ch;
 			counters[ch1]--;
@@ -130,14 +130,14 @@ static int help_init(void)
 	int i;
 	int num_funcs = MSG_FUNCNAMES_END - MSG_FUNCNAMES_START + 1;
 
-	state_tbl = spk_our_keys[0]+SHIFT_TBL_SIZE+2;
+	state_tbl = spk_our_keys[0] + SHIFT_TBL_SIZE + 2;
 	for (i = 0; i < num_funcs; i++) {
 		char *cur_funcname = spk_msg_get(MSG_FUNCNAMES_START + i);
 
 		if (start == *cur_funcname)
 			continue;
 		start = *cur_funcname;
-		letter_offsets[(start&31)-1] = i;
+		letter_offsets[(start & 31) - 1] = i;
 	}
 	return 0;
 }
@@ -160,12 +160,12 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 		ch |= 32; /* lower case */
 		if (ch < 'a' || ch > 'z')
 			return -1;
-		if (letter_offsets[ch-'a'] == -1) {
+		if (letter_offsets[ch - 'a'] == -1) {
 			synth_printf(spk_msg_get(MSG_NO_COMMAND), ch);
 			synth_printf("\n");
 			return 1;
 		}
-		cur_item = letter_offsets[ch-'a'];
+		cur_item = letter_offsets[ch - 'a'];
 	} else if (type == KT_CUR) {
 		if (ch == 0
 		    && (MSG_FUNCNAMES_START + cur_item + 1) <=
@@ -186,7 +186,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 		name = NULL;
 		if ((type != KT_SPKUP) && (key > 0) && (key <= num_key_names)) {
 			synth_printf("%s\n",
-				spk_msg_get(MSG_KEYNAMES_START + key-1));
+				spk_msg_get(MSG_KEYNAMES_START + key - 1));
 			return 1;
 		}
 		for (i = 0; funcvals[i] != 0 && !name; i++) {
@@ -195,7 +195,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 		}
 		if (!name)
 			return -1;
-		kp = spk_our_keys[key]+1;
+		kp = spk_our_keys[key] + 1;
 		for (i = 0; i < nstates; i++) {
 			if (ch == kp[i])
 				break;
-- 
2.5.0


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

* Re: [PATCH] staging: speakup: (coding style) Add spaces around operands (checkpatch checks)
  2015-11-19 13:40 [PATCH] staging: speakup: (coding style) Add spaces around operands (checkpatch checks) Christian Colic
@ 2015-11-19 14:12 ` Luis de Bethencourt
  0 siblings, 0 replies; 2+ messages in thread
From: Luis de Bethencourt @ 2015-11-19 14:12 UTC (permalink / raw)
  To: Christian Colic
  Cc: w.d.hubbs, chris, kirk, samuel.thibault, gregkh, speakup, devel,
	linux-kernel

Hi al,

Looks good and silences the checkpatch warnings.

Christian,
There are more checkpatch warnings in this file. Could you fix them as well?


Reviewed-by: Luis de Bethencourt <luisbg@osg.samsung.com>


On Thu, Nov 19, 2015 at 02:40:59PM +0100, Christian Colic wrote:
> Fix checkpatch check: CHECK: spaces preferred around that '-' (ctx:VxV)
> Add spaces around operands to fix these warnings.
> 
> Signed-off-by: Christian Colic <colic.christian@gmail.com>
> ---
>  drivers/staging/speakup/keyhelp.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/speakup/keyhelp.c b/drivers/staging/speakup/keyhelp.c
> index 02d5c70..d14089a 100644
> --- a/drivers/staging/speakup/keyhelp.c
> +++ b/drivers/staging/speakup/keyhelp.c
> @@ -74,7 +74,7 @@ static void build_key_data(void)
>  		for (i = 0; i < nstates; i++, kp++) {
>  			if (!*kp)
>  				continue;
> -			if ((state_tbl[i]&16) != 0 && *kp == SPK_KEY)
> +			if ((state_tbl[i] & 16) != 0 && *kp == SPK_KEY)
>  				continue;
>  			counters[*kp]++;
>  		}
> @@ -83,7 +83,7 @@ static void build_key_data(void)
>  		if (counters[i] == 0)
>  			continue;
>  		key_offsets[i] = offset;
> -		offset += (counters[i]+1);
> +		offset += (counters[i] + 1);
>  		if (offset >= MAXKEYS)
>  			break;
>  	}
> @@ -97,7 +97,7 @@ static void build_key_data(void)
>  			ch1 = *kp++;
>  			if (!ch1)
>  				continue;
> -			if ((state_tbl[i]&16) != 0 && ch1 == SPK_KEY)
> +			if ((state_tbl[i] & 16) != 0 && ch1 == SPK_KEY)
>  				continue;
>  			key = (state_tbl[i] << 8) + ch;
>  			counters[ch1]--;
> @@ -130,14 +130,14 @@ static int help_init(void)
>  	int i;
>  	int num_funcs = MSG_FUNCNAMES_END - MSG_FUNCNAMES_START + 1;
>  
> -	state_tbl = spk_our_keys[0]+SHIFT_TBL_SIZE+2;
> +	state_tbl = spk_our_keys[0] + SHIFT_TBL_SIZE + 2;
>  	for (i = 0; i < num_funcs; i++) {
>  		char *cur_funcname = spk_msg_get(MSG_FUNCNAMES_START + i);
>  
>  		if (start == *cur_funcname)
>  			continue;
>  		start = *cur_funcname;
> -		letter_offsets[(start&31)-1] = i;
> +		letter_offsets[(start & 31) - 1] = i;
>  	}
>  	return 0;
>  }
> @@ -160,12 +160,12 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
>  		ch |= 32; /* lower case */
>  		if (ch < 'a' || ch > 'z')
>  			return -1;
> -		if (letter_offsets[ch-'a'] == -1) {
> +		if (letter_offsets[ch - 'a'] == -1) {
>  			synth_printf(spk_msg_get(MSG_NO_COMMAND), ch);
>  			synth_printf("\n");
>  			return 1;
>  		}
> -		cur_item = letter_offsets[ch-'a'];
> +		cur_item = letter_offsets[ch - 'a'];
>  	} else if (type == KT_CUR) {
>  		if (ch == 0
>  		    && (MSG_FUNCNAMES_START + cur_item + 1) <=
> @@ -186,7 +186,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
>  		name = NULL;
>  		if ((type != KT_SPKUP) && (key > 0) && (key <= num_key_names)) {
>  			synth_printf("%s\n",
> -				spk_msg_get(MSG_KEYNAMES_START + key-1));
> +				spk_msg_get(MSG_KEYNAMES_START + key - 1));
>  			return 1;
>  		}
>  		for (i = 0; funcvals[i] != 0 && !name; i++) {
> @@ -195,7 +195,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
>  		}
>  		if (!name)
>  			return -1;
> -		kp = spk_our_keys[key]+1;
> +		kp = spk_our_keys[key] + 1;
>  		for (i = 0; i < nstates; i++) {
>  			if (ch == kp[i])
>  				break;
> -- 
> 2.5.0
> 

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

end of thread, other threads:[~2015-11-19 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-19 13:40 [PATCH] staging: speakup: (coding style) Add spaces around operands (checkpatch checks) Christian Colic
2015-11-19 14:12 ` Luis de Bethencourt

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.