linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned
@ 2017-03-13 18:57 Matthias Kaehlcke
  2017-03-14  7:56 ` Clemens Ladisch
  0 siblings, 1 reply; 5+ messages in thread
From: Matthias Kaehlcke @ 2017-03-13 18:57 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Clemens Ladisch
  Cc: linux-kernel, Grant Grundler, Matthias Kaehlcke

The value passed by the two callers of the function is unsigned anyway.

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 <mka@chromium.org>
---
 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;
-- 
2.12.0.246.ga2ecc84866-goog

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned
  2017-03-13 18:57 [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned Matthias Kaehlcke
@ 2017-03-14  7:56 ` Clemens Ladisch
  2017-03-23 21:47   ` Grant Grundler
  0 siblings, 1 reply; 5+ messages in thread
From: Clemens Ladisch @ 2017-03-14  7:56 UTC (permalink / raw)
  To: Matthias Kaehlcke, Arnd Bergmann, Greg Kroah-Hartman
  Cc: linux-kernel, Grant Grundler, Andrew Morton

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 <mka@chromium.org>

Acked-by: Clemens Ladisch <clemens@ladisch.de>

> ---
>  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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned
  2017-03-14  7:56 ` Clemens Ladisch
@ 2017-03-23 21:47   ` Grant Grundler
  2017-03-24  6:54     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Grundler @ 2017-03-23 21:47 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Matthias Kaehlcke, Arnd Bergmann, Greg Kroah-Hartman, LKML,
	Grant Grundler, Andrew Morton

On Tue, Mar 14, 2017 at 12:56 AM, Clemens Ladisch <clemens@ladisch.de> wrote:
> 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 <mka@chromium.org>
>
> Acked-by: Clemens Ladisch <clemens@ladisch.de>

Any other feedback on this patch?
Or has this already been added to someone's "for-linus" branch?

just looking for update on patch status.

cheers,
grant

>
>> ---
>>  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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned
  2017-03-23 21:47   ` Grant Grundler
@ 2017-03-24  6:54     ` Greg Kroah-Hartman
  2017-03-24 18:17       ` Grant Grundler
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2017-03-24  6:54 UTC (permalink / raw)
  To: Grant Grundler
  Cc: Clemens Ladisch, Matthias Kaehlcke, Arnd Bergmann, LKML, Andrew Morton

On Thu, Mar 23, 2017 at 02:47:39PM -0700, Grant Grundler wrote:
> On Tue, Mar 14, 2017 at 12:56 AM, Clemens Ladisch <clemens@ladisch.de> wrote:
> > 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 <mka@chromium.org>
> >
> > Acked-by: Clemens Ladisch <clemens@ladisch.de>
> 
> Any other feedback on this patch?
> Or has this already been added to someone's "for-linus" branch?
> 
> just looking for update on patch status.

This is already in my -next branch, to go into 4.12-rc1.  Should it get
into 4.11-final instead?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned
  2017-03-24  6:54     ` Greg Kroah-Hartman
@ 2017-03-24 18:17       ` Grant Grundler
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Grundler @ 2017-03-24 18:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Grant Grundler, Clemens Ladisch, Matthias Kaehlcke,
	Arnd Bergmann, LKML, Andrew Morton

On Thu, Mar 23, 2017 at 11:54 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Thu, Mar 23, 2017 at 02:47:39PM -0700, Grant Grundler wrote:
>> On Tue, Mar 14, 2017 at 12:56 AM, Clemens Ladisch <clemens@ladisch.de> wrote:
>> > 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 <mka@chromium.org>
>> >
>> > Acked-by: Clemens Ladisch <clemens@ladisch.de>
>>
>> Any other feedback on this patch?
>> Or has this already been added to someone's "for-linus" branch?
>>
>> just looking for update on patch status.
>
> This is already in my -next branch, to go into 4.12-rc1.  Should it get
> into 4.11-final instead?

I would say "no" since 4.12-rc1 is good enough for me. Thanks! :)

cheers,
grant

>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-24 18:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 18:57 [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned Matthias Kaehlcke
2017-03-14  7:56 ` Clemens Ladisch
2017-03-23 21:47   ` Grant Grundler
2017-03-24  6:54     ` Greg Kroah-Hartman
2017-03-24 18:17       ` Grant Grundler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).