From patchwork Tue Jan 17 07:17:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 9520057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C2D46020A for ; Tue, 17 Jan 2017 07:20:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68799284F1 for ; Tue, 17 Jan 2017 07:20:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58DD4284F8; Tue, 17 Jan 2017 07:20:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61660284F1 for ; Tue, 17 Jan 2017 07:20:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0DAEF267555; Tue, 17 Jan 2017 08:20:13 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B900C26689C; Tue, 17 Jan 2017 08:17:53 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id F0BCE26753B; Tue, 17 Jan 2017 08:17:44 +0100 (CET) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by alsa0.perex.cz (Postfix) with ESMTP id 43AE726689C for ; Tue, 17 Jan 2017 08:17:40 +0100 (CET) Received: by mail-lf0-f66.google.com with SMTP id h65so14926381lfi.3 for ; Mon, 16 Jan 2017 23:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RLK8WYnsOelYnAAfghcgow59DRo9b97AH8CF1/EY1u0=; b=ZBYIpjoq8GcS0OUfHZecaKpYSgOsthYUPhlnsPi9zMFKsKouoat4+wQWNt1Kokp1YX DqyS1uHonN8w+MlASPS+NvQrZOFRA3xNj/aHPxpSMLxs1Ppfj5kDvmdGFaHNPcqRuA81 4p7KNx2E8yFrNFvytwEwxM9ooSEUT3aQS0ANY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RLK8WYnsOelYnAAfghcgow59DRo9b97AH8CF1/EY1u0=; b=K1dccskSJzjspIdAX2qTpBg9VtTQHbCRU201Gl6rGF6UZSvV0YmynI+b0g3JPQzs0I C3dJobDuAHUU7CHDgt4Wbx/IxdrVnIuqbOo3Ly2sDLQmYAQpa+vNUWj9HqusN3xOsf7B NJjVUqdY1Wnkj/LcukM5Ykd9Wg5UZCrrjbRIY7qAnbbR6/0PjbDyqGU0Tw7zN7LL/YI+ pBIKdo1eg8RGBBmWSeH9uQp2GslTiPrMCxEp9XCiHBgDKtee+S5MQTcQGJ8H3aGzXwAP n5zf1Fvaol5srVWaQjVqUyo90N6Kd990VYiFrkJ9NAeioOUZfDWyZMo7MNggGbKPERyj I7Gw== X-Gm-Message-State: AIkVDXL6x8ZSl5RRzPti18ziOb3OWlTRQRs292ZcuPI8PCFooFUewkeqboBxNxiEDT9rgg== X-Received: by 10.46.6.17 with SMTP id 17mr15300247ljg.14.1484637460129; Mon, 16 Jan 2017 23:17:40 -0800 (PST) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id m18sm1953016lfe.45.2017.01.16.23.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 23:17:39 -0800 (PST) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Richard Purdie , Jacek Anaszewski , Pavel Machek , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Darren Hart , Jaroslav Kysela , Takashi Iwai Date: Tue, 17 Jan 2017 08:17:14 +0100 Message-Id: <20170117071714.21594-1-kernel@kempniu.pl> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170116132204.6421-1-kernel@kempniu.pl> References: <20170116132204.6421-1-kernel@kempniu.pl> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Anthony Wong , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-leds@vger.kernel.org Subject: [alsa-devel] [PATCH v2 6+/6] platform/x86: dell-wmi-led: fix coding style issues X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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ń Acked-by: Pavel Machek --- 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;