Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751327AbbHALpF (ORCPT ); Sat, 1 Aug 2015 07:45:05 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:37869 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbbHALpD (ORCPT ); Sat, 1 Aug 2015 07:45:03 -0400 From: Pali =?utf-8?q?Roh=C3=A1r?= To: Viresh Kumar , Dmitry Torokhov Subject: Re: [PATCH 05/15] drivers: input: Drop unlikely before IS_ERR(_OR_NULL) Date: Sat, 1 Aug 2015 13:44:59 +0200 User-Agent: KMail/1.13.7 (Linux/3.13.0-61-generic; KDE/4.14.2; x86_64; ; ) Cc: akpm@linux-foundation.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Hans de Goede , "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." , Masaki Ota References: <20150731165841.GD5613@dtor-ws> <20150801112251.GK899@linux> In-Reply-To: <20150801112251.GK899@linux> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3367423.SIxKtUkyAF"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201508011344.59372@pali> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1847 Lines: 51 --nextPart3367423.SIxKtUkyAF Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Saturday 01 August 2015 13:22:51 Viresh Kumar wrote: > On 31-07-15, 09:58, Dmitry Torokhov wrote: > > On Fri, Jul 31, 2015 at 02:08:25PM +0530, Viresh Kumar wrote: > > > IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and > > > there is no need to do that again from its callers. Drop it. > >=20 > > I'd rather keep it as it documents the expected behavior and double > > unlikely should work just fine. >=20 > TBH, I don't really agree that it is there for documentation. The > only purpose of such compiler flags is to try make code more > efficient. >=20 > Anyway, I got to this series as someone asked me to fix this for one > of my patches which used unlikely(IS_ERR_OR_NULL()). And so I > thought about fixing all sites that are doing double unlikely (that > shouldn't hurt for sure). >=20 > I will leave it to you. I think that unlikely() macro here make code more readable. Yes, it is=20 also for compiler optimization, but also for me it looks like Clean Code=20 pattern -- is not it? =2D-=20 Pali Roh=C3=A1r pali.rohar@gmail.com --nextPart3367423.SIxKtUkyAF Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAlW8sTsACgkQi/DJPQPkQ1LQaACfVggcmkQRTJLk7T449aO0Hbah FQwAoIvRtqMpx5rWhXPwTGfy385EHYWd =ftpS -----END PGP SIGNATURE----- --nextPart3367423.SIxKtUkyAF-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/