From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755404AbcBCAdx (ORCPT ); Tue, 2 Feb 2016 19:33:53 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43353 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755025AbcBCAdv (ORCPT ); Tue, 2 Feb 2016 19:33:51 -0500 Date: Tue, 2 Feb 2016 16:33:50 -0800 From: Andrew Morton To: Andrzej Hajda Cc: linux-kernel@vger.kernel.org (open list), Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: Re: [PATCH v2] err.h: allow IS_ERR_VALUE to handle properly more types Message-Id: <20160202163350.f7d42f4b97f48756f3900e9a@linux-foundation.org> In-Reply-To: <1453969648-4036-1-git-send-email-a.hajda@samsung.com> References: <201601072342.xanwLeaS%fengguang.wu@intel.com> <1453969648-4036-1-git-send-email-a.hajda@samsung.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; 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 On Thu, 28 Jan 2016 09:27:28 +0100 Andrzej Hajda wrote: > - use '<= 0' instead of '< 0' to silence gcc verbose warnings, > - expand commit message. > --- > include/linux/err.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/linux/err.h b/include/linux/err.h > index 56762ab..43a6adb 100644 > --- a/include/linux/err.h > +++ b/include/linux/err.h > @@ -18,7 +18,9 @@ > > #ifndef __ASSEMBLY__ > > -#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) > +#define IS_ERR_VALUE(x) ((typeof(x))(-1) <= 0 \ > + ? unlikely((x) < 0) \ > + : unlikely((x) >= (typeof(x))-MAX_ERRNO)) I'm still getting a bunch of include/linux/err.h: In function 'IS_ERR': include/linux/err.h:37: warning: comparison of unsigned expression < 0 is always false include/linux/err.h: In function 'IS_ERR_OR_NULL': include/linux/err.h:42: warning: comparison of unsigned expression < 0 is always false with gcc-4.4.4.