From: Arnd Bergmann <arnd@arndb.de>
To: gregkh@linuxfoundation.org
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] intel_th: fix compile warning
Date: Wed, 07 Oct 2015 11:25:47 +0200 [thread overview]
Message-ID: <4973464.lbBncgkGPs@wuerfel> (raw)
The newly added MSU portion of the intel_th driver causes a harmless
compile warning on 32-bit kernels:
drivers/hwtracing/intel_th/msu.c: In function 'msc_single_to_user':
include/linux/kernel.h:724:17: warning: comparison of distinct pointer types lacks a cast
This changes the code to use min_t() to force the correct type and
avoid that warning, which seems easier than changing the code to
use consistent types everywhere.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 99f7662e27f1..4c6688a64db3 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -1062,7 +1062,7 @@ msc_single_to_user(struct msc *msc, char __user *buf, loff_t off, size_t len)
if (msc->single_wrap) {
start += msc->single_sz;
if (start < size) {
- tocopy = min(rem, size - start);
+ tocopy = min_t(size_t, rem, size - start);
if (copy_to_user(buf, msc->base + start, tocopy))
return -EFAULT;
@@ -1073,7 +1073,7 @@ msc_single_to_user(struct msc *msc, char __user *buf, loff_t off, size_t len)
start &= size - 1;
if (rem) {
- tocopy = min(rem, msc->single_sz - start);
+ tocopy = min_t(size_t, rem, msc->single_sz - start);
if (copy_to_user(buf, msc->base + start, tocopy))
return -EFAULT;
next reply other threads:[~2015-10-07 9:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 9:25 Arnd Bergmann [this message]
2015-10-07 9:44 ` [PATCH] intel_th: fix compile warning Alexander Shishkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4973464.lbBncgkGPs@wuerfel \
--to=arnd@arndb.de \
--cc=alexander.shishkin@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox