aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaixu Xia <kaixuxia@tencent.com>2020-11-22 13:49:37 +0800
committerHans de Goede <hdegoede@redhat.com>2020-11-24 13:07:01 +0100
commit5af8be6b0c7e49124cd04ad144d3aae615e3daea (patch)
tree7f39210dfafccb829ca19018ad4e156559b646cb
parentplatform/surface: gpe: Add support for 15" Intel version of Surface Laptop 3 (diff)
downloadlinux-dev-5af8be6b0c7e49124cd04ad144d3aae615e3daea.tar.xz
linux-dev-5af8be6b0c7e49124cd04ad144d3aae615e3daea.zip
platform/x86: toshiba_acpi: Fix the wrong variable assignment
The commit 78429e55e4057 ("platform/x86: toshiba_acpi: Clean up variable declaration") cleans up variable declaration in video_proc_write(). Seems it does the variable assignment in the wrong place, this results in dead code and changes the source code logic. Fix it by doing the assignment at the beginning of the funciton. Fixes: 78429e55e4057 ("platform/x86: toshiba_acpi: Clean up variable declaration") Reported-by: Tosk Robot <tencent_os_robot@tencent.com> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> Link: https://lore.kernel.org/r/1606024177-16481-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/platform/x86/toshiba_acpi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index e557d757c647..fa7232ad8c39 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1478,7 +1478,7 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file));
char *buffer;
char *cmd;
- int lcd_out, crt_out, tv_out;
+ int lcd_out = -1, crt_out = -1, tv_out = -1;
int remain = count;
int value;
int ret;
@@ -1510,7 +1510,6 @@ static ssize_t video_proc_write(struct file *file, const char __user *buf,
kfree(cmd);
- lcd_out = crt_out = tv_out = -1;
ret = get_video_status(dev, &video_out);
if (!ret) {
unsigned int new_video_out = video_out;