diff options
author | zhong jiang <zhongjiang@huawei.com> | 2018-09-13 03:41:10 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-09-24 05:30:52 -0400 |
commit | 5fe2ccbef9d7aecf5c4402c753444f1a12096cfd (patch) | |
tree | 7106dd603efbee982ab15ca1876ebb32041bf741 | |
parent | 3fe1d6bbcd16f384d2c7dab2caf8e4b2df9ea7e6 (diff) |
HID: logitech: fix a used uninitialized GCC warning
Fix the following compile warning:
drivers/hid/hid-logitech-hidpp.c: In function 'hi_res_scroll_enable':
drivers/hid/hid-logitech-hidpp.c:2714:54: warning: 'multiplier' may be used uninitialized in this function [-Wmaybe-uninitialized]
hidpp->vertical_wheel_counter.resolution_multiplier = multiplier;
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/hid-logitech-hidpp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 5f0c080059c6..f01280898b24 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c | |||
@@ -1231,7 +1231,6 @@ static int hidpp_hrw_get_wheel_capability(struct hidpp_device *hidpp, | |||
1231 | *multiplier = response.fap.params[0]; | 1231 | *multiplier = response.fap.params[0]; |
1232 | return 0; | 1232 | return 0; |
1233 | return_default: | 1233 | return_default: |
1234 | *multiplier = 8; | ||
1235 | hid_warn(hidpp->hid_dev, | 1234 | hid_warn(hidpp->hid_dev, |
1236 | "Couldn't get wheel multiplier (error %d), assuming %d.\n", | 1235 | "Couldn't get wheel multiplier (error %d), assuming %d.\n", |
1237 | ret, *multiplier); | 1236 | ret, *multiplier); |
@@ -2696,7 +2695,7 @@ static int hi_res_scroll_look_up_microns(__u32 product_id) | |||
2696 | static int hi_res_scroll_enable(struct hidpp_device *hidpp) | 2695 | static int hi_res_scroll_enable(struct hidpp_device *hidpp) |
2697 | { | 2696 | { |
2698 | int ret; | 2697 | int ret; |
2699 | u8 multiplier; | 2698 | u8 multiplier = 8; |
2700 | 2699 | ||
2701 | if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2121) { | 2700 | if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2121) { |
2702 | ret = hidpp_hrw_set_wheel_mode(hidpp, false, true, false); | 2701 | ret = hidpp_hrw_set_wheel_mode(hidpp, false, true, false); |
@@ -2704,10 +2703,9 @@ static int hi_res_scroll_enable(struct hidpp_device *hidpp) | |||
2704 | } else if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2120) { | 2703 | } else if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2120) { |
2705 | ret = hidpp_hrs_set_highres_scrolling_mode(hidpp, true, | 2704 | ret = hidpp_hrs_set_highres_scrolling_mode(hidpp, true, |
2706 | &multiplier); | 2705 | &multiplier); |
2707 | } else /* if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_1P0) */ { | 2706 | } else /* if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_1P0) */ |
2708 | ret = hidpp10_enable_scrolling_acceleration(hidpp); | 2707 | ret = hidpp10_enable_scrolling_acceleration(hidpp); |
2709 | multiplier = 8; | 2708 | |
2710 | } | ||
2711 | if (ret) | 2709 | if (ret) |
2712 | return ret; | 2710 | return ret; |
2713 | 2711 | ||