Received: by 10.223.185.116 with SMTP id b49csp1490072wrg; Sun, 11 Feb 2018 13:22:06 -0800 (PST) X-Google-Smtp-Source: AH8x225XhQ4sOmjIgprOzDag85x0DDLwYsqF05FiXz6onu9l4VhnKzIcoWvKQfEZBslrD0vgby3d X-Received: by 2002:a17:902:b189:: with SMTP id s9-v6mr8818770plr.243.1518384126818; Sun, 11 Feb 2018 13:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518384126; cv=none; d=google.com; s=arc-20160816; b=UaWXDRaHlDqmEjN6nOyCwPGFJ7aPZw+x0jK9MfKEV608lCASO6dvTSnam3XOq6qXhK 6+YaNk1/y70dnsz9DxJPhhR4P80cBbrmL3fEDBjUxxZFgbcsE75x6Ey0+7Hc7gOeGPFa U/ZADMBkRpBjNMOZR4DnAIPtJucVAVd/nCyP/Kg3yHSq3Gx8g8WRCsy6nV98VmsFZzlt m7uNCaKpksSFdaYQzTERUm2qh/ro5rZkxmt6r1TL4bIVC23V/xh7sRrHR2uJ3g0G0dgF d+1uHy33lklOdHoWkvhrY/nXFzL1kR+++3kbMgml7Dfkx2vkX0bVOXv/diLF/2Z75vMd wg4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=OxzVNhuuVz0ZBu7yJgEgJnehmS1hEelfamZslvDWiKk=; b=MY7hrWdG1ktlkYcZEPdFGPd9nWizsI6p6x4n9m+ZCelGHiQcQdmIlL3N2IPEhUeUMJ GJSzx/S+f+ztorKCeiDQiJw3mFAaQPhfO9ItEgHKRkZdMcbwcOiOXo8IH/1rA1ePQLjY N8b/+ClejGB90LDUsDavZ6ao7mU6r/Q+XS147pDQlzApeWINErddO0LGKCjDutC3oEbg a6l3F0vaLesIorCnPDojpnRxsTOS42dRhPZFBa2zq0ayPhMQcl0dUZuSO74H3F/1C9Eq y7Pvku6Gn5oY8GIffyHlcH3yh8m7cKWiUCQ6XVv0R3oKFdzLoeNGwO9qsPitD+UCCLYp up0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=SO4cress; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15-v6si4989616pln.320.2018.02.11.13.21.52; Sun, 11 Feb 2018 13:22:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=SO4cress; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753808AbeBKVVN (ORCPT + 99 others); Sun, 11 Feb 2018 16:21:13 -0500 Received: from casper.infradead.org ([85.118.1.10]:57368 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753719AbeBKVVL (ORCPT ); Sun, 11 Feb 2018 16:21:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OxzVNhuuVz0ZBu7yJgEgJnehmS1hEelfamZslvDWiKk=; b=SO4cressT+BLp7bOnEzW9THLQP gQz6xcXTqf0H8twbBFEVZU5p8KdTrUQN1hYoaZQUwgB+RqQSCQhDv1Z1g1b4/JEctb5GlsXZnbC6J 08GKstHjPExR6TxoDzAPF4hDnV6JGxEedaMFJcSOGLv3NA3DReFT1LpkmDhvd5QcYq0ilAbqywzTf qkEFLnJk2zv4m8lMFLthxwDlOOtGwjs5nc6gPogDDttWluTQAyhggSXGDvWx9lgC/RPwxbDtnZwwV 0E/HHCTyfPf6TyiJpaAf7GO03fdpqarKk7ey5lqP8uTSNOqnpQyaDdXteofAt3FGHeOi9/LFLaetG LQM/ZEdg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.site) by casper.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ekz3J-0003mf-Dc; Sun, 11 Feb 2018 21:20:51 +0000 Subject: Re: [PATCH 7/7] platform/x86: fujitsu-laptop: Clean up constants To: =?UTF-8?B?TWljaGHFgiBLxJlwaWXFhA==?= , Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180211210727.12130-1-kernel@kempniu.pl> <20180211210727.12130-8-kernel@kempniu.pl> From: Randy Dunlap Message-ID: <628c2c03-c855-ed2a-b175-5238c561548e@infradead.org> Date: Sun, 11 Feb 2018 13:20:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180211210727.12130-8-kernel@kempniu.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/11/18 13:07, Michał Kępień wrote: > Align all constant values defined in the module to a common indentation. > Rename ACPI_FUJITSU_NOTIFY_CODE1 to ACPI_FUJITSU_NOTIFY_CODE as there is > only one ACPI notification code used throughout the driver. Define all > bitmasks using the BIT() macro. Clean up comments. > > Signed-off-by: Michał Kępień > --- > drivers/platform/x86/fujitsu-laptop.c | 65 ++++++++++++++++++----------------- > 1 file changed, 33 insertions(+), 32 deletions(-) > > diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c > index 0ee03d1fcbc4..07c713d9d273 100644 > --- a/drivers/platform/x86/fujitsu-laptop.c > +++ b/drivers/platform/x86/fujitsu-laptop.c > @@ -63,9 +63,9 @@ > #include > #include Hi, It looks like this driver needs to #include for use of BIT() macros. See Documentation/process/submit-checklist.rst: 1) If you use a facility then #include the file that defines/declares that facility. Don't depend on other header files pulling in ones that you use. Some $ARCH may work without it while another one may not. > -#define FUJITSU_DRIVER_VERSION "0.6.0" > +#define FUJITSU_DRIVER_VERSION "0.6.0" > > -#define FUJITSU_LCD_N_LEVELS 8 > +#define FUJITSU_LCD_N_LEVELS 8 > > #define ACPI_FUJITSU_CLASS "fujitsu" > #define ACPI_FUJITSU_BL_HID "FUJ02B1" > @@ -75,46 +75,47 @@ > #define ACPI_FUJITSU_LAPTOP_DRIVER_NAME "Fujitsu laptop FUJ02E3 ACPI hotkeys driver" > #define ACPI_FUJITSU_LAPTOP_DEVICE_NAME "Fujitsu FUJ02E3" > > -#define ACPI_FUJITSU_NOTIFY_CODE1 0x80 > +#define ACPI_FUJITSU_NOTIFY_CODE 0x80 > > /* FUNC interface - command values */ > -#define FUNC_FLAGS 0x1000 > -#define FUNC_LEDS 0x1001 > -#define FUNC_BUTTONS 0x1002 > -#define FUNC_BACKLIGHT 0x1004 > +#define FUNC_FLAGS BIT(12) > +#define FUNC_LEDS (BIT(12) | BIT(0)) > +#define FUNC_BUTTONS (BIT(12) | BIT(1)) > +#define FUNC_BACKLIGHT (BIT(12) | BIT(2)) > > /* FUNC interface - responses */ > -#define UNSUPPORTED_CMD 0x80000000 > +#define UNSUPPORTED_CMD BIT(31) > > /* FUNC interface - status flags */ > -#define FLAG_RFKILL 0x020 > -#define FLAG_LID 0x100 > -#define FLAG_DOCK 0x200 > +#define FLAG_RFKILL BIT(5) > +#define FLAG_LID BIT(8) > +#define FLAG_DOCK BIT(9) > > /* FUNC interface - LED control */ > -#define FUNC_LED_OFF 0x1 > -#define FUNC_LED_ON 0x30001 > -#define KEYBOARD_LAMPS 0x100 > -#define LOGOLAMP_POWERON 0x2000 > -#define LOGOLAMP_ALWAYS 0x4000 > -#define RADIO_LED_ON 0x20 > -#define ECO_LED 0x10000 > -#define ECO_LED_ON 0x80000 > +#define FUNC_LED_OFF BIT(0) > +#define FUNC_LED_ON (BIT(0) | BIT(16) | BIT(17)) > +#define LOGOLAMP_POWERON BIT(13) > +#define LOGOLAMP_ALWAYS BIT(14) > +#define KEYBOARD_LAMPS BIT(8) > +#define RADIO_LED_ON BIT(5) > +#define ECO_LED BIT(16) > +#define ECO_LED_ON BIT(19) > > /* FUNC interface - backlight power control */ > -#define BACKLIGHT_POWER 0x4 > -#define BACKLIGHT_OFF 0x3 > -#define BACKLIGHT_ON 0x0 > +#define BACKLIGHT_POWER BIT(2) > +#define BACKLIGHT_OFF (BIT(0) | BIT(1)) > +#define BACKLIGHT_ON 0 > > -/* Hotkey details */ > -#define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */ > -#define KEY2_CODE 0x411 > -#define KEY3_CODE 0x412 > -#define KEY4_CODE 0x413 > -#define KEY5_CODE 0x420 > +/* Scancodes read from the GIRB register */ > +#define KEY1_CODE 0x410 > +#define KEY2_CODE 0x411 > +#define KEY3_CODE 0x412 > +#define KEY4_CODE 0x413 > +#define KEY5_CODE 0x420 > > -#define MAX_HOTKEY_RINGBUFFER_SIZE 100 > -#define RINGBUFFERSIZE 40 > +/* Hotkey ringbuffer limits */ > +#define MAX_HOTKEY_RINGBUFFER_SIZE 100 > +#define RINGBUFFERSIZE 40 > > /* Module parameters */ > static int use_alt_lcd_levels = -1; > @@ -428,7 +429,7 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event) > struct fujitsu_bl *priv = acpi_driver_data(device); > int oldb, newb; > > - if (event != ACPI_FUJITSU_NOTIFY_CODE1) { > + if (event != ACPI_FUJITSU_NOTIFY_CODE) { > acpi_handle_info(device->handle, "unsupported event [0x%x]\n", > event); > sparse_keymap_report_event(priv->input, -1, 1, true); > @@ -902,7 +903,7 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event) > int scancode, i = 0; > unsigned int irb; > > - if (event != ACPI_FUJITSU_NOTIFY_CODE1) { > + if (event != ACPI_FUJITSU_NOTIFY_CODE) { > acpi_handle_info(device->handle, "Unsupported event [0x%x]\n", > event); > sparse_keymap_report_event(priv->input, -1, 1, true); > -- ~Randy