Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599692

[PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Matthias Kaehlcke <mka@chromium.org>
Newsgroups linux.kernel
Subject [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned
Date Mon, 13 Mar 2017 20:00:02 +0100
Message-ID <tkDmi-4GD-11@gated-at.bofh.it> (permalink)
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1CVGVJ7CV2D2bMky8du2m/h2atrVGb8XJKllby6Ah1w=; b=haEbrWe0KeXLtCfm2nuaedQ3FRzc3UQXff8UJBArThqC7OL//p3fKY61cVhTe5C03J M7HWeUQa6bV0CZ80/MhsufyYyL2rhRJBSS2b9SznYEqamKbrcjHpxWVbgOpj5G4Z1P2H n5uTttzV/6L5cBd4fw8pWtZGCH+rm9oJpUaS8pAkTmKmuqV8NBoDYURWFt4ISfbeRUZT el9l/Nt0y78yo0JkRVwoISngHs+e5IeoPaLi2oUMN9QczUbX1jFcLG7muxMqDquiDGQ6 yk11Xc8UhB0Nasj6CNnvgHfrS9l9fNStYioYtkhzSPhAyeOwcv8hRunypI01iXNSFnwD 7xnQ==
X-Gm-Message-State AMke39kqBh7M0myjalgR0PpCZDkdDpAWodmgeA46/DUyFFGgnOUHVg9+/S0bD7eSW1UBkCKJ
X-Received by 10.84.215.155 with SMTP id l27mr49914394pli.31.1489431488260; Mon, 13 Mar 2017 11:58:08 -0700 (PDT)
X-Mailer git-send-email 2.12.0.246.ga2ecc84866-goog
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 35
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Grant Grundler <grundler@chromium.org>, Matthias Kaehlcke <mka@chromium.org>
X-Original-Date Mon, 13 Mar 2017 11:57:25 -0700
X-Original-Message-ID <20170313185725.144873-1-mka@chromium.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1599692

Show key headers only | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned Matthias Kaehlcke <mka@chromium.org> - 2017-03-13 20:00 +0100
  Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common()  unsigned Clemens Ladisch <clemens@ladisch.de> - 2017-03-14 09:10 +0100
    Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned Grant Grundler <grundler@chromium.org> - 2017-03-23 22:50 +0100
      Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common()  unsigned Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 08:00 +0100
        Re: [PATCH v1] hpet: Make cmd parameter of hpet_ioctl_common() unsigned Grant Grundler <grundler@chromium.org> - 2017-03-24 19:20 +0100

csiph-web