From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751765AbcGXNSG (ORCPT ); Sun, 24 Jul 2016 09:18:06 -0400 Received: from mx01-fr.bfs.de ([193.174.231.67]:24156 "EHLO mx01-fr.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbcGXNSE (ORCPT ); Sun, 24 Jul 2016 09:18:04 -0400 Message-ID: <5794BFFF.7000408@bfs.de> Date: Sun, 24 Jul 2016 15:17:51 +0200 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Julia Lawall CC: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: is_err checking References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? 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 >