All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: speakup: Keep logical continuations on the previous line
@ 2017-02-23 18:21 Sreya Mittal
  2017-02-23 20:01 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Sreya Mittal @ 2017-02-23 18:21 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: w.d.hubbs, chris, kirk, samuel.thibault, gregkh

Logical continuations (&&) are on the next line where a line has been broken up because of being longer than 80 characters. It was found by checkpatch. Keep logical continuations on the previous line.

Signed-off-by: Sreya Mittal <sreyamittal5@gmail.com>
---
 drivers/staging/speakup/i18n.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 2f9b3df..c539825 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -411,8 +411,8 @@ static char *next_specifier(char *input)
 		next_percent = strchr(next_percent, '%');
 		if (next_percent != NULL) {
 			/* skip over doubled percent signs */
-			while ((next_percent[0] == '%')
-			       && (next_percent[1] == '%'))
+			while ((next_percent[0] == '%') &&
+				(next_percent[1] == '%'))
 				next_percent += 2;
 			if (*next_percent == '%')
 				found = 1;
@@ -549,9 +549,9 @@ ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length)
 		if (newstr) {
 			memcpy(newstr, text, length);
 			newstr[length] = '\0';
-			if ((index >= MSG_FORMATTED_START
-			&& index <= MSG_FORMATTED_END)
-				&& !fmt_validate(speakup_default_msgs[index],
+			if ((index >= MSG_FORMATTED_START &&
+				index <= MSG_FORMATTED_END) &&
+				!fmt_validate(speakup_default_msgs[index],
 				newstr)) {
 				kfree(newstr);
 				return -EINVAL;
-- 
2.9.3



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

* Re: [Outreachy kernel] [PATCH] staging: speakup: Keep logical continuations on the previous line
  2017-02-23 18:21 [PATCH] staging: speakup: Keep logical continuations on the previous line Sreya Mittal
@ 2017-02-23 20:01 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2017-02-23 20:01 UTC (permalink / raw)
  To: Sreya Mittal
  Cc: outreachy-kernel, w.d.hubbs, chris, kirk, samuel.thibault, gregkh



On Thu, 23 Feb 2017, Sreya Mittal wrote:

> Logical continuations (&&) are on the next line where a line has been broken up because of being longer than 80 characters. It was found by checkpatch. Keep logical continuations on the previous line.

The above line is too long.  Your commit message lines should be at most
70-75 characters.

Also the commit message should be in the imperative. So you could say
something like "Put logical continuations on the next line".

>
> Signed-off-by: Sreya Mittal <sreyamittal5@gmail.com>
> ---
>  drivers/staging/speakup/i18n.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
> index 2f9b3df..c539825 100644
> --- a/drivers/staging/speakup/i18n.c
> +++ b/drivers/staging/speakup/i18n.c
> @@ -411,8 +411,8 @@ static char *next_specifier(char *input)
>  		next_percent = strchr(next_percent, '%');
>  		if (next_percent != NULL) {
>  			/* skip over doubled percent signs */
> -			while ((next_percent[0] == '%')
> -			       && (next_percent[1] == '%'))
> +			while ((next_percent[0] == '%') &&
> +				(next_percent[1] == '%'))

I think that you could remove the unnecessary parentheses at the same
time.  And line up the tests if they are not already lined up.

julia

>  				next_percent += 2;
>  			if (*next_percent == '%')
>  				found = 1;
> @@ -549,9 +549,9 @@ ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length)
>  		if (newstr) {
>  			memcpy(newstr, text, length);
>  			newstr[length] = '\0';
> -			if ((index >= MSG_FORMATTED_START
> -			&& index <= MSG_FORMATTED_END)
> -				&& !fmt_validate(speakup_default_msgs[index],
> +			if ((index >= MSG_FORMATTED_START &&
> +				index <= MSG_FORMATTED_END) &&
> +				!fmt_validate(speakup_default_msgs[index],
>  				newstr)) {
>  				kfree(newstr);
>  				return -EINVAL;
> --
> 2.9.3
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170223182127.g6wkeeyemafeow2k%40stayawesome.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2017-02-23 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23 18:21 [PATCH] staging: speakup: Keep logical continuations on the previous line Sreya Mittal
2017-02-23 20:01 ` [Outreachy kernel] " Julia Lawall

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.