Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp81567imm; Thu, 20 Sep 2018 18:49:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ7BHHos4eRhFi05F/b1SMxXH1TC0RhtSbzDBV/aEWblQvYrY1xV5qFe6VVrAUoJHGDjpsU X-Received: by 2002:a17:902:d898:: with SMTP id b24-v6mr41466526plz.218.1537494541838; Thu, 20 Sep 2018 18:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537494541; cv=none; d=google.com; s=arc-20160816; b=Cd9uOfHSLPa3NlC/REXCEQO0Ya6T0ntpXCf57q1XpccFEHxsvDIQRumHAf+9KkF3S/ WFXgbIwEjGBWR3sVCkuPcwcA/tKrghrLd7lhW7OWZrApLL9Lt2IwxWkeV9ogr/JAiI6t AK7+j+HZczHqdIPo0YcUUVWPWm2hSMt1J6f14d4aoIiMPOq3AygrGcjw81Q8FECMVKpY liDRzlzBhUMWJ4CHcmvoO7h7bpHJZUkqDdjZqlSusBmF5pakTIw5y31D8pjfEKyzOdmK 81rhucsuBmi8qzL986slTx6W5jCTqoKMUq0YfW1HQWT1i58b84Ygsxs3vxQHHjzRN4eG AszA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=pNxkPdMsoBhOwTxG/yel1+t18vRzXhIIA4nZUwbNf0g=; b=ps1lAUMKwuU07kvRZ6Lt+0KkpvvRB/EOhb97DG2C31K6hnKFYQVt2WKZEm1GDj4SYy PYUg03EQ3v1rfrKpc/YtgQdUTgzUahAT5Swn1dqijpfM/Z5zypYa4irCEIsDfoDKDIVa bU1Vgrqw0wBmTyE3ruLtQT5GudNJPFiGXHlfiD0+5Z/ZnHAxXukCV/EbRk7F2ZPU4lgW yHehWwySybHTU9esGMU412143pl8zf2aNM1Nvu37w5FcFANKSVb3t9PqxJGjgKlN6Ai6 tjfsi29YWV8bhFntPrr9AO/PviogEF+9o1D/W3PT//V3VEGytv7vMERZQUrDJIDAeMM+ cKPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22-v6si4522734plj.139.2018.09.20.18.48.46; Thu, 20 Sep 2018 18:49:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388928AbeIUHdW (ORCPT + 99 others); Fri, 21 Sep 2018 03:33:22 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13086 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725892AbeIUHdV (ORCPT ); Fri, 21 Sep 2018 03:33:21 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D52848E35BE2; Fri, 21 Sep 2018 09:46:53 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.399.0; Fri, 21 Sep 2018 09:46:54 +0800 Message-ID: <5BA44D8E.3070708@huawei.com> Date: Fri, 21 Sep 2018 09:46:54 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: , CC: , Subject: Re: [PATCH v2] HID: logitech: fix a used uninitialized GCC warning References: <1536824470-36659-1-git-send-email-zhongjiang@huawei.com> In-Reply-To: <1536824470-36659-1-git-send-email-zhongjiang@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri Can you pick up the patch? Thanks zhong jiang On 2018/9/13 15:41, zhong jiang wrote: > 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 > --- > v1->v2: > According to Benjamin's suggestion, To initialize the value > and remove the duplicated assignement. > > drivers/hid/hid-logitech-hidpp.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c > index 5f0c080..f012808 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, > *multiplier = response.fap.params[0]; > return 0; > return_default: > - *multiplier = 8; > hid_warn(hidpp->hid_dev, > "Couldn't get wheel multiplier (error %d), assuming %d.\n", > ret, *multiplier); > @@ -2696,7 +2695,7 @@ static int hi_res_scroll_look_up_microns(__u32 product_id) > static int hi_res_scroll_enable(struct hidpp_device *hidpp) > { > int ret; > - u8 multiplier; > + u8 multiplier = 8; > > if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2121) { > ret = hidpp_hrw_set_wheel_mode(hidpp, false, true, false); > @@ -2704,10 +2703,9 @@ static int hi_res_scroll_enable(struct hidpp_device *hidpp) > } else if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2120) { > ret = hidpp_hrs_set_highres_scrolling_mode(hidpp, true, > &multiplier); > - } else /* if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_1P0) */ { > + } else /* if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_1P0) */ > ret = hidpp10_enable_scrolling_acceleration(hidpp); > - multiplier = 8; > - } > + > if (ret) > return ret; >