diff mbox series

[20/25] HID: hid-sensor-custom: Remove unused variable 'ret'

Message ID 20210326143458.508959-22-lee.jones@linaro.org
State Accepted
Commit dbf104fdd42e49310851fa258ce0493e69dd2221
Headers show
Series Rid W=1 warnings from HID | expand

Commit Message

Lee Jones March 26, 2021, 2:34 p.m. UTC
Fixes the following W=1 kernel build warning(s):

 drivers/hid/hid-sensor-custom.c: In function ‘store_value’:
 drivers/hid/hid-sensor-custom.c:400:7: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Cc: Jiri Kosina <jikos@kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Cc: linux-iio@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 drivers/hid/hid-sensor-custom.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.27.0

Comments

Jonathan Cameron March 29, 2021, 11:26 a.m. UTC | #1
On Fri, 26 Mar 2021 14:34:53 +0000
Lee Jones <lee.jones@linaro.org> wrote:

> Fixes the following W=1 kernel build warning(s):

> 

>  drivers/hid/hid-sensor-custom.c: In function ‘store_value’:

>  drivers/hid/hid-sensor-custom.c:400:7: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

> 

> Cc: Jiri Kosina <jikos@kernel.org>

> Cc: Jonathan Cameron <jic23@kernel.org>

> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>

> Cc: linux-input@vger.kernel.org

> Cc: linux-iio@vger.kernel.org

> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.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 2628bc53ed809..2e6662173a79c 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;

>
diff mbox series

Patch

diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
index 2628bc53ed809..2e6662173a79c 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;