[PATCH v2 2/9] acpi: Add evaluate to name of functions evaluating _DSM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This makes it clearer when reading the function name, as well as following the
names of related ACPI functions.

Changes since v1:
* Fix typo in commit message
* Slightly reformulate the commit message to be clearer

Signed-off-by: Pierre Moreau <pierre.morrow@xxxxxxx>
---
 drm/nouveau/nouveau_acpi.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/drm/nouveau/nouveau_acpi.c b/drm/nouveau/nouveau_acpi.c
index c90037f..e18fbeb 100644
--- a/drm/nouveau/nouveau_acpi.c
+++ b/drm/nouveau/nouveau_acpi.c
@@ -71,7 +71,7 @@ static const char nouveau_op_dsm_muid[] = {
 	0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0,
 };
 
-static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
+static int nouveau_evaluate_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
 {
 	int i;
 	union acpi_object *obj;
@@ -118,7 +118,7 @@ static int nouveau_check_optimus_dsm(acpi_handle handle)
 	 * Function 0 returns a Buffer containing available functions.
 	 * The args parameter is ignored for function 0, so just put 0 in it
 	 */
-	if (nouveau_optimus_dsm(handle, 0, 0, &result))
+	if (nouveau_evaluate_optimus_dsm(handle, 0, 0, &result))
 		return 0;
 
 	/*
@@ -128,7 +128,7 @@ static int nouveau_check_optimus_dsm(acpi_handle handle)
 	return result & 1 && result & (1 << NOUVEAU_DSM_OPTIMUS_CAPS);
 }
 
-static int nouveau_mux_dsm(acpi_handle handle, int func, int arg)
+static int nouveau_evaluate_mux_dsm(acpi_handle handle, int func, int arg)
 {
 	int ret = 0;
 	union acpi_object *obj;
@@ -155,7 +155,7 @@ static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id)
 {
 	mxm_wmi_call_mxmx(mux_id == NOUVEAU_DSM_MUX_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
 	mxm_wmi_call_mxds(mux_id == NOUVEAU_DSM_MUX_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
-	return nouveau_mux_dsm(handle, NOUVEAU_DSM_MUX_LED, mux_id);
+	return nouveau_evaluate_mux_dsm(handle, NOUVEAU_DSM_MUX_LED, mux_id);
 }
 
 static int nouveau_dsm_set_discrete_state(acpi_handle handle, enum vga_switcheroo_state state)
@@ -165,7 +165,7 @@ static int nouveau_dsm_set_discrete_state(acpi_handle handle, enum vga_switchero
 		arg = NOUVEAU_DSM_MUX_POWER_SPEED;
 	else
 		arg = NOUVEAU_DSM_MUX_POWER_STAMINA;
-	nouveau_mux_dsm(handle, NOUVEAU_DSM_MUX_POWER, arg);
+	nouveau_evaluate_mux_dsm(handle, NOUVEAU_DSM_MUX_POWER, arg);
 	return 0;
 }
 
@@ -233,8 +233,8 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
 
 	if (retval & NOUVEAU_DSM_HAS_OPT) {
 		uint32_t result;
-		nouveau_optimus_dsm(dhandle, NOUVEAU_DSM_OPTIMUS_CAPS, 0,
-				    &result);
+		nouveau_evaluate_optimus_dsm(dhandle, NOUVEAU_DSM_OPTIMUS_CAPS,
+				             0, &result);
 		dev_info(&pdev->dev, "optimus capabilities: %s, status %s%s\n",
 			 (result & OPTIMUS_ENABLED) ? "enabled" : "disabled",
 			 (result & OPTIMUS_DYNAMIC_PWR_CAP) ? "dynamic power, " : "",
@@ -324,11 +324,14 @@ void nouveau_switcheroo_optimus_dsm(void)
 	if (!nouveau_dsm_priv.optimus_detected)
 		return;
 
-	nouveau_optimus_dsm(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_OPTIMUS_FLAGS,
-			    0x3, &result);
+	nouveau_evaluate_optimus_dsm(nouveau_dsm_priv.dhandle,
+			             NOUVEAU_DSM_OPTIMUS_FLAGS,
+			             0x3, &result);
 
-	nouveau_optimus_dsm(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_OPTIMUS_CAPS,
-			    NOUVEAU_DSM_OPTIMUS_SET_POWERDOWN, &result);
+	nouveau_evaluate_optimus_dsm(nouveau_dsm_priv.dhandle,
+			             NOUVEAU_DSM_OPTIMUS_CAPS,
+			             NOUVEAU_DSM_OPTIMUS_SET_POWERDOWN,
+			             &result);
 
 }
 
-- 
2.4.2

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux