From patchwork Thu Mar 30 10:35:09 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: 9653693 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 73E4F60113 for ; Thu, 30 Mar 2017 10:36:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 559F91FFB7 for ; Thu, 30 Mar 2017 10:36:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49674209CD; Thu, 30 Mar 2017 10:36:58 +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=unavailable 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 4FD322857B for ; Thu, 30 Mar 2017 10:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933689AbdC3KgE (ORCPT ); Thu, 30 Mar 2017 06:36:04 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33816 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933672AbdC3KfZ (ORCPT ); Thu, 30 Mar 2017 06:35:25 -0400 Received: by mail-lf0-f65.google.com with SMTP id x137so4173454lff.1 for ; Thu, 30 Mar 2017 03:35:24 -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=2RCx5C/UUQzji+U8G7FlTiNT+/bOJ8ek6VCRK7yIvxI=; b=Z2/WFsGePnO7buzWgfNadt52okxj03TA8mbkTcAw1kJZDRXgvz9Vud2FjDGCBKhKXd 6uC8oHRRVMndvGCQVAonugNhWuPnn1WyuEZU92l2qZrYsH5YK3WijXddSd7XsIBIVt/P 0CFoefQiyoadLJznZDDwuqcAI2mDa7UmUESts= 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=2RCx5C/UUQzji+U8G7FlTiNT+/bOJ8ek6VCRK7yIvxI=; b=a3UG8iHIP0GN+0RRnTb/ZetwgGvnb0mK95BOpZQzFPdpmEkFPpJxul+MO9G1eBpxtM 5HsTVROFso/Piwdlx8f9CmLrVJgxwzARgrxeYC6D/usW+qTJ8+xpZGFA2EI2P6jKyTug sNYWmDsj6arZVmbo0XfQr+qwNC4+FiihtkbsX5elzzaB66gmT6mZGEn4SMrpahj8kNOn 75YHxODS75lrY1kmFJMe+N5cgvmWqZlwifVkhH20o3BKVwvqIXzb/8ijD2Kuo29ReTNt 7p6uJHJ+fmksAsSNbnjrrsDnA0QMfCleSG+zc9ppDL5wSsE6KdnGMcqOG3NgXXgxalbL jQGA== X-Gm-Message-State: AFeK/H0AHkslv3ZE3cDTCGyr6m387Yy+6y8oQa1JsFrbEu5kI6+/6bhJE6fA/pR/xUOu4Q== X-Received: by 10.25.17.100 with SMTP id g97mr1473842lfi.10.1490870123323; Thu, 30 Mar 2017 03:35:23 -0700 (PDT) Received: from ozzy.nask.waw.pl ([2001:a10:160:3::3]) by smtp.googlemail.com with ESMTPSA id x1sm296975lfb.54.2017.03.30.03.35.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 03:35: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 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl Date: Thu, 30 Mar 2017 12:35:09 +0200 Message-Id: <20170330103509.32509-12-kernel@kempniu.pl> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170330103509.32509-1-kernel@kempniu.pl> References: <20170330103509.32509-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 99befc1bc4f6..976baceea018 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; }; @@ -408,11 +405,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; } @@ -591,8 +583,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 @@ -632,9 +622,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;