Re: [PATCH] staging: greybus: fixed the coding style, labels should not be indented.

From
Alex Elder <hidden>
Date
2021-06-02 14:39:08
Also in
lkml
Reply to
Manikishan Ghantasala, 2021-06-02
On 6/2/21 9:27 AM, Manikishan Ghantasala wrote:
Sending this mail again as I missed to reply to all.
  Hi Alex,

I agree those are called bit-field member names rather than labels.
But the reason I mentioned is because the ./scripts/checkpatch.pl
gave out a warning saying "labels should not be indented".

Sorry for the confusion in the name I referred to. So, I think this
change is needed as I feel this is not following the coding-style by
having indent before the width for bit field member. I went through
other places in source code to make sure this is correct, and sent the
patch after confirmation.
I agree that many instances in the kernel source place the width
of a C bit-field immediately after the colon.  But it is not a
universal convention, and I personally prefer the aligned widths
used by the Greybus code here.

So I don't find this patch acceptable.

					-Alex
Regards,
Manikishan Ghantasala

On Wed, 2 Jun 2021 at 19:13, Alex Elder [off-list ref] wrote:
quoted
On 6/2/21 8:36 AM, sh4nnu wrote:
quoted
From: Manikishan Ghantasala <redacted>

staging: greybus: gpio.c: Clear coding-style problem
"labels should not be indented" by removing indentation.
These are not labels.

I don't really understand what you're doing here.

Can you please explain why you think this needs changing?

                                         -Alex
quoted
Signed-off-by: Manikishan Ghantasala <redacted>
---
   drivers/staging/greybus/gpio.c | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index 7e6347fe93f9..4661f4a251bd 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -20,9 +20,9 @@
   struct gb_gpio_line {
       /* The following has to be an array of line_max entries */
       /* --> make them just a flags field */
-     u8                      active:    1,
-                             direction: 1,   /* 0 = output, 1 = input */
-                             value:     1;   /* 0 = low, 1 = high */
+     u8                      active:1,
+                             direction:1,    /* 0 = output, 1 = input */
+                             value:1;        /* 0 = low, 1 = high */
       u16                     debounce_usec;

       u8                      irq_type;
  
Thread (15 messages) 15 messages, 6 authors, last reply 2021-06-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help