Commit 42d17fa7 authored by Jorge Lopez's avatar Jorge Lopez Committed by Hans de Goede

platform/x86: hp-wmi: Correct code style related issues

Update hp-wmi driver to address all code style issues reported
by checkpatch.pl script.

All changes were validated on a HP ZBook Workstation,
HP EliteBook x360, and HP EliteBook 850 G8 notebooks.
Signed-off-by: default avatarJorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20220404203626.4311-2-jorge.lopez2@hp.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 264e8de2
...@@ -605,6 +605,7 @@ static int hp_wmi_rfkill2_refresh(void) ...@@ -605,6 +605,7 @@ static int hp_wmi_rfkill2_refresh(void)
for (i = 0; i < rfkill2_count; i++) { for (i = 0; i < rfkill2_count; i++) {
int num = rfkill2[i].num; int num = rfkill2[i].num;
struct bios_rfkill2_device_state *devstate; struct bios_rfkill2_device_state *devstate;
devstate = &state.device[num]; devstate = &state.device[num];
if (num >= state.count || if (num >= state.count ||
...@@ -625,6 +626,7 @@ static ssize_t display_show(struct device *dev, struct device_attribute *attr, ...@@ -625,6 +626,7 @@ static ssize_t display_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
int value = hp_wmi_read_int(HPWMI_DISPLAY_QUERY); int value = hp_wmi_read_int(HPWMI_DISPLAY_QUERY);
if (value < 0) if (value < 0)
return value; return value;
return sprintf(buf, "%d\n", value); return sprintf(buf, "%d\n", value);
...@@ -634,6 +636,7 @@ static ssize_t hddtemp_show(struct device *dev, struct device_attribute *attr, ...@@ -634,6 +636,7 @@ static ssize_t hddtemp_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
int value = hp_wmi_read_int(HPWMI_HDDTEMP_QUERY); int value = hp_wmi_read_int(HPWMI_HDDTEMP_QUERY);
if (value < 0) if (value < 0)
return value; return value;
return sprintf(buf, "%d\n", value); return sprintf(buf, "%d\n", value);
...@@ -643,6 +646,7 @@ static ssize_t als_show(struct device *dev, struct device_attribute *attr, ...@@ -643,6 +646,7 @@ static ssize_t als_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
int value = hp_wmi_read_int(HPWMI_ALS_QUERY); int value = hp_wmi_read_int(HPWMI_ALS_QUERY);
if (value < 0) if (value < 0)
return value; return value;
return sprintf(buf, "%d\n", value); return sprintf(buf, "%d\n", value);
...@@ -652,6 +656,7 @@ static ssize_t dock_show(struct device *dev, struct device_attribute *attr, ...@@ -652,6 +656,7 @@ static ssize_t dock_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
int value = hp_wmi_get_dock_state(); int value = hp_wmi_get_dock_state();
if (value < 0) if (value < 0)
return value; return value;
return sprintf(buf, "%d\n", value); return sprintf(buf, "%d\n", value);
...@@ -661,6 +666,7 @@ static ssize_t tablet_show(struct device *dev, struct device_attribute *attr, ...@@ -661,6 +666,7 @@ static ssize_t tablet_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
int value = hp_wmi_get_tablet_mode(); int value = hp_wmi_get_tablet_mode();
if (value < 0) if (value < 0)
return value; return value;
return sprintf(buf, "%d\n", value); return sprintf(buf, "%d\n", value);
...@@ -671,6 +677,7 @@ static ssize_t postcode_show(struct device *dev, struct device_attribute *attr, ...@@ -671,6 +677,7 @@ static ssize_t postcode_show(struct device *dev, struct device_attribute *attr,
{ {
/* Get the POST error code of previous boot failure. */ /* Get the POST error code of previous boot failure. */
int value = hp_wmi_read_int(HPWMI_POSTCODEERROR_QUERY); int value = hp_wmi_read_int(HPWMI_POSTCODEERROR_QUERY);
if (value < 0) if (value < 0)
return value; return value;
return sprintf(buf, "0x%x\n", value); return sprintf(buf, "0x%x\n", value);
...@@ -1013,6 +1020,7 @@ static int __init hp_wmi_rfkill2_setup(struct platform_device *device) ...@@ -1013,6 +1020,7 @@ static int __init hp_wmi_rfkill2_setup(struct platform_device *device)
struct rfkill *rfkill; struct rfkill *rfkill;
enum rfkill_type type; enum rfkill_type type;
char *name; char *name;
switch (state.device[i].radio_type) { switch (state.device[i].radio_type) {
case HPWMI_WIFI: case HPWMI_WIFI:
type = RFKILL_TYPE_WLAN; type = RFKILL_TYPE_WLAN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment