From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758023AbcBDOpt (ORCPT ); Thu, 4 Feb 2016 09:45:49 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:33932 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756713AbcBDOpr (ORCPT ); Thu, 4 Feb 2016 09:45:47 -0500 X-AuditID: cbfec7f4-f79026d00000418a-91-56b36419d3b6 Subject: Re: [PATCH v3] err.h: allow IS_ERR_VALUE to handle properly more types To: Arnd Bergmann References: <20160202163350.f7d42f4b97f48756f3900e9a@linux-foundation.org> <1454505328-26019-1-git-send-email-a.hajda@samsung.com> <13351313.c4ZqBbQEld@wuerfel> Cc: Andrew Morton , Bartlomiej Zolnierkiewicz , Marek Szyprowski , open list , Bob Peterson From: Andrzej Hajda Message-id: <56B363E3.9050007@samsung.com> Date: Thu, 04 Feb 2016 15:44:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: <13351313.c4ZqBbQEld@wuerfel> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsVy+t/xK7qSKZvDDLZck7SYs34Nm8XfScfY LTbOWM9qcXnXHDaLtUfuslt0zW5lc2Dz+P1rEqPHiRm/WTze77vK5tG3ZRWjx+dNcgGsUVw2 Kak5mWWpRfp2CVwZi+f+YCx4yVmxrr+NvYHxMnsXIyeHhICJxIXT+9ggbDGJC/fWA9lcHEIC Sxklbm+axgrhPGeU2HJwOZDDwSEs4C+x5JEqSIOIgKLE1BfPmCFqljBKXG9ZywLiMAs8YZTo bZ3MDFLFJqAp8XfzTbAVvAJaEq9aQaZycrAIqEp8/d0CFhcViJA43NnFDlEjKPFj8j0WkGWc QPX7mjlATGYBPYn7F7VAKpgF5CU2r3nLPIFRYBaShlkIVbOQVC1gZF7FKJpamlxQnJSea6hX nJhbXJqXrpecn7uJERLYX3YwLj5mdYhRgINRiYf3hvemMCHWxLLiytxDjBIczEoivMsiNocJ 8aYkVlalFuXHF5XmpBYfYpTmYFES5527632IkEB6YklqdmpqQWoRTJaJg1OqgTFeVT05Sim1 o+KZtrB+5ffJvaEPdVd9yjE5I5j6vLnJtCzscYmRk+32S+t+23QVBDVNF6h9JvHVYNYvJfE1 eRXajN+SJkTmlz298YPDK8LjcPMdJp+rzicTl3/+Z89QsMT5rZB466UtO66XSN07/Opbd7x/ 7Pm452Vqe79aqr7JvB2yJfNCshJLcUaioRZzUXEiAND0b3BoAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/04/2016 01:40 PM, Arnd Bergmann wrote: > On Wednesday 03 February 2016 14:15:28 Andrzej Hajda wrote: >> diff --git a/include/linux/err.h b/include/linux/err.h >> index 56762ab..b7d4a9f 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) <= -1) \ >> + : unlikely((x) >= (typeof(x))-MAX_ERRNO)) >> >> static inline void * __must_check ERR_PTR(long error) >> { >> > This has caused a warning to reappear that I had fixed before: > > fs/gfs2/dir.c: In function 'get_first_leaf': > fs/gfs2/dir.c:802:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized] > error = get_leaf(dip, leaf_no, bh_out); > ^ > fs/gfs2/dir.c: In function 'dir_split_leaf': > fs/gfs2/dir.c:1021:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized] > error = get_leaf(dip, leaf_no, &obh); What gcc/arch/build options do you use? I cannot reproduce it in my environment. Regards Andrzej