Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5329575ybi; Wed, 12 Jun 2019 00:19:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxLtCihOrGyZXrp65O59P0mAWX5kAK1zbrbHpegsutRGQLlHg1zY+0QX7kdks9IxhMBghD X-Received: by 2002:aa7:8102:: with SMTP id b2mr58696110pfi.105.1560323982202; Wed, 12 Jun 2019 00:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560323982; cv=none; d=google.com; s=arc-20160816; b=me+aGHXZPTH+OjlThcRHk3H2jsOrW0KjrbCSyaCAtvPMUTdpKRhm3AB8MOBhH3BjVr eZ8i0cygbPfOj+RqYZBoT7K2/E2Ml2golV8WAqswlZ1+qWxJYc1PRm+kDudI98r0XxA1 LmKi2zYSsVuTh9O6AW0wohj3oTPts5x2cJU+Ii8wKRW9atpowE3GzNMogDVB9qISbBNz 6VYYKFEUaaEbR0NiZD9fXoLsyg5J3P6Bqu3eneIrqiPj6XUOVEVk043ZQEq6yFxBWDnL OnW1z1GaYAjNvZOdrxnHA+QzWjorehFG8vukuIRXTfE98FcNJ/XuU3B3nf33eoiAvtfm PULw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/PPIjQFyfTkfzuR15arYhai8Ecn9PF3DgttDvytbBEs=; b=JT6ei8HsBeO9SPToPpMWhOzgkT7c6Ii1kaojaoWU/mnZHBREYPBlsk+UEYq9QHxs9p iZLOsvZIso1C1ZoNEl17SAk/RxVPaSyGHkpVL7stWXQ9OlX78ddyH3e/VKWADz0YV/Y+ aC+p1apYZNdo95kUclzFqk4lFzpkKM9z50B+z7bUelnWuOXaQx7O7/69LEX0NDAMY4Mm DHcILLDB9M2IupPHPfiK+CKHvm5Opx/Co+onukqlkmCBVGc7QIu1f9E+YRvU0IpWFv57 /A9cz5A4MkPD2u1nORLieEE0deqGaCQq7OwrGvk4cgTPzvxIag6ca2hLVD5skeYI5VLW ChPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fRbpPbZm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si14789351pgr.361.2019.06.12.00.19.25; Wed, 12 Jun 2019 00:19:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fRbpPbZm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436998AbfFLA7R (ORCPT + 99 others); Tue, 11 Jun 2019 20:59:17 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33364 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404906AbfFLA7R (ORCPT ); Tue, 11 Jun 2019 20:59:17 -0400 Received: by mail-pg1-f196.google.com with SMTP id k187so7427288pga.0; Tue, 11 Jun 2019 17:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=/PPIjQFyfTkfzuR15arYhai8Ecn9PF3DgttDvytbBEs=; b=fRbpPbZmWMBO2LmKWljmW5qW2yJisw3oJ6EHD64jrKLYLIkx4A4CNJVQDgILcAoOf/ /R00cHT/1+MPVpakLW6g29V8UCcAHYY366Gia3aQhX/vpqjLv01eA2LGqAjCmIkMG17q 7De/HRdIf0hGPWEvoboV00jrHzbOPCsckHhxMzXgqX+Xt78ncLv0JnhALTAM24Lg+Fpf t5cPOa37iZkEJJ08ZEPRx8wU7C3Ng9AQP6gYMRtKnUpbYlU0/du7YSk8gT0KG7XoKwXD 7Qakh3qE91hTIJnJdWgWCpzJKHrdyW47QKl+fY1jpaR2NUNEmaji4dvI5xNY+HzT4+9C BjPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=/PPIjQFyfTkfzuR15arYhai8Ecn9PF3DgttDvytbBEs=; b=jCUbGGXYNYyJgx9wZ2DH64iYma199SzcdcpEaK6av+1C7EH5fnXbVdrbj1soBZ4p4Q QikGMe8Y+jOhlQeUaTh18JrdMrYO9J644g9ySNobkUtp0++zwyHfUYwCWzBahqS1zrH5 dJOShnwCrXlbYu4RhKW1BKiYks7NV0J2GLDq8najMdfwS613u4x2Ac61bLQM3Kp4t+0y od2JY/WXdcNU9eKgcszAgbX8tG0RHiQuOJjsZYAx0bpp1AKAi/RmGKbeDWkxpkcqbkQ3 KAHqVI9TPf/BSRZfQHzxXKCTzZzibCMynMFYmpwStrY1yRKrsKo3rRZM2ITqwClSbL4y j1Ww== X-Gm-Message-State: APjAAAWE3n4+qSXB/9Dsx4lviYkq0ZecQCHS0E3wBmdz8+Cc4U1UpKUD 1RYDAO/Z1/XBVnmeAf2Wukc= X-Received: by 2002:a17:90a:bc08:: with SMTP id w8mr30345882pjr.45.1560301156268; Tue, 11 Jun 2019 17:59:16 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id j19sm12544044pfi.72.2019.06.11.17.59.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 17:59:15 -0700 (PDT) Date: Tue, 11 Jun 2019 17:59:13 -0700 From: Dmitry Torokhov To: Joe Perches Cc: Kefeng Wang , Pali =?iso-8859-1?Q?Roh=E1r?= , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH] Input: alps: Drop unlikely before IS_ERR(_OR_NULL) Message-ID: <20190612005913.GJ143729@dtor-ws> References: <20190605142428.84784-1-wangkefeng.wang@huawei.com> <20190605142428.84784-5-wangkefeng.wang@huawei.com> <20190605144240.pfrvlgxsdpacpwxf@pali> <36eac452-5477-3670-7980-765d0879ead4@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joe, On Wed, Jun 05, 2019 at 07:28:53PM -0700, Joe Perches wrote: > On Thu, 2019-06-06 at 09:08 +0800, Kefeng Wang wrote: > > On 2019/6/5 22:42, Pali Roh?r wrote: > > > On Wednesday 05 June 2019 22:24:28 Kefeng Wang wrote: > > > > IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag, > > > > so no need to do that again from its callers. Drop it. > > > Hi! I already reviewed this patch and rejected it, see: > > > https://patchwork.kernel.org/patch/10817475/ > > OK, please ignore it. > > I think the stated reason of better readability isn't > particularly sensible as the object code produced is > actually slightly larger. > > x86-64 defconfig (gcc 8.3.0) > > $ size drivers/input/mouse/alps.o* > text data bss dec hex filename > 29416 56 0 29472 7320 drivers/input/mouse/alps.o.new > 29432 56 0 29488 7330 drivers/input/mouse/alps.o.old If gcc produces worse code for double unlikely, you should probably report it to gcc folks, no? Or double unlikely turns into likely? > > Also if this unlikely is _really_ useful, perhaps the > !IS_ERR immediately after could also use likely as the > test seems only done for an OOM condition. No, once you take the IS_ERR_OR_NULL(priv->dev3) == true branch it stops being hot path and additional annotations are completely unneeded. And if we failed to create and register priv->dev3 device - that's an error and system is degraded. Can't do much here. Thanks. -- Dmitry