Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1612908 > unrolled thread

[PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl

Started byMichał Kępień <kernel@kempniu.pl>
First post2017-03-30 12:40 +0200
Last post2017-04-04 03:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl Michał Kępień <kernel@kempniu.pl> - 2017-03-30 12:40 +0200
    Re: [PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant  fields from struct fujitsu_bl Darren Hart <dvhart@infradead.org> - 2017-04-04 03:20 +0200

#1612908 — [PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl

FromMichał Kępień <kernel@kempniu.pl>
Date2017-03-30 12:40 +0200
Subject[PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl
Message-ID<tqFEK-4YK-11@gated-at.bofh.it>
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ń <kernel@kempniu.pl>
---
 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;
-- 
2.12.1

[toc] | [next] | [standalone]


#1615645 — Re: [PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl

FromDarren Hart <dvhart@infradead.org>
Date2017-04-04 03:20 +0200
SubjectRe: [PATCH 11/11] platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_bl
Message-ID<tslix-6h9-7@gated-at.bofh.it>
In reply to#1612908
On Thu, Mar 30, 2017 at 12:35:09PM +0200, Michał Kępień wrote:
> 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.

Indeed, once that was removed from the platform device and the corresponding
sysfs entries were eliminated, we can drop it:

78b2602 platform/x86: fujitsu-laptop: remove backlight-related attributes from the platform device

:-)

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web