Skip to contentSkip to conversation

Staging: pi433: Fix line over 80 characters issue

PATCH Superseded Debleena Sen 2 participants 5 messages Mar 3, 2019 Staging

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Staging: pi433: Fix line over 80 characters issue

This patch re-formats the code to remove the checkpatch.pl warning(on line no. 566):
WARNING: line over 80 characters

---
 drivers/staging/pi433/rf69.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/pi433/rf69.c +2 -1
index e19b9ce..0c189a7 100644
@@ -563,7 +563,8 @@ bool rf69_get_flag(struct spi_device *spi, enum flag flag)
 {
 	switch (flag) {
 	case mode_switch_completed:
-		return (rf69_read_reg(spi, REG_IRQFLAGS1) & MASK_IRQFLAGS1_MODE_READY);
+		return (rf69_read_reg(spi, REG_IRQFLAGS1) &
+			MASK_IRQFLAGS1_MODE_READY);
 	case ready_to_receive:
 		return (rf69_read_reg(spi, REG_IRQFLAGS1) & MASK_IRQFLAGS1_RX_READY);
 	case ready_to_send:
Signature · 1 line
2.7.4
#1 lore raw
Quoted 3 lines · Debleena Sen

This patch re-formats the code to remove the checkpatch.pl warning(on line no. 566):
WARNING: line over 80 characters

The log message should be in the imperative. So it should start with Reformat. However, reformat is again quite vague. Something like "Add a newline" would be better.

You don't need to give the line number. That is not an information that is immediately meaningful, ie no one remembers what is on line 156. To find out what is on that line, they will have to look at the change, and at that time they can see the line number as well.

On the other hand, if you ever feel obliged to put something in parentheses, please put a space in front of the (. Otherwise it looks like a function call.

julia

Quoted 30 lines
---
 drivers/staging/pi433/rf69.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/pi433/rf69.c +2 -2
index e19b9ce..0c189a7 100644
@@ -563,7 +563,8 @@ bool rf69_get_flag(struct spi_device *spi, enum flag flag)
 {
 	switch (flag) {
 	case mode_switch_completed:
-		return (rf69_read_reg(spi, REG_IRQFLAGS1) & MASK_IRQFLAGS1_MODE_READY);
+		return (rf69_read_reg(spi, REG_IRQFLAGS1) &
+			MASK_IRQFLAGS1_MODE_READY);
 	case ready_to_receive:
 		return (rf69_read_reg(spi, REG_IRQFLAGS1) & MASK_IRQFLAGS1_RX_READY);
 	case ready_to_send:
--

2.7.4

--
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 [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1551599208-3301-1-git-send-email-idebleenasen%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 52 lines · Julia Lawall
Quoted 3 lines · Debleena Sen

This patch re-formats the code to remove the checkpatch.pl warning(on line no. 566):
WARNING: line over 80 characters

The log message should be in the imperative. So it should start with Reformat. However, reformat is again quite vague. Something like "Add a newline" would be better.

You don't need to give the line number. That is not an information that is immediately meaningful, ie no one remembers what is on line 156. To find out what is on that line, they will have to look at the change, and at that time they can see the line number as well.

On the other hand, if you ever feel obliged to put something in parentheses, please put a space in front of the (. Otherwise it looks like a function call.

julia

drivers/staging/pi433/rf69.c bool rf69_get_flag(struct spi_device *spi, enum flag

Quoted 11 lines
Signed-off-by Debleena Sen <[email protected] <javascript:>>

---

 drivers/staging/pi433/rf69.c | 3 ++- 
 1 file changed, 2 insertions(+), 1 deletion(-) 
drivers/staging/pi433/rf69.c +0 -0
index e19b9ce..0c189a7 100644 
@@ -563,7 +563,8 @@ bool rf69_get_flag(struct spi_device *spi, enum flag 

flag)

drivers/staging/pi433/rf69.c bool rf69_get_flag(struct spi_device *spi, enum flag flag)

Quoted 4 lines
drivers/staging/pi433/rf69.c +0 -1
 { 
         switch (flag) { 
         case mode_switch_completed: 
-                return (rf69_read_reg(spi, REG_IRQFLAGS1) & 

MASK_IRQFLAGS1_MODE_READY);

drivers/staging/pi433/rf69.c bool rf69_get_flag(struct spi_device *spi, enum flag flag)

Quoted 4 lines
drivers/staging/pi433/rf69.c +2 -0
+                return (rf69_read_reg(spi, REG_IRQFLAGS1) & 
+                        MASK_IRQFLAGS1_MODE_READY); 
         case ready_to_receive: 
                 return (rf69_read_reg(spi, REG_IRQFLAGS1) & 

MASK_IRQFLAGS1_RX_READY);

Quoted 6 lines
drivers/staging/pi433/rf69.c +0 -0
         case ready_to_send: 
Signature · 4 lines
2.7.4 

-- 
You received this message because you are subscribed to the Google 
Quoted 11 lines

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/1551599208-3301-1-git-send-email-idebleenasen%40gmail.com.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

"Add a newline to remove the checkpatch.pl warning:" or "Break the line and match the indentation to remove the checkpatch.pl warning:" Can you please advise me which log message should I use?
I've just tweaked the coding style to remove the warning. I've broken the long line and then matched the indentation with '(' of the return statement so that it conforms to the Linux Coding Style.

#3 lore raw
Quoted 70 lines · On Sun, 3 Mar 2019, [email protected] wrote:

On Sunday, March 3, 2019 at 1:26:33 PM UTC+5:30, Julia Lawall wrote:

On Sat, 2 Mar 2019, Debleena Sen wrote:

> This patch re-formats the code to remove the checkpatch.pl warning(on
> line no. 566):
> WARNING: line over 80 characters

The log message should be in the imperative.  So it should start with
Reformat.  However, reformat is again quite vague.  Something like "Add a
newline" would be better.

You don't need to give the line number.  That is not an information that
is immediately meaningful, ie no one remembers what is on line
156.  To
find out what is on that line, they will have to look at the change, and
at that time they can see the line number as well.

On the other hand, if you ever feel obliged to put something in parentheses, please put a space in front of the (.  Otherwise it looks
like a function call.

julia

>
> Signed-off-by: Debleena Sen <[email protected]>
> ---
>  drivers/staging/pi433/rf69.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/pi433/rf69.c
b/drivers/staging/pi433/rf69.c
> index e19b9ce..0c189a7 100644
> --- a/drivers/staging/pi433/rf69.c
> +++ b/drivers/staging/pi433/rf69.c
> @@ -563,7 +563,8 @@ bool rf69_get_flag(struct spi_device *spi,
enum flag flag)
>  {
>          switch (flag) {
>          case mode_switch_completed:
> -                return (rf69_read_reg(spi, REG_IRQFLAGS1) &
MASK_IRQFLAGS1_MODE_READY);
> +                return (rf69_read_reg(spi, REG_IRQFLAGS1) &
> +                        MASK_IRQFLAGS1_MODE_READY);
>          case ready_to_receive:
>                  return (rf69_read_reg(spi, REG_IRQFLAGS1) &
MASK_IRQFLAGS1_RX_READY);
>          case ready_to_send:
> --
> 2.7.4
>
> --
> 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 [email protected].
> To post to this group, send email to
[email protected].
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/1551599208-3301-1-git-se nd-email-idebleenasen%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

Quoted 3 lines

"Add a newline to remove the checkpatch.pl warning:"  or "Break the line and match the indentation to remove the checkpatch.pl warning:"
Can you please advise me which log message should I use?

Either is fine. Your suggestion is probably better.

Quoted 3 lines

I've just tweaked the coding style to remove the warning. I've broken the long line and then matched the indentation with '(' of the return statement so that it conforms to the Linux Coding Style.

It's true that these changes are quite simple, which somehow makes it hard to know exactly what to say about them, because they seem so obvious. But it is useful to get into the right mindset about what information to provide.

julia

Quoted 11 lines

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/8bc1b671-996a-45eb-b78f- 5b322a23d7a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw
Quoted 99 lines · Julia Lawall
Quoted 58 lines · On Sun, 3 Mar 2019, [email protected] <javascript:> wrote:

On Sunday, March 3, 2019 at 1:26:33 PM UTC+5:30, Julia Lawall wrote:

On Sat, 2 Mar 2019, Debleena Sen wrote:

> This patch re-formats the code to remove the checkpatch.pl warning(on
> line no. 566):
> WARNING: line over 80 characters

The log message should be in the imperative. So it should start with
Reformat. However, reformat is again quite vague. Something like "Add a
newline" would be better.

You don't need to give the line number. That is not an information that
is immediately meaningful, ie no one remembers what is on line
156. To
find out what is on that line, they will have to look at the change, and
at that time they can see the line number as well.

On the other hand, if you ever feel obliged to put something in parentheses, please put a space in front of the (. Otherwise it looks
like a function call.

julia

>
> Signed-off-by: Debleena Sen <[email protected]>
> ---
> drivers/staging/pi433/rf69.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> index e19b9ce..0c189a7 100644
> --- a/drivers/staging/pi433/rf69.c
> +++ b/drivers/staging/pi433/rf69.c
> @@ -563,7 +563,8 @@ bool rf69_get_flag(struct spi_device *spi, enum flag flag)
> {
> switch (flag) {
> case mode_switch_completed:
> - return (rf69_read_reg(spi, REG_IRQFLAGS1) &
MASK_IRQFLAGS1_MODE_READY);
> + return (rf69_read_reg(spi, REG_IRQFLAGS1) &
> + MASK_IRQFLAGS1_MODE_READY);
> case ready_to_receive:
> return (rf69_read_reg(spi, REG_IRQFLAGS1) &
MASK_IRQFLAGS1_RX_READY);
> case ready_to_send:
> --
> 2.7.4
>

Quoted 8 lines

> --
> 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 [email protected]. > To post to this group, send email to [email protected].
> To view this discussion on the web visithttps://

groups.google.com/d/msgid/outreachy-kernel/1551599208-3301-1-git-se

Quoted 5 lines

nd-email-idebleenasen%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

"Add a newline to remove the checkpatch.pl warning:" or "Break the

line and

Quoted 2 lines

match the indentation to remove the checkpatch.pl warning:" Can you please advise me which log message should I use?

Either is fine. Your suggestion is probably better.

Quoted 1 line

I've just tweaked the coding style to remove the warning. I've broken

the

Quoted 1 line

long line and then matched the indentation with '(' of the return

statement

Quoted 1 line

so that it conforms to the Linux Coding Style.

It's true that these changes are quite simple, which somehow makes it hard to know exactly what to say about them, because they seem so obvious. But it is useful to get into the right mindset about what information to provide.

julia

Quoted 2 lines
Signature · 1 line
You received this message because you are subscribed to the Google 

Groups

Quoted 12 lines
Quoted 2 lines

"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send

an

Quoted 2 lines

email to [email protected] <javascript:>. To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visithttps://

groups.google.com/d/msgid/outreachy-kernel/8bc1b671-996a-45eb-b78f-

Quoted 4 lines

5b322a23d7a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thank you. I'm editing the log message and sending the patch again.