staging: greybus: simple formatting cleanup
Subsystems (4)
cover staging: greybus: simple formatting cleanup
Patchset that performs simple code cleanup in greybus driver. Issues found with checkpatch.
Lourdes Pedrajas (2):
staging: greybus: gpio: improve bit fields formatting.
staging: greybus: hid: remove unneded braces
drivers/staging/greybus/gpio.c | 4 ++-- drivers/staging/greybus/hid.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 staging: greybus: gpio: improve bit fields formatting.
Fix the formatting of bit fields on structure gb_gpio_line, in order to not confuse them with unindented labels.
Issue found with checkpatch.
--- drivers/staging/greybus/gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/gpio.c +2 -2
@@ -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 , +u8 active:1 , direction:1 ,/* 0 = output, 1 = input */ - value:1 ;/* 0 = low, 1 = high */ + value:1 ;/* 0 = low, 1 = high */ u16 debounce_usec;u8 irq_type;
Signature · 1 line
2.17.1
PATCH 2/2 staging: greybus: hid: remove unneded braces
In reply to Lourdes PedrajasBraces are not necessary for single statement blocks. Issue found with checkpatch.
--- drivers/staging/greybus/hid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/greybus/hid.c +1 -2
@@ -290,9 +290,8 @@ static int gb_hid_parse(struct hid_device *hid) } rdesc =kzalloc (rsize,GFP_KERNEL ); -if (!rdesc) { +if (!rdesc)return -ENOMEM ; - } ret =gb_hid_get_report_desc (ghid, rdesc);if (ret) {
Signature · 1 line
2.17.1
Re: [Outreachy kernel] [PATCH 1/2] staging: greybus: gpio: improve bit fields formatting.
In reply to Lourdes PedrajasQuoted 2 lines · Lourdes Pedrajas
Fix the formatting of bit fields on structure
gb_gpio_line, in order to not confuse them with unindented labels.
What do you mean by unindented labels?
julia
Quoted 31 lines
Issue found with checkpatch.
Signed-off-by Lourdes Pedrajas <[email protected]>--- drivers/staging/greybus/gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/greybus/gpio.c +2
-3@@ -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 , +u8 active:1 , direction:1 ,/* 0 = output, 1 = input */ - value:1 ;/* 0 = low, 1 = high */ + value:1 ;/* 0 = low, 1 = high */ u16 debounce_usec;u8 irq_type; --2.17.1
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/88c5f940009f75813f026ebad57fc8865b242971.1584131593.git.lu%40pplo.net.
Re: [Outreachy kernel] [PATCH 1/2] staging: greybus: gpio: improve bit fields formatting.
Quoted 11 lines · Julia Lawall
Quoted 2 lines · Lourdes Pedrajas
Fix the formatting of bit fields on structure
gb_gpio_line, in order to not confuse them with unindented labels.What do you mean by unindented labels?
julia
I am sorry for this error! Corrected now thank you Julia! Lourdes
Johan Hovold
maintainerRe: [PATCH v2 1/2] staging: greybus: gpio: improve bit fields formatting.
In reply to Lourdes PedrajasQuoted 3 lines · Lourdes Pedrajas
Fix the formatting of bit fields on structure
gb_gpio_line, in order to not confuse them with indented labels.
Issue found with checkpatch.
This is not an in issue found by checkpatch. Rather, you've found an issue *with* checkpatch, which gets confused by these bit fields.
I'd just leave this as is, since there's nothing wrong with the code.
Quoted 13 lines
Signed-off-by Lourdes Pedrajas <[email protected]>---
v2: log message correctiondrivers/staging/greybus/gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/greybus/gpio.c +0
-0@@ -20,9 +20,9 @@struct gb_gpio_line {
drivers/staging/greybus/gpio.c line 28
Quoted 10 lines
drivers/staging/greybus/gpio.c +2
-2/* The following has to be an array of line_max entries */ /* --> make them just a flags field */ - u8 active: 1, + u8 active: 1, direction: 1, /* 0 = output, 1 = input */ - value: 1; /* 0 = low, 1 = high */ + value: 1; /* 0 = low, 1 = high */u16 debounce_usec;u8 irq_type;
Johan
Re: [PATCH v2 1/2] staging: greybus: gpio: improve bit fields formatting.
Quoted 11 lines · Johan Hovold
Quoted 3 lines · Lourdes Pedrajas
Fix the formatting of bit fields on structure
gb_gpio_line, in order to not confuse them with indented labels.
Issue found with checkpatch.This is not an in issue found by checkpatch. Rather, you've found an issue *with* checkpatch, which gets confused by these bit fields.
I'd just leave this as is, since there's nothing wrong with the code.
Johan
Agreed, thank you!
Lourdes
Greg KH
maintainerRe: [PATCH 2/2] staging: greybus: hid: remove unneded braces
In reply to Lourdes PedrajasQuoted 13 lines · Lourdes Pedrajas
Braces are not necessary for single statement blocks. Issue found with checkpatch.
Signed-off-by Lourdes Pedrajas <[email protected]>--- drivers/staging/greybus/hid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/greybus/hid.c +0
-0
drivers/staging/greybus/hid.c static int gb_hid_parse(struct hid_device *hid) · line 297
Quoted 10 lines
drivers/staging/greybus/hid.c +1
-2@@ -290,9 +290,8 @@ static int gb_hid_parse(struct hid_device *hid) } rdesc =kzalloc (rsize,GFP_KERNEL ); -if (!rdesc) { +if (!rdesc)return -ENOMEM ; - } ret =gb_hid_get_report_desc (ghid, rdesc);if (ret) {
This patch _ADDS_ checkpatch warnings :(
Please always verify that your patch does what you think it does before you send it out...
thanks,
greg k-h
Re: [PATCH 2/2] staging: greybus: hid: remove unneded braces
Quoted 11 lines · Greg KH
On Fri, Mar 13, 2020 at 09:49:37PM +0100, Lourdes Pedrajas wrote:
This patch _ADDS_ checkpatch warnings :(
Please always verify that your patch does what you think it does before you send it out...
thanks,
greg k-h
It won't happen again :(
Thank you,
Lourdes