Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3982852ybl; Tue, 20 Aug 2019 05:23:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+qLsCMjgmvzjHh/FRuoelTYHtukeJ6duOyCq4eFJXn/P4f1VXWvqlj4OEDlBfv3tV9jTK X-Received: by 2002:aa7:9118:: with SMTP id 24mr28707988pfh.56.1566303788065; Tue, 20 Aug 2019 05:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566303788; cv=none; d=google.com; s=arc-20160816; b=mOgDETb1luIbeSseKtDg/ozUv/94oRq+yYP/Vl+3YUX5JIyldeX7HQl6sVZjBMshj0 o/1Fi/NNOXMOY7eQ6cyulMoULb3Ba7EhBRRf19nS/FpkET2J0INfAmWiMnnGdeQEMrCm qEL5NFv3+kjg4M4AbRsPo2tlB7CNHLv3iEcW1pIguFC3Bj9N+Au8x6ZuD7Vw3GCiE2dA dClCf1hDUSmxszCjfF5qRqZ5IQNp3AdFzjoIMqRAGt2B4pER13bRxXH1BTw815jdsxXk 7nuACYMLDroagLUnkcao8I1nzstp6hWhLU/ggCtBOG+lUKEznvNc/CrJDDtxGO0FUQYm iZoA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=+KyNX5g5JFWUk9RJ09KR/2vy8Twdev8n8MMMCiobpGo=; b=vEaPAfsNwiZGx9xB2AxH4hwZdn0b1cYq8o9L511woW62AkqZ93bf17zPEOTDCAHBZ2 eX8qQOlEnhhasjrSLUILYswjPsUhg1mAlAHv0aRpOYqtihNV/wHSmE69qRibM3YXmdcv Ge7Ehj6sJ19VfGZHOdoEQGDcokR4vTIughNX4MDBY4pm5b43TSZPK9NMs8QGxh+iEOmv JhXQuYGJz45RqlpnZlJYFsKdyXXziR4rnKLfa3ArfbP2bSOb9vlivzX8DdB+h8jGgFbp Tnfjnn+AZmGsr8zmPzM+p3+KH0PPtrd8wdLakhpmf0WssjkkhuD77/zQOUAn9U+aHp94 Hzhw== 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 n128si12183902pgn.82.2019.08.20.05.22.53; Tue, 20 Aug 2019 05:23:08 -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 S1729693AbfHTMVr (ORCPT + 99 others); Tue, 20 Aug 2019 08:21:47 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:50187 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729409AbfHTMVq (ORCPT ); Tue, 20 Aug 2019 08:21:46 -0400 Received: from [192.168.1.110] ([95.117.23.32]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M9nAB-1hwUEe3tHp-005rTd; Tue, 20 Aug 2019 14:21:38 +0200 Subject: Re: [PATCH 2/2] drivers: input: mouse: alps: drop unneeded likely() call around IS_ERR() To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , "Enrico Weigelt, metux IT consult" Cc: linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net References: <1566298572-12409-1-git-send-email-info@metux.net> <1566298572-12409-2-git-send-email-info@metux.net> <20190820111719.7blyk5jstgwde2ae@pali> From: "Enrico Weigelt, metux IT consult" Organization: metux IT consult Message-ID: <02f5b546-5c30-4998-19b2-76b816a35371@metux.net> Date: Tue, 20 Aug 2019 14:21:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190820111719.7blyk5jstgwde2ae@pali> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:w2EFLBTJ6lqCF1cRxaNsgtU4Ayhs7iamqxZJGE8EtE5RjwoNC4t 1wMHvKMvxJH7423duGgD6HfvMlQ5fOv9CxInJuDzD8b6Foay2URD9yM9ELRgAIiaqJ+RAlw 3WZwlZ7Q2wnBdNZYvV8CtXbfSGpG1jO5ArUonHAYhqaFB5/k8Kpe6AxVlKldbotTp3Z8sjL a2YGl877B7l4bGQbSgKHg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:q+pbJQtMiq8=:Htz0JavxsTOY8vnc9v0Lm5 OdgzGccyeXqXgjZf3yuQdVvnhcJsIPWu4CbYJLEdX2AjKwAFsCobEV9s+EmkLqmd1uBIkf33B +gQOdZxLEEmuf5e93AdRd437V3pEH0B59PVQtPC3LFvbd1xYUoCow+nCRzjD1oPkddoXhcryb Yx1/Kc1vProXPxGkA+U6KIYu3pntb2Em62zrsoS4VsWBRsv/oAknqN+zs/DOOiBEleN/g5Ovm lpDuzANXb+24QcBmAV3hIzlh6jlBUve7eJpKp/qBDPin8fieHAo91eE22YpkLckH9GCK5f/Nr /l2qpLDZaN++SvkVJhPHU/WFURGDAIimwOEhPzZu5TL0oXadOwfoZ+paOTSx0B5phPTjs2GHU tiY6km7tEwSB0KD5EBaRxL2dWrHNt748Oex3YOWMAJcv3rUSAZgvZ24viA5Vj9A1sbe5h/DM4 rC2cBM1qeIxgu7z4HstQ1OgsOgb5OaF3UgYaYBWJikDW/wWfmugs8wuTPk+XAvx2EflPGBcfz CdCKs6M4rCrVWwGgpHx0WqlJIAiQStg/0V/Yr1rOrxVvw1UEp7s/FBsLmzK/wq6CvXshUTPgX 9Sh9T6FveDv/RZvEghHejPMQrT6GUlxS46mdB94Dpqxc92rO7K8wXqsROUo7qrY/CpipHZbcN BD5Bc1khMsEGH17+CWJI37OGeCDth88l6g+Y0sYWwvDDSYIZ4CCWg6i81DZuilyCLWQEqJrss IVvVKEDSqjAVwHF8Oj0SFsmM7VyW6n1L/HdtfDNXbR+3pZwVihUwZ6PW/+tJDLv4HzI8oTTBc SGA3fLE/zLs0QKODQf2dSDVvP71kw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.08.19 13:17, Pali Rohár wrote: > On Tuesday 20 August 2019 12:56:12 Enrico Weigelt, metux IT consult wrote: >> From: Enrico Weigelt >> >> IS_ERR() already calls unlikely(), so this extra unlikely() call >> around IS_ERR() is not needed. >> >> Signed-off-by: Enrico Weigelt >> --- >> drivers/input/mouse/alps.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c >> index 34700ed..ed16614 100644 >> --- a/drivers/input/mouse/alps.c >> +++ b/drivers/input/mouse/alps.c >> @@ -1476,7 +1476,7 @@ static void alps_report_bare_ps2_packet(struct psmouse *psmouse, >> /* On V2 devices the DualPoint Stick reports bare packets */ >> dev = priv->dev2; >> dev2 = psmouse->dev; >> - } else if (unlikely(IS_ERR_OR_NULL(priv->dev3))) { >> + } else if (IS_ERR_OR_NULL(priv->dev3)) { >> /* Register dev3 mouse if we received PS/2 packet first time */ >> if (!IS_ERR(priv->dev3)) >> psmouse_queue_work(psmouse, &priv->dev3_register_work, > > Hello! Two months ago I already saw this patch. See discussion: > https://patchwork.kernel.org/patch/10977099/ phuh, that's long chain of links to folow ;-) So, your primary argument is just *documenting* that this supposed to be a rare condition ? In that case, wouldn't a comment be more suitable for that ? It seems that this issue is coming up again and again ... when people run cocci scans (like I didn't), I'd suspect this to happen even more in the future. --mtx -- Enrico Weigelt, metux IT consult Free software and Linux embedded engineering info@metux.net -- +49-151-27565287