2017-12-13 08:14:16

by Dhaval Shah

[permalink] [raw]
Subject: [PATCH 0/3] platform/x86: dell-laptop: All the warnings are resolved.

There are total three types of warnings are resolved.
First patch : Block comments use * on subsequent lines
Second patch : Missing a blank line after declarations
third patch : braces {} are not necessary for single statement blocks.

Dhaval Shah (3):
platform/x86: dell-laptop: Block comments use * on subsequent lines
platform/x86: dell-laptop: Missing a blank line after declarations
platform/x86: dell-laptop: braces {} are not necessary for single
statement blocks

drivers/platform/x86/dell-laptop.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

--
2.11.0


2017-12-13 08:14:31

by Dhaval Shah

[permalink] [raw]
Subject: [PATCH 1/3] platform/x86: dell-laptop: Block comments use * on subsequent lines

Resolved Block comments use * on subsequent lines checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah <[email protected]>
---
drivers/platform/x86/dell-laptop.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index cd4725e7e0b5..9b0855236e3d 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -449,7 +449,8 @@ static int dell_rfkill_set(void *data, bool blocked)
hwswitch = buffer->output[1];

/* If the hardware switch controls this radio, and the hardware
- switch is disabled, always disable the radio */
+ * switch is disabled, always disable the radio
+ */
if (ret == 0 && (hwswitch & BIT(hwswitch_bit)) &&
(status & BIT(0)) && !(status & BIT(16)))
disable = 1;
--
2.11.0

2017-12-13 08:14:46

by Dhaval Shah

[permalink] [raw]
Subject: [PATCH 3/3] platform/x86: dell-laptop: braces {} are not necessary for single statement blocks

Resolved braces {} are not necessary for single statement blocks
checkpatch warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah <[email protected]>
---
drivers/platform/x86/dell-laptop.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index bf4e73a02b39..21361bfa2b5c 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -493,9 +493,8 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
ret = dell_send_request(CLASS_INFO, SELECT_RFKILL);
status = buffer->output[1];

- if (ret != 0 || !(status & BIT(0))) {
+ if (ret != 0 || !(status & BIT(0)))
return;
- }

dell_set_arguments(0, 0x2, 0, 0);
ret = dell_send_request(CLASS_INFO, SELECT_RFKILL);
--
2.11.0

2017-12-13 08:15:03

by Dhaval Shah

[permalink] [raw]
Subject: [PATCH 2/3] platform/x86: dell-laptop: Missing a blank line after declarations

Resolved Missing a blank line after declarations checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah <[email protected]>
---
drivers/platform/x86/dell-laptop.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 9b0855236e3d..bf4e73a02b39 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -466,6 +466,7 @@ static void dell_rfkill_update_sw_state(struct rfkill *rfkill, int radio,
if (status & BIT(0)) {
/* Has hw-switch, sync sw_state to BIOS */
int block = rfkill_blocked(rfkill);
+
dell_set_arguments(1 | (radio << 8) | (block << 16), 0, 0, 0);
dell_send_request(CLASS_INFO, SELECT_RFKILL);
} else {
@@ -899,6 +900,7 @@ static void touchpad_led_on(void)
{
int command = 0x97;
char data = 1;
+
i8042_command(&data, command | 1 << 12);
}

@@ -906,6 +908,7 @@ static void touchpad_led_off(void)
{
int command = 0x97;
char data = 2;
+
i8042_command(&data, command | 1 << 12);
}

@@ -2130,6 +2133,7 @@ static int __init dell_init(void)

if (max_intensity) {
struct backlight_properties props;
+
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = max_intensity;
--
2.11.0

2017-12-14 17:59:58

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 0/3] platform/x86: dell-laptop: All the warnings are resolved.

On Wed, Dec 13, 2017 at 10:13 AM, Dhaval Shah
<[email protected]> wrote:
> There are total three types of warnings are resolved.
> First patch : Block comments use * on subsequent lines
> Second patch : Missing a blank line after declarations
> third patch : braces {} are not necessary for single statement blocks.
>

Can we survive without this? Does it break build or alike?


> Dhaval Shah (3):
> platform/x86: dell-laptop: Block comments use * on subsequent lines
> platform/x86: dell-laptop: Missing a blank line after declarations
> platform/x86: dell-laptop: braces {} are not necessary for single
> statement blocks
>
> drivers/platform/x86/dell-laptop.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> --
> 2.11.0
>



--
With Best Regards,
Andy Shevchenko

2017-12-15 05:15:22

by Dhaval Shah

[permalink] [raw]
Subject: Re: [PATCH 0/3] platform/x86: dell-laptop: All the warnings are resolved.

Hi Andy Shevchenko,

Thanks for the review.
________________________________________
> From: Andy Shevchenko <[email protected]>
> Sent: Thursday, December 14, 2017 11:29 PM
> To: Dhaval Shah
> Cc: Matthew Garrett; Pali Roh?r; Andy Shevchenko; Platform Driver; [email protected]
> Subject: Re: [PATCH 0/3] platform/x86: dell-laptop: All the warnings are resolved.
>
> On Wed, Dec 13, 2017 at 10:13 AM, Dhaval Shah
> <[email protected]> wrote:
> > There are total three types of warnings are resolved.
> > First patch : Block comments use * on subsequent lines
> > Second patch : Missing a blank line after declarations
> > third patch : braces {} are not necessary for single statement blocks.
> >
>
> Can we survive without this? Does it break build or alike?
>
Yes. We can survive without this. It will not break build or alike. This changes will not affects the functionality of the code.
But, it overall improves the code readability.
>
> > Dhaval Shah (3):
> > platform/x86: dell-laptop: Block comments use * on subsequent lines
> > platform/x86: dell-laptop: Missing a blank line after declarations
> > platform/x86: dell-laptop: braces {} are not necessary for single
> > statement blocks
> >
> > drivers/platform/x86/dell-laptop.c | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > --
> > 2.11.0
> >



--
With Best Regards,
Andy Shevchenko