From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:8312 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728975AbgBKNMR (ORCPT ); Tue, 11 Feb 2020 08:12:17 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01BCwvVZ130452 for ; Tue, 11 Feb 2020 08:12:16 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y1u56yxw3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 11 Feb 2020 08:12:16 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Feb 2020 13:12:14 -0000 Date: Tue, 11 Feb 2020 14:12:08 +0100 From: Vasily Gorbik Subject: Re: [PATCH] s390/time: Fix clk type in get_tod_clock References: <20200208140858.47970-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200208140858.47970-1-natechancellor@gmail.com> Message-Id: Sender: linux-s390-owner@vger.kernel.org List-ID: To: Nathan Chancellor Cc: Heiko Carstens , Christian Borntraeger , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com On Sat, Feb 08, 2020 at 07:08:59AM -0700, Nathan Chancellor wrote: > Clang warns: > > In file included from ../arch/s390/boot/startup.c:3: > In file included from ../include/linux/elf.h:5: > In file included from ../arch/s390/include/asm/elf.h:132: > In file included from ../include/linux/compat.h:10: > In file included from ../include/linux/time.h:74: > In file included from ../include/linux/time32.h:13: > In file included from ../include/linux/timex.h:65: > ../arch/s390/include/asm/timex.h:160:20: warning: passing 'unsigned char > [16]' to parameter of type 'char *' converts between pointers to integer > types with different sign [-Wpointer-sign] > get_tod_clock_ext(clk); > ^~~ > ../arch/s390/include/asm/timex.h:149:44: note: passing argument to > parameter 'clk' here > static inline void get_tod_clock_ext(char *clk) > ^ > > Change clk's type to just be char so that it matches what happens in > get_tod_clock_ext. > > Fixes: 57b28f66316d ("[S390] s390_hypfs: Add new attributes") > Link: https://github.com/ClangBuiltLinux/linux/issues/861 > Signed-off-by: Nathan Chancellor > --- > > Alternatively, changing the clk type in get_tod_clock_ext to unsigned > which is what it was in the early 2000s. > > arch/s390/include/asm/timex.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h > index 670f14a228e5..6bf3a45ccfec 100644 > --- a/arch/s390/include/asm/timex.h > +++ b/arch/s390/include/asm/timex.h > @@ -155,7 +155,7 @@ static inline void get_tod_clock_ext(char *clk) > > static inline unsigned long long get_tod_clock(void) > { > - unsigned char clk[STORE_CLOCK_EXT_SIZE]; > + char clk[STORE_CLOCK_EXT_SIZE]; > > get_tod_clock_ext(clk); > return *((unsigned long long *)&clk[1]); > -- > 2.25.0 > Applied, thanks. I wonder though if Fixes: tag is really required for such changes. It triggers stable backports (for all stable branches since v2.6.35) and hence a lot of noise.