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


Groups > linux.kernel > #1616639

[PATCH v2 3/3] platform/x86: fujitsu-laptop: rename call_fext_func() arguments

From Michał Kępień <kernel@kempniu.pl>
Newsgroups linux.kernel
Subject [PATCH v2 3/3] platform/x86: fujitsu-laptop: rename call_fext_func() arguments
Date 2017-04-05 09:00 +0200
Message-ID <tsN58-7C6-27@gated-at.bofh.it> (permalink)
References <tsN57-7C6-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Rename call_fext_func() arguments so that each argument's name signifies
its role:

  - cmd -> func: sub-function to call (flags, buttons etc.),
  - arg0 -> op: operation to perform (get, set, get capabilities etc.),
  - arg1 -> feature: feature to act on (e.g. which LED), if relevant,
  - arg2 -> state: state to set (e.g. LED on or off), if relevant.

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, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 8c41968d9e7f..928778ccc4c1 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -217,13 +217,13 @@ static u32 dbg_level = 0x03;
 
 /* Fujitsu ACPI interface function */
 
-static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
+static int call_fext_func(int func, int op, int feature, int state)
 {
 	union acpi_object params[4] = {
-		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = cmd },
-		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = arg0 },
-		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = arg1 },
-		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = arg2 }
+		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = func },
+		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = op },
+		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = feature },
+		{ .integer.type = ACPI_TYPE_INTEGER, .integer.value = state }
 	};
 	struct acpi_object_list arg_list = { 4, params };
 	unsigned long long value;
@@ -236,9 +236,8 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
 		return -ENODEV;
 	}
 
-	vdbg_printk(FUJLAPTOP_DBG_TRACE,
-		"FUNC 0x%x (args 0x%x, 0x%x, 0x%x) returned 0x%x\n",
-			cmd, arg0, arg1, arg2, (int)value);
+	vdbg_printk(FUJLAPTOP_DBG_TRACE, "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) returned 0x%x\n",
+		    func, op, feature, state, (int)value);
 	return value;
 }
 
-- 
2.12.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] fujitsu-laptop: call_fext_func() cleanup Michał Kępień <kernel@kempniu.pl> - 2017-04-05 09:00 +0200
  [PATCH v2 2/3] platform/x86: fujitsu-laptop: simplify call_fext_func() Michał Kępień <kernel@kempniu.pl> - 2017-04-05 09:00 +0200
  [PATCH v2 3/3] platform/x86: fujitsu-laptop: rename call_fext_func() arguments Michał Kępień <kernel@kempniu.pl> - 2017-04-05 09:00 +0200
  Re: [PATCH v2 0/3] fujitsu-laptop: call_fext_func() cleanup Darren Hart <dvhart@infradead.org> - 2017-04-05 17:40 +0200
    Re: [PATCH v2 0/3] fujitsu-laptop: call_fext_func() cleanup Michał Kępień <kernel@kempniu.pl> - 2017-04-05 21:50 +0200

csiph-web