mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Dietsche <Gregory.Dietsche@cuw.edu>
To: gregkh@suse.de
Cc: mfuzzey@gmail.com, tom.leiming@gmail.com, ak@linux.intel.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Dietsche <Gregory.Dietsche@cuw.edu>
Subject: [PATCH] usb: fix warning in usbtest module v2
Date: Sun,  8 May 2011 22:51:43 -0500	[thread overview]
Message-ID: <1304913103-3086-1-git-send-email-Gregory.Dietsche@cuw.edu> (raw)
In-Reply-To: <20110508225847.GA12750@suse.de>

On amd64 unsigned is not as wide as pointer and this causes a compiler 
warning. Switching to unsigned long corrects the problem.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
---
 drivers/usb/misc/usbtest.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 388cc12..a5b505a 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -268,9 +268,9 @@ static inline void simple_fill_buf(struct urb *urb)
 	}
 }
 
-static inline unsigned buffer_offset(void *buf)
+static inline unsigned long buffer_offset(void *buf)
 {
-	return (unsigned)buf & (ARCH_KMALLOC_MINALIGN - 1);
+	return (unsigned long)buf & (ARCH_KMALLOC_MINALIGN - 1);
 }
 
 static int check_guard_bytes(struct usbtest_dev *tdev, struct urb *urb)
@@ -329,7 +329,7 @@ static int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb)
 
 static void simple_free_urb(struct urb *urb)
 {
-	unsigned offset = buffer_offset(urb->transfer_buffer);
+	unsigned long offset = buffer_offset(urb->transfer_buffer);
 
 	if (urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)
 		usb_free_coherent(
-- 
1.7.2.5


  reply	other threads:[~2011-05-09  3:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-08  3:27 [PATCH] usb: fix warning in usbtest module Greg Dietsche
2011-05-08 14:37 ` Alan Stern
2011-05-08 19:12   ` Greg Dietsche
2011-05-08 22:58     ` Greg KH
2011-05-09  3:51       ` Greg Dietsche [this message]
2011-05-09  4:02       ` Greg Dietsche

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=1304913103-3086-1-git-send-email-Gregory.Dietsche@cuw.edu \
    --to=gregory.dietsche@cuw.edu \
    --cc=ak@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mfuzzey@gmail.com \
    --cc=tom.leiming@gmail.com \
    /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

all inboxes | Powered by JetHome®