All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Michał Kępień" <kernel@kempniu.pl>
Cc: "Richard Purdie" <rpurdie@rpsys.net>,
	"Jacek Anaszewski" <jacek.anaszewski@gmail.com>,
	"Pali Rohár" <pali.rohar@gmail.com>,
	"Darren Hart" <dvhart@infradead.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Anthony Wong" <anthony.wong@canonical.com>,
	linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6+/6] platform/x86: dell-wmi-led: fix coding style issues
Date: Tue, 17 Jan 2017 12:08:31 +0100	[thread overview]
Message-ID: <20170117110831.GD26116@xo-6d-61-c0.localdomain> (raw)
In-Reply-To: <20170117071714.21594-1-kernel@kempniu.pl>

On Tue 2017-01-17 08:17:14, Michał Kępień wrote:
> Fix coding style issues in dell-wmi-led which checkpatch complains about
> to make sure the module gets a clean start in the x86 platform driver
> subsystem.
> 
> Signed-off-by: Michał Kępień <kernel@kempniu.pl>

Acked-by: Pavel Machek <pavel@ucw.cz>

> ---
> This is an extra patch that Jacek asked for [1].
> 
> [1] https://lkml.org/lkml/2017/1/16/631
> 
>  drivers/platform/x86/dell-wmi-led.c | 41 +++++++++++++++----------------------
>  1 file changed, 16 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell-wmi-led.c b/drivers/platform/x86/dell-wmi-led.c
> index d0232c7f1909..8753c4fc36b8 100644
> --- a/drivers/platform/x86/dell-wmi-led.c
> +++ b/drivers/platform/x86/dell-wmi-led.c
> @@ -46,21 +46,16 @@ struct bios_args {
>  	unsigned char off_time;
>  };
>  
> -static int dell_led_perform_fn(u8 length,
> -		u8 result_code,
> -		u8 device_id,
> -		u8 command,
> -		u8 on_time,
> -		u8 off_time)
> +static int dell_led_perform_fn(u8 length, u8 result_code, u8 device_id,
> +			       u8 command, u8 on_time, u8 off_time)
>  {
> -	struct bios_args *bios_return;
> -	u8 return_code;
> -	union acpi_object *obj;
>  	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
> +	struct bios_args *bios_return, args;
>  	struct acpi_buffer input;
> +	union acpi_object *obj;
>  	acpi_status status;
> +	u8 return_code;
>  
> -	struct bios_args args;
>  	args.length = length;
>  	args.result_code = result_code;
>  	args.device_id = device_id;
> @@ -71,11 +66,7 @@ static int dell_led_perform_fn(u8 length,
>  	input.length = sizeof(struct bios_args);
>  	input.pointer = &args;
>  
> -	status = wmi_evaluate_method(DELL_LED_BIOS_GUID,
> -		1,
> -		1,
> -		&input,
> -		&output);
> +	status = wmi_evaluate_method(DELL_LED_BIOS_GUID, 1, 1, &input, &output);
>  
>  	if (ACPI_FAILURE(status))
>  		return status;
> @@ -84,7 +75,7 @@ static int dell_led_perform_fn(u8 length,
>  
>  	if (!obj)
>  		return -EINVAL;
> -	else if (obj->type != ACPI_TYPE_BUFFER) {
> +	if (obj->type != ACPI_TYPE_BUFFER) {
>  		kfree(obj);
>  		return -EINVAL;
>  	}
> @@ -117,8 +108,7 @@ static int led_off(void)
>  		0);			/* not used */
>  }
>  
> -static int led_blink(unsigned char on_eighths,
> -		unsigned char off_eighths)
> +static int led_blink(unsigned char on_eighths, unsigned char off_eighths)
>  {
>  	return dell_led_perform_fn(5,	/* Length of command */
>  		INTERFACE_ERROR,	/* Init to  INTERFACE_ERROR */
> @@ -129,7 +119,7 @@ static int led_blink(unsigned char on_eighths,
>  }
>  
>  static void dell_led_set(struct led_classdev *led_cdev,
> -		enum led_brightness value)
> +			 enum led_brightness value)
>  {
>  	if (value == LED_OFF)
>  		led_off();
> @@ -138,24 +128,25 @@ static void dell_led_set(struct led_classdev *led_cdev,
>  }
>  
>  static int dell_led_blink(struct led_classdev *led_cdev,
> -		unsigned long *delay_on,
> -		unsigned long *delay_off)
> +			  unsigned long *delay_on, unsigned long *delay_off)
>  {
>  	unsigned long on_eighths;
>  	unsigned long off_eighths;
>  
> -	/* The Dell LED delay is based on 125ms intervals.
> -	   Need to round up to next interval. */
> +	/*
> +	 * The Dell LED delay is based on 125ms intervals.
> +	 * Need to round up to next interval.
> +	 */
>  
>  	on_eighths = (*delay_on + 124) / 125;
> -	if (0 == on_eighths)
> +	if (on_eighths == 0)
>  		on_eighths = 1;
>  	if (on_eighths > 255)
>  		on_eighths = 255;
>  	*delay_on = on_eighths * 125;
>  
>  	off_eighths = (*delay_off + 124) / 125;
> -	if (0 == off_eighths)
> +	if (off_eighths == 0)
>  		off_eighths = 1;
>  	if (off_eighths > 255)
>  		off_eighths = 255;
> -- 
> 2.11.0

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  parent reply	other threads:[~2017-01-17 11:09 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 13:21 [PATCH v2 0/6] Move dell-led to drivers/platform/x86 Michał Kępień
2017-01-16 13:21 ` [PATCH v2 1/6] dell-led: remove GUID check from dell_micmute_led_set() Michał Kępień
2017-01-16 13:22 ` [PATCH v2 2/6] ALSA: hda - use dell_micmute_led_set() instead of dell_app_wmi_led_set() Michał Kępień
2017-01-16 13:22 ` [PATCH v2 3/6] ALSA: hda - rename dell_led_set_func to dell_micmute_led_set_func Michał Kępień
2017-01-17 11:12   ` Pali Rohár
2017-01-17 21:20   ` Jacek Anaszewski
2017-01-16 13:22 ` [PATCH v2 4/6] platform/x86: dell-laptop: import dell_micmute_led_set() from drivers/leds/dell-led.c Michał Kępień
2017-01-17 11:23   ` Pali Rohár
2017-01-18 19:12   ` Andy Shevchenko
2017-01-16 13:22 ` [PATCH v2 5/6] dell-led: remove code related to mic mute LED Michał Kępień
2017-01-17 11:24   ` Pali Rohár
2017-01-16 13:22 ` [PATCH v2 6/6] dell-led: move driver to drivers/platform/x86/dell-wmi-led.c Michał Kępień
2017-01-16 20:49   ` Jacek Anaszewski
2017-01-17 11:08     ` Pavel Machek
2017-01-17 11:28       ` Pali Rohár
2017-01-18 19:08   ` Andy Shevchenko
2017-01-17  7:17 ` [PATCH v2 6+/6] platform/x86: dell-wmi-led: fix coding style issues Michał Kępień
2017-01-17  8:21   ` Joe Perches
2017-01-17  9:19     ` Michał Kępień
2017-01-17 21:20       ` Jacek Anaszewski
2017-01-17 11:08   ` Pavel Machek [this message]
2017-01-18 19:06   ` Andy Shevchenko
2017-01-17 21:20 ` [PATCH v2 0/6] Move dell-led to drivers/platform/x86 Jacek Anaszewski
2017-02-13 11:26 ` Michał Kępień
2017-02-15 11:56   ` Alex Hung
2017-02-15 11:56     ` Alex Hung
2017-02-15 13:54     ` Michał Kępień
2017-02-15 14:31       ` Alex Hung
2017-02-15 14:31         ` Alex Hung
2017-02-15 15:12         ` Pali Rohár
2017-02-16  9:33           ` Michał Kępień
2017-02-16  9:33             ` Michał Kępień
2017-02-16  9:27         ` Michał Kępień
2017-02-16 10:35           ` Alex Hung
2017-02-16 11:32             ` Michał Kępień
2017-02-16 11:38               ` Alex Hung
2017-02-16 11:41               ` Andy Shevchenko
2017-02-16 12:01                 ` Michał Kępień
2017-02-16 13:11                   ` Andy Shevchenko
2017-02-16 13:11                     ` Andy Shevchenko
2017-02-16 22:11               ` Jacek Anaszewski
2017-02-15 20:28   ` Takashi Iwai
2017-02-15 20:28     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170117110831.GD26116@xo-6d-61-c0.localdomain \
    --to=pavel@ucw.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=anthony.wong@canonical.com \
    --cc=dvhart@infradead.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=kernel@kempniu.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    --cc=perex@perex.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.