Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1157002ybl; Wed, 21 Aug 2019 11:00:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhjs2P44+PldxZ8481kp/gq3+fpg2Znxb1UuQd3dnDH3mKBNqQq6Y/Gf88Rkc+zimudXsv X-Received: by 2002:a63:4522:: with SMTP id s34mr29892158pga.362.1566410417404; Wed, 21 Aug 2019 11:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566410417; cv=none; d=google.com; s=arc-20160816; b=bEF22tNiJyKAz+ASBb8faZ/8Rp1ekGmfH6ypkC+DCweenGJNVM3LY+nZhDPaTNUCXN rdzZczJMC+7OFyMovylm91BOhePzK1ioonTKLy1FKJKvxPtKXhS4z3ubT+wG7J3vaCJv SCb4nYq29lCMaxHwEg+PxIFojV+RywDp3C/bDHf+SUetAN3u0B0IowPcZeB+g5YHAh5k z3usOI+HGgMclu1Z2un87SrlZaUtyr2rvI0FoSoO6A7pWeteurxoJwX4PPuqszEq/D19 paQNWVOuw8A5AL+uHXkRMQGd7GdDHYntC/IpdPF4+SUHMk83nOgQwnoNFgc98MyWEsuz CTMw== 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=cuc7KArAwEZwDVhK9UQGoIlx3cYOJWBMGimfd+D8qCg=; b=a77fMj3PP+K15qBUaN56dCLdHZqMzIBLAVnP2QyOglsUmvG029b1dilLIbfNTRbXwN QHHa6w5GSJi54w7tVW2dGZ2knKe6XppmXyHoErx6tTlYRcCPFaPLpDET5pgjp4Es6rmn UbkDaVl/BUwDGvINk+Jy8S6FYHYtEmGLOJnB//jrBsLfthqjATf5QM2xlRqzyP/SYqIO b2zQd/c78MOj/araJNupgJQvxpe+n+P+cDeTgD0SMaJipyNBSu7WqRjrUlUv7+BBcxWw C+zdkaDg9lgRe2kfcLCLHtZJIMEySxyUOTi61Yy6IWjceLwUB45+ljoZGUf1fmM69lqC t97w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z2IrsROH; 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 h5si15105813plr.134.2019.08.21.11.00.01; Wed, 21 Aug 2019 11:00:17 -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=Z2IrsROH; 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 S1729074AbfHURtB (ORCPT + 99 others); Wed, 21 Aug 2019 13:49:01 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42583 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727416AbfHURtB (ORCPT ); Wed, 21 Aug 2019 13:49:01 -0400 Received: by mail-pf1-f193.google.com with SMTP id i30so1894474pfk.9; Wed, 21 Aug 2019 10:49:01 -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=cuc7KArAwEZwDVhK9UQGoIlx3cYOJWBMGimfd+D8qCg=; b=Z2IrsROHrgGddTp70xQRuUmUImik5DFHyqPJBEP6guIEvSGDYKGOJna9rw7t2aVLZw foYQrmnHtGq7Ki7PRB8NZf6Wscpv2fB8sQzAzCM3hvTSLmICTHHqRS6eGMXcU5XfWYil U9xbtD0Eidq+jfFOoCyDwd5nP7gONspQC/4BXhg232blHOWG/686CZP4efQEqta+HQ6L EaHUBPyG1vfuzRn9Ph84/Phanu0+JN9lEgn8ucc6f7+GYXaMNkJ3DJw6yU/BpUI1VEGV mvBtumjQUGWk73sIGUkrpqkWO5LnqA0IRIeLsgHUZaNQswv/eJuVjfXUeRhwBupXGGI2 lq9Q== 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=cuc7KArAwEZwDVhK9UQGoIlx3cYOJWBMGimfd+D8qCg=; b=b5qRgngRFTTI6vfxDoBXV1Yfbbka0hpr2rNyglfJ3koqQnZf3jmRvcNtaLBkyB9Hcn avBhkjzR4bHMB5jnTtFcnRYFWIaCbM4wMC40cbN+5E4WWA3vLzV/w9Eoxoozo6SMfl5W 2tGan2IaL/X0OJazDjuGqEIhOIAn9JQEsdoamXbAHpKJYUHstHBNtHUdOJd1/awFu2Ct ebIYMVITOBt2N4Ccux7YkeY5pEGBq+paDyB3N2/+2ZnASVqt8xPTHdezo8w3x6ksOHGt gcGA6q8SrTafRsxO5VD6PdSCqqPrE7DtqYk3y+dtJrtjncT+G1hiP7Dt1P+ve6VfQy28 mOvA== X-Gm-Message-State: APjAAAUVpiras1mOqo/OhVnycSJIivyaZ88NudF6qThlx75RL/evaPp3 OZGCrO0KllHJ4Hm9vt0SPn0= X-Received: by 2002:a17:90a:dac3:: with SMTP id g3mr1165426pjx.45.1566409740377; Wed, 21 Aug 2019 10:49:00 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id b5sm23381967pfo.149.2019.08.21.10.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:48:59 -0700 (PDT) Date: Wed, 21 Aug 2019 10:48:57 -0700 From: Dmitry Torokhov To: "Enrico Weigelt, metux IT consult" Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , "Enrico Weigelt, metux IT consult" , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net Subject: Re: [PATCH 2/2] drivers: input: mouse: alps: drop unneeded likely() call around IS_ERR() Message-ID: <20190821174857.GD76194@dtor-ws> References: <1566298572-12409-1-git-send-email-info@metux.net> <1566298572-12409-2-git-send-email-info@metux.net> <20190820111719.7blyk5jstgwde2ae@pali> <02f5b546-5c30-4998-19b2-76b816a35371@metux.net> <20190820142204.x352bftlvnb7s57n@pali> <2cd7178e-9713-7678-a02d-dde91e990c1e@metux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2cd7178e-9713-7678-a02d-dde91e990c1e@metux.net> 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, On Wed, Aug 21, 2019 at 01:37:09PM +0200, Enrico Weigelt, metux IT consult wrote: > On 20.08.19 16:22, Pali Roh?r wrote: > > Hi, > > > > In that case, wouldn't a comment be more suitable for that ? > > > > And why to add comment if current state of code is more-readable and > > does not need it? > > Readability is probably a bit subjective :p > > With ongoing efforts of automatically identifying redundant code pathes, > the current situation causes the same discussion coming up over and over > again. Sooner or later somebody might get the idea to add a comment on > that line, that it's exactly as intented :o > > OTOH, I'm unsure whether it's important to document that is particular > error path is unlikely, while we don't do it in thousands of other > places. IMHO, error pathes are supposed to be unlikely by nature, > otherwise we wouldn't call it an error situation ;-) > > > People normally add comments to code which is problematic to understand > > or is somehow tricky, no so obvious or document how should code behave. > > Yes, but isn't this case so obvious that it doesn't need any > documentation at all ? Is it so important to never ever forget that this > particular path is a rare situation ? Because if I see "if (IS_ERR(...))" in an interrupt path I will try to see if it can be optimized out, but in this particular case we document it with explicit "unlikely" and I know that I do not need to bother. The fact that there is unlikely in IS_ERR is an implementation detail. It may be gone tomorrow. I do not want to have to remember all implementation details of all kernel APIs and readjust the code all the time as they are change underneath me. Thanks. -- Dmitry