Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751693AbbHBP7p (ORCPT ); Sun, 2 Aug 2015 11:59:45 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:37385 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbbHBP7n (ORCPT ); Sun, 2 Aug 2015 11:59:43 -0400 From: Pali =?utf-8?q?Roh=C3=A1r?= To: Pavel Machek Subject: Re: [PATCH 05/15] drivers: input: Drop unlikely before IS_ERR(_OR_NULL) Date: Sun, 2 Aug 2015 17:59:39 +0200 User-Agent: KMail/1.13.7 (Linux/3.13.0-61-generic; KDE/4.14.2; x86_64; ; ) Cc: Viresh Kumar , Dmitry Torokhov , 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: <201508011344.59372@pali> <20150802154352.GA28860@amd> In-Reply-To: <20150802154352.GA28860@amd> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2015825.X8yx16d8M7"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201508021759.39451@pali> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2198 Lines: 61 --nextPart2015825.X8yx16d8M7 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sunday 02 August 2015 17:43:52 Pavel Machek wrote: > On Sat 2015-08-01 13:44:59, Pali Roh=C3=A1r wrote: > > 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. > >=20 > > I think that unlikely() macro here make code more readable. Yes, it > > is also for compiler optimization, but also for me it looks like > > Clean Code pattern -- > > is not it? >=20 > People know that errors are unlikely, no need to tell them. I'd > remove it. > Pavel Errors and bugs are always unlikely ;-) =2D-=20 Pali Roh=C3=A1r pali.rohar@gmail.com --nextPart2015825.X8yx16d8M7 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) iEYEABECAAYFAlW+PmsACgkQi/DJPQPkQ1I+IACgiIcIqam1aqdStW1wSAij/y92 fY0AnAy2TPdmBKlKsamPmZP3GM3jurlG =xu/7 -----END PGP SIGNATURE----- --nextPart2015825.X8yx16d8M7-- -- 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/