Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751122AbdCNIEy (ORCPT ); Tue, 14 Mar 2017 04:04:54 -0400 Received: from webclient5.webclient5.de ([136.243.32.179]:56152 "EHLO webclient5.webclient5.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbdCNIEx (ORCPT ); Tue, 14 Mar 2017 04:04:53 -0400 X-Greylist: delayed 513 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Mar 2017 04:04:52 EDT Subject: Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned To: Matthias Kaehlcke , Arnd Bergmann , Greg Kroah-Hartman References: <20170313185725.144873-1-mka@chromium.org> Cc: linux-kernel@vger.kernel.org, Grant Grundler , Andrew Morton From: Clemens Ladisch Message-ID: <1b8d62d2-9c3a-eb18-9b4b-21d2a80cebfa@ladisch.de> Date: Tue, 14 Mar 2017 08:56:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170313185725.144873-1-mka@chromium.org> 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 Content-Length: 1433 Lines: 39 Matthias Kaehlcke wrote: > The value passed by the two callers of the function is unsigned anyway. Indeed; and those are just simple wrappers. > Making the parameter unsigned fixes the following warning when building > with clang: > > drivers/char/hpet.c:588:7: error: overflow converting case value to switch condition type (2149083139 to 18446744071563667459) [-Werror,-Wswitch] > case HPET_INFO: > ^ > include/uapi/linux/hpet.h:18:19: note: expanded from macro 'HPET_INFO' > ^ > include/uapi/asm-generic/ioctl.h:77:28: note: expanded from macro '_IOR' > ^ > include/uapi/asm-generic/ioctl.h:66:2: note: expanded from macro '_IOC' > (((dir) << _IOC_DIRSHIFT) | \ > > Signed-off-by: Matthias Kaehlcke Acked-by: Clemens Ladisch > --- > drivers/char/hpet.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c > index 20b32bb8c2af..0d633b76c29e 100644 > --- a/drivers/char/hpet.c > +++ b/drivers/char/hpet.c > @@ -574,7 +574,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, > } > > static int > -hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, > +hpet_ioctl_common(struct hpet_dev *devp, unsigned int cmd, unsigned long arg, > struct hpet_info *info) > { > struct hpet_timer __iomem *timer;