lkml.org 
[lkml]   [2021]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] HID: hid-sensor-custom: remove useless variable
From
Date
On Fri, 2021-04-09 at 15:15 +0800, Jiapeng Chong wrote:
> Fix the following gcc warning:
>
> drivers/hid/hid-sensor-custom.c:400:7: warning: variable ‘ret’ set
> but
> not used [-Wunused-but-set-variable].
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com

> ---
> drivers/hid/hid-sensor-custom.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-
> sensor-custom.c
> index 2628bc5..e430673 100644
> --- a/drivers/hid/hid-sensor-custom.c
> +++ b/drivers/hid/hid-sensor-custom.c
> @@ -397,15 +397,14 @@ static ssize_t store_value(struct device *dev,
> struct device_attribute *attr,
>
> if (!strncmp(name, "value", strlen("value"))) {
> u32 report_id;
> - int ret;
>
> if (kstrtoint(buf, 0, &value) != 0)
> return -EINVAL;
>
> report_id = sensor_inst->fields[field_index].attribute.
> report_
> id;
> - ret = sensor_hub_set_feature(sensor_inst->hsdev,
> report_id,
> - index, sizeof(value),
> &value);
> + sensor_hub_set_feature(sensor_inst->hsdev, report_id,
> index,
> + sizeof(value), &value);
> } else
> return -EINVAL;
>

\
 
 \ /
  Last update: 2021-04-09 20:20    [W:0.051 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site