forked from Minki/linux
i8k: Fix various checkpatch warnings and errors
Fix: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> WARNING: Use #include <linux/io.h> instead of <asm/io.h> WARNING: __packed is preferred over __attribute__((packed)) WARNING: externs should be avoided in .c files ERROR: spaces required around that ':' (ctx:ExV) ERROR: do not use assignment in if condition WARNING: line over 80 characters WARNING: __initdata should be placed after i8k_dmi_table[] ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
60e71aafdb
commit
12186f51b6
@ -31,8 +31,8 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/hwmon.h>
|
||||
#include <linux/hwmon-sysfs.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <linux/i8k.h>
|
||||
|
||||
@ -105,11 +105,11 @@ static const struct file_operations i8k_fops = {
|
||||
|
||||
struct smm_regs {
|
||||
unsigned int eax;
|
||||
unsigned int ebx __attribute__ ((packed));
|
||||
unsigned int ecx __attribute__ ((packed));
|
||||
unsigned int edx __attribute__ ((packed));
|
||||
unsigned int esi __attribute__ ((packed));
|
||||
unsigned int edi __attribute__ ((packed));
|
||||
unsigned int ebx __packed;
|
||||
unsigned int ecx __packed;
|
||||
unsigned int edx __packed;
|
||||
unsigned int esi __packed;
|
||||
unsigned int edi __packed;
|
||||
};
|
||||
|
||||
static inline const char *i8k_get_dmi_data(int field)
|
||||
@ -205,7 +205,8 @@ static int i8k_get_fn_status(void)
|
||||
struct smm_regs regs = { .eax = I8K_SMM_FN_STATUS, };
|
||||
int rc;
|
||||
|
||||
if ((rc = i8k_smm(®s)) < 0)
|
||||
rc = i8k_smm(®s);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
switch ((regs.eax >> I8K_FN_SHIFT) & I8K_FN_MASK) {
|
||||
@ -228,7 +229,8 @@ static int i8k_get_power_status(void)
|
||||
struct smm_regs regs = { .eax = I8K_SMM_POWER_STATUS, };
|
||||
int rc;
|
||||
|
||||
if ((rc = i8k_smm(®s)) < 0)
|
||||
rc = i8k_smm(®s);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
return (regs.eax & 0xff) == I8K_POWER_AC ? I8K_AC : I8K_BATTERY;
|
||||
@ -282,7 +284,8 @@ static int i8k_get_temp(int sensor)
|
||||
static int prev;
|
||||
#endif
|
||||
regs.ebx = sensor & 0xff;
|
||||
if ((rc = i8k_smm(®s)) < 0)
|
||||
rc = i8k_smm(®s);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
temp = regs.eax & 0xff;
|
||||
@ -311,7 +314,8 @@ static int i8k_get_dell_signature(int req_fn)
|
||||
struct smm_regs regs = { .eax = req_fn, };
|
||||
int rc;
|
||||
|
||||
if ((rc = i8k_smm(®s)) < 0)
|
||||
rc = i8k_smm(®s);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1;
|
||||
@ -335,7 +339,8 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
|
||||
|
||||
case I8K_MACHINE_ID:
|
||||
memset(buff, 0, 16);
|
||||
strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL), sizeof(buff));
|
||||
strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
|
||||
sizeof(buff));
|
||||
break;
|
||||
|
||||
case I8K_FN_STATUS:
|
||||
@ -609,7 +614,7 @@ static void __exit i8k_exit_hwmon(void)
|
||||
hwmon_device_unregister(i8k_hwmon_dev);
|
||||
}
|
||||
|
||||
static struct dmi_system_id __initdata i8k_dmi_table[] = {
|
||||
static struct dmi_system_id i8k_dmi_table[] __initdata = {
|
||||
{
|
||||
.ident = "Dell Inspiron",
|
||||
.matches = {
|
||||
@ -698,7 +703,8 @@ static int __init i8k_probe(void)
|
||||
i8k_get_dmi_data(DMI_BIOS_VERSION));
|
||||
}
|
||||
|
||||
strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION), sizeof(bios_version));
|
||||
strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION),
|
||||
sizeof(bios_version));
|
||||
|
||||
/*
|
||||
* Get SMM Dell signature
|
||||
|
Loading…
Reference in New Issue
Block a user