Commit 78429e55 authored by Azael Avalos's avatar Azael Avalos Committed by Darren Hart

platform/x86: toshiba_acpi: Clean up variable declaration

This patch moves all the multiple line variable declaration to a
single line declaration (except variables being initialized)
following the reverse tree order, to conform to the practices
of the kernel.

[dvhart: corrected a couple minor inconsistencies in declaration ordering]
Signed-off-by: default avatarAzael Avalos <coproscefalo@gmail.com>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 694d0d0b
...@@ -321,10 +321,9 @@ static int write_acpi_int(const char *methodName, int val) ...@@ -321,10 +321,9 @@ static int write_acpi_int(const char *methodName, int val)
static acpi_status tci_raw(struct toshiba_acpi_dev *dev, static acpi_status tci_raw(struct toshiba_acpi_dev *dev,
const u32 in[TCI_WORDS], u32 out[TCI_WORDS]) const u32 in[TCI_WORDS], u32 out[TCI_WORDS])
{ {
union acpi_object in_objs[TCI_WORDS], out_objs[TCI_WORDS + 1];
struct acpi_object_list params; struct acpi_object_list params;
union acpi_object in_objs[TCI_WORDS];
struct acpi_buffer results; struct acpi_buffer results;
union acpi_object out_objs[TCI_WORDS + 1];
acpi_status status; acpi_status status;
int i; int i;
...@@ -387,9 +386,8 @@ static int sci_open(struct toshiba_acpi_dev *dev) ...@@ -387,9 +386,8 @@ static int sci_open(struct toshiba_acpi_dev *dev)
{ {
u32 in[TCI_WORDS] = { SCI_OPEN, 0, 0, 0, 0, 0 }; u32 in[TCI_WORDS] = { SCI_OPEN, 0, 0, 0, 0, 0 };
u32 out[TCI_WORDS]; u32 out[TCI_WORDS];
acpi_status status; acpi_status status = tci_raw(dev, in, out);
status = tci_raw(dev, in, out);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
pr_err("ACPI call to open SCI failed\n"); pr_err("ACPI call to open SCI failed\n");
return 0; return 0;
...@@ -425,9 +423,8 @@ static void sci_close(struct toshiba_acpi_dev *dev) ...@@ -425,9 +423,8 @@ static void sci_close(struct toshiba_acpi_dev *dev)
{ {
u32 in[TCI_WORDS] = { SCI_CLOSE, 0, 0, 0, 0, 0 }; u32 in[TCI_WORDS] = { SCI_CLOSE, 0, 0, 0, 0, 0 };
u32 out[TCI_WORDS]; u32 out[TCI_WORDS];
acpi_status status; acpi_status status = tci_raw(dev, in, out);
status = tci_raw(dev, in, out);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
pr_err("ACPI call to close SCI failed\n"); pr_err("ACPI call to close SCI failed\n");
return; return;
...@@ -509,7 +506,8 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev) ...@@ -509,7 +506,8 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
{ {
struct toshiba_acpi_dev *dev = container_of(cdev, struct toshiba_acpi_dev *dev = container_of(cdev,
struct toshiba_acpi_dev, led_dev); struct toshiba_acpi_dev, led_dev);
u32 state, result; u32 result;
u32 state;
/* First request : initialize communication. */ /* First request : initialize communication. */
if (!sci_open(dev)) if (!sci_open(dev))
...@@ -672,9 +670,9 @@ static int toshiba_touchpad_get(struct toshiba_acpi_dev *dev, u32 *state) ...@@ -672,9 +670,9 @@ static int toshiba_touchpad_get(struct toshiba_acpi_dev *dev, u32 *state)
/* Eco Mode support */ /* Eco Mode support */
static void toshiba_eco_mode_available(struct toshiba_acpi_dev *dev) static void toshiba_eco_mode_available(struct toshiba_acpi_dev *dev)
{ {
acpi_status status;
u32 in[TCI_WORDS] = { HCI_GET, HCI_ECO_MODE, 0, 0, 0, 0 }; u32 in[TCI_WORDS] = { HCI_GET, HCI_ECO_MODE, 0, 0, 0, 0 };
u32 out[TCI_WORDS]; u32 out[TCI_WORDS];
acpi_status status;
dev->eco_supported = 0; dev->eco_supported = 0;
dev->eco_led_registered = false; dev->eco_led_registered = false;
...@@ -1282,9 +1280,9 @@ static struct proc_dir_entry *toshiba_proc_dir; ...@@ -1282,9 +1280,9 @@ static struct proc_dir_entry *toshiba_proc_dir;
/* LCD Brightness */ /* LCD Brightness */
static int __get_lcd_brightness(struct toshiba_acpi_dev *dev) static int __get_lcd_brightness(struct toshiba_acpi_dev *dev)
{ {
int brightness = 0;
u32 result; u32 result;
u32 value; u32 value;
int brightness = 0;
if (dev->tr_backlight_supported) { if (dev->tr_backlight_supported) {
int ret = get_tr_backlight_status(dev, &value); int ret = get_tr_backlight_status(dev, &value);
...@@ -1377,7 +1375,7 @@ static ssize_t lcd_proc_write(struct file *file, const char __user *buf, ...@@ -1377,7 +1375,7 @@ static ssize_t lcd_proc_write(struct file *file, const char __user *buf,
struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file)); struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file));
char cmd[42]; char cmd[42];
size_t len; size_t len;
int levels = dev->backlight_dev->props.max_brightness + 1; int levels;
int value; int value;
len = min(count, sizeof(cmd) - 1); len = min(count, sizeof(cmd) - 1);
...@@ -1385,6 +1383,7 @@ static ssize_t lcd_proc_write(struct file *file, const char __user *buf, ...@@ -1385,6 +1383,7 @@ static ssize_t lcd_proc_write(struct file *file, const char __user *buf,
return -EFAULT; return -EFAULT;
cmd[len] = '\0'; cmd[len] = '\0';
levels = dev->backlight_dev->props.max_brightness + 1;
if (sscanf(cmd, " brightness : %i", &value) != 1 && if (sscanf(cmd, " brightness : %i", &value) != 1 &&
value < 0 && value > levels) value < 0 && value > levels)
return -EINVAL; return -EINVAL;
...@@ -1447,10 +1446,8 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf, ...@@ -1447,10 +1446,8 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file)); struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file));
char *buffer; char *buffer;
char *cmd; char *cmd;
int lcd_out, crt_out, tv_out;
int remain = count; int remain = count;
int lcd_out = -1;
int crt_out = -1;
int tv_out = -1;
int value; int value;
int ret; int ret;
u32 video_out; u32 video_out;
...@@ -1486,6 +1483,7 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf, ...@@ -1486,6 +1483,7 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
kfree(cmd); kfree(cmd);
lcd_out = crt_out = tv_out = -1;
ret = get_video_status(dev, &video_out); ret = get_video_status(dev, &video_out);
if (!ret) { if (!ret) {
unsigned int new_video_out = video_out; unsigned int new_video_out = video_out;
...@@ -1980,8 +1978,8 @@ static ssize_t usb_sleep_charge_store(struct device *dev, ...@@ -1980,8 +1978,8 @@ static ssize_t usb_sleep_charge_store(struct device *dev,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
u32 mode;
int state; int state;
u32 mode;
int ret; int ret;
ret = kstrtoint(buf, 0, &state); ret = kstrtoint(buf, 0, &state);
...@@ -2021,9 +2019,8 @@ static ssize_t sleep_functions_on_battery_show(struct device *dev, ...@@ -2021,9 +2019,8 @@ static ssize_t sleep_functions_on_battery_show(struct device *dev,
char *buf) char *buf)
{ {
struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
int bat_lvl, status;
u32 state; u32 state;
int bat_lvl;
int status;
int ret; int ret;
int tmp; int tmp;
......
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