Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755626AbbHCViZ (ORCPT ); Mon, 3 Aug 2015 17:38:25 -0400 Received: from smtprelay0165.hostedemail.com ([216.40.44.165]:45158 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755336AbbHCViY (ORCPT ); Mon, 3 Aug 2015 17:38:24 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2689:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3870:3871:3872:4184:4321:4605:5007:6261:7875:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12517:12519:12740:13069:13311:13357:13972:21060:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: crush20_83386af72c729 X-Filterd-Recvd-Size: 2281 Date: Mon, 3 Aug 2015 17:38:20 -0400 From: Steven Rostedt To: "Kirill A. Shutemov" Cc: Vlastimil Babka , Viresh Kumar , akpm@linux-foundation.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Hans Ulli Kroll , Alexandre Belloni , Oleg Drokin , Andreas Dilger Subject: Re: [PATCH 00/15] trivial: Drop unlikely before IS_ERR(_OR_NULL) Message-ID: <20150803173820.5a6111ea@gandalf.local.home> In-Reply-To: <20150731102310.GA31850@node.dhcp.inet.fi> References: <55BB42B5.5070409@suse.cz> <20150731102310.GA31850@node.dhcp.inet.fi> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 36 On Fri, 31 Jul 2015 13:23:10 +0300 "Kirill A. Shutemov" wrote: > On Fri, Jul 31, 2015 at 11:41:09AM +0200, Vlastimil Babka wrote: > > On 07/31/2015 10:38 AM, Viresh Kumar wrote: > > >Hi, > > > > > >This cleans up the usage of IS_ERR(_OR_NULL)(), where the callers have > > >added additional unlikely compiler flag to them. It also fixes the > > >definition of IS_ERR_OR_NULL(), to use unlikely for all checks it does. > > > > [+CC Steven Rostedt] > > > > Any idea what the compiler does in the case of > > "if (likely(IS_ERR(...)))"? There are apparently such cases in the source. > > We have two cases in code: > > drivers/rtc/rtc-gemini.c: if (likely(IS_ERR(rtc->rtc_dev))) > drivers/staging/lustre/lustre/obdclass/lu_object.c: if (likely(IS_ERR(shadow) && PTR_ERR(shadow) == -ENOENT)) { > > The first one is mistake, I think. Or do we expect rtc_device_register() > to fail? > > The second is redundant. "if (PTR_ERR(shadow) == -ENOENT)" should do the > job. > Yep, those look like bugs to me. -- Steve -- 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/