From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145AbcGXPiD (ORCPT ); Sun, 24 Jul 2016 11:38:03 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:59253 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584AbcGXPiA (ORCPT ); Sun, 24 Jul 2016 11:38:00 -0400 X-IronPort-AV: E=Sophos;i="5.28,414,1464645600"; d="scan'208";a="185789282" Date: Sun, 24 Jul 2016 17:37:56 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: walter harms cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: is_err checking In-Reply-To: <5794BFFF.7000408@bfs.de> Message-ID: References: <5794BFFF.7000408@bfs.de> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 24 Jul 2016, walter harms wrote: > > > Am 23.07.2016 16:56, schrieb Julia Lawall: > > Code like the following looks a bit clunky to me: > > > > if (IS_ERR(data->clk) && PTR_ERR(data->clk) != -EPROBE_DEFER) > > > > Is there any reason not to always use eg > > > > data->clk == ERR_PTR(-EPROBE_DEFER) > > > > Code of the latter form is a bit more popular. Perhaps one could want > > something like: > > > > IS_ERR_VALUE(data->clk, -EPROBE_DEFER) > > > > but IS_ERR_VALUE is laready used for something else. > > > > note: i do not like hiding behind #defines > > did you actually see code like IS_ERR_VALUE(data->clk, -EPROBE_DEFER) > in the current kernel ? No, no. It's the combination of English words I thought would be useful for expressing the concept. But it's already used for something else. julia > because there is no second argument: > > #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) > > or is this a misunderstanding ? > > re, > wh > > > julia > > -- > > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > >