Message ID | 20221115053920.65318-1-jiapeng.chong@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2534047wru; Mon, 14 Nov 2022 21:41:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rSPsGe6ck+M2dvnTbWutKiJixGqEPq2yTN4yiax5JR6ji45u0DmHpRx6Mq/qzFb5AuZdl X-Received: by 2002:aa7:d707:0:b0:457:1591:cd74 with SMTP id t7-20020aa7d707000000b004571591cd74mr13579674edq.228.1668490868551; Mon, 14 Nov 2022 21:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668490868; cv=none; d=google.com; s=arc-20160816; b=nyK/5i3ErgPaBWDoZdLxjw8kd4gquDTP/hfemaOuzbRhq0DQzIrrWiIl8XvPgZPSxr mWyPdBBZBcoh57DRD8mPE9CeYXm0jCsT4d9mdraY5RW4kTdhbi+Nq6img0z6X6G3fBP7 9jtsZqWGFYMzkCkbWxJRcuLHVbAxmONOm71cA04B5Pv9MPVagVabeSIUosLZbrG+UCdx OqW0YNVok/VaDvNSUH9yOBHHOWE4S5t3zJR+evvcNyH9RWMcbSqSW5Y+AKt28gln5/Kr QuD1jDFIFtR1lVMdVwMhZiwKGoC9IwNF22cMbgiiQaoi06UAT+T2y/s/wXY7YSPIeuBw Qgkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9YeYolUflLFPW/lmJoF4py+8fPwwTcizDjRjGpPLh4s=; b=Msfl2k+vWnJ3Mwb4snvZyuAU73OFGW7hXGvFTpmztAP0LuEPRfPJlqiqfw95nBBPSd ePq5xIa23bvfW31DG8P4ODjFWL+otT/Gc3CPbA9gTr8pb/RsdM9Pb2JHHMkIjtrZSxNa RD3EOUwhU+Ey+fh3ovoNaIs63A38hYKhtHwpx8GyRMDdkV5iVcty1ZO8Mb9By/xXQSQe MyPUQlh/IDQnkn5wQ3ZhzDW1b1jPUQdcsjjRqClGNvP02Sne6wpCcjbR+Vb5ZXZbVA9R HDFEt0WZh9IR5jAWr7PTvVhxBsOMjCaiPngRWaxT2kU3l76288hCJ2bjcclSxiwlbdWx 6ftg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp36-20020a1709071b2400b0078d450cbb02si11744600ejc.452.2022.11.14.21.40.44; Mon, 14 Nov 2022 21:41:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbiKOFjz (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Tue, 15 Nov 2022 00:39:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbiKOFjp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 15 Nov 2022 00:39:45 -0500 Received: from out199-7.us.a.mail.aliyun.com (out199-7.us.a.mail.aliyun.com [47.90.199.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 134C76463; Mon, 14 Nov 2022 21:39:43 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VUs-Rax_1668490775; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VUs-Rax_1668490775) by smtp.aliyun-inc.com; Tue, 15 Nov 2022 13:39:39 +0800 From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> To: roderick.colenbrander@sony.com Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, rydberg@bitmath.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH] HID: playstation: remove unreachable code Date: Tue, 15 Nov 2022 13:39:20 +0800 Message-Id: <20221115053920.65318-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749539480795031753?= X-GMAIL-MSGID: =?utf-8?q?1749539480795031753?= |
Series |
HID: playstation: remove unreachable code
|
|
Commit Message
Jiapeng Chong
Nov. 15, 2022, 5:39 a.m. UTC
The function dualshock4_get_calibration_data cannot execute hid_err,
delete the invalid code.
drivers/hid/hid-playstation.c:1766 dualshock4_get_calibration_data() warn: ignoring unreachable code.
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3073
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/hid/hid-playstation.c | 2 --
1 file changed, 2 deletions(-)
Comments
On Mon, Nov 14, 2022 at 9:40 PM Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote: > > The function dualshock4_get_calibration_data cannot execute hid_err, > delete the invalid code. > > drivers/hid/hid-playstation.c:1766 dualshock4_get_calibration_data() warn: ignoring unreachable code. > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3073 > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> > --- > drivers/hid/hid-playstation.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c > index bae3e712a562..a4106f760d1f 100644 > --- a/drivers/hid/hid-playstation.c > +++ b/drivers/hid/hid-playstation.c > @@ -1763,8 +1763,6 @@ static int dualshock4_get_calibration_data(struct dualshock4 *ds4) > ret = -EILSEQ; > goto err_free; > } > - hid_err(hdev, "Failed to retrieve DualShock4 calibration info: %d\n", ret); > - goto err_free; > } else { > break; > } > -- > 2.20.1.7.g153144c > Thanks for pointing this out. The error message is actually needed and should be moved either in the else statement or we just take the else statement. Thanks, Roderick
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c index bae3e712a562..a4106f760d1f 100644 --- a/drivers/hid/hid-playstation.c +++ b/drivers/hid/hid-playstation.c @@ -1763,8 +1763,6 @@ static int dualshock4_get_calibration_data(struct dualshock4 *ds4) ret = -EILSEQ; goto err_free; } - hid_err(hdev, "Failed to retrieve DualShock4 calibration info: %d\n", ret); - goto err_free; } else { break; }