From patchwork Wed Apr 5 06:49:10 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: 9663035 X-Patchwork-Delegate: dvhart@infradead.org 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 B06D460365 for ; Wed, 5 Apr 2017 06:49:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A151D284FE for ; Wed, 5 Apr 2017 06:49:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9635E28505; Wed, 5 Apr 2017 06:49:36 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CD6F28507 for ; Wed, 5 Apr 2017 06:49:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754430AbdDEGtZ (ORCPT ); Wed, 5 Apr 2017 02:49:25 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34964 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754406AbdDEGtY (ORCPT ); Wed, 5 Apr 2017 02:49:24 -0400 Received: by mail-lf0-f65.google.com with SMTP id v2so355554lfi.2 for ; Tue, 04 Apr 2017 23:49:23 -0700 (PDT) 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=zXdexj7Cu17WGc+EB8AxxOwGtbyUNgRoB2/vsyG+sy8=; b=fCQRWBF2Rkcewyn+XWZP7I+UhFjLmBZtWpXxi/0UxLn2NKAuZAl8/j4NmgPCIAEOpN /mSshKIzMPgxuAat1nO9FKVJzzkpMf3gy+kNdK4xfFu3aKFakVvDMBVIsgram2qG7eDZ I6JdG1HTbSvmlSwh062cyi7QdIefVIfhmN6WI= 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=zXdexj7Cu17WGc+EB8AxxOwGtbyUNgRoB2/vsyG+sy8=; b=g3Xb2/urV9dsxmAbfgUSYOF64OB12SjJBJD9C6zX2iY/YXMMIx3Az0f/Za/f+0LVu6 vVH4cmcx/A7yu3jyWZ6CAlCCLOQ31xdDHQ1Fa6DhSfKoFn62w2MnXBId4U9/gW+oFloN 0bZOqYjHE/DG7tnnJ375Mv3ayv1B/uierahnbWQkhZxuzQfVcvGNZENEtLivyzWMqRqV PFsts8Kn4O8wLkBQ9mnjIt8LyxkMqstmL/JdR/qb2bQrLZo1YSKYipWi41+7OOKY2HQt c5MHbUdofVtfWMEGFJcxOBsV/oF8lwbk5f5apSn4ucJNsLZfzu9eRsVjbsCsiqADGImt MnKQ== X-Gm-Message-State: AFeK/H2oqZn7ZEJaPHc0dLX5bY7apqCuPQOqm0UlGO4IXGyJoovs+7bq71jKrP04G2R+tg== X-Received: by 10.25.32.9 with SMTP id g9mr8609575lfg.7.1491374962760; Tue, 04 Apr 2017 23:49:22 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id o91sm3619921lfg.1.2017.04.04.23.49.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 23:49:22 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl Date: Wed, 5 Apr 2017 08:49:10 +0200 Message-Id: <20170405064910.3162-12-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170405064910.3162-1-kernel@kempniu.pl> References: <20170405064910.3162-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dev field of struct fujitsu_bl is assigned in acpi_fujitsu_bl_add(), but never used afterwards. brightness_changed is set in get_lcd_level() and then its value is only printed in a debug message, so it does not influence execution flow. Remove both fields as they are redundant. Update the aforementioned debug message. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index f58a33d70be3..9fd5b98aeef8 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -135,13 +135,10 @@ /* Device controlling the backlight and associated keys */ struct fujitsu_bl { acpi_handle acpi_handle; - struct acpi_device *dev; struct input_dev *input; char phys[32]; struct backlight_device *bl_device; - unsigned int max_brightness; - unsigned int brightness_changed; unsigned int brightness_level; }; @@ -409,11 +406,6 @@ static int get_lcd_level(void) fujitsu_bl->brightness_level = state & 0x0fffffff; - if (state & 0x80000000) - fujitsu_bl->brightness_changed = 1; - else - fujitsu_bl->brightness_changed = 0; - return fujitsu_bl->brightness_level; } @@ -592,8 +584,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) acpi_device_name(device), acpi_device_bid(device), !device->power.state ? "on" : "off"); - fujitsu_bl->dev = device; - if (acpi_has_method(device->handle, METHOD_NAME__INI)) { vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); if (ACPI_FAILURE @@ -633,9 +623,8 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event) get_lcd_level(); newb = fujitsu_bl->brightness_level; - vdbg_printk(FUJLAPTOP_DBG_TRACE, - "brightness button event [%i -> %i (%i)]\n", - oldb, newb, fujitsu_bl->brightness_changed); + vdbg_printk(FUJLAPTOP_DBG_TRACE, "brightness button event [%i -> %i]\n", + oldb, newb); if (oldb == newb) return;