linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Shaohui Xie <Shaohui.Xie@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: linux-usb@vger.kernel.org, Shaohui Xie <Shaohui.Xie@freescale.com>
Subject: [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
Date: Thu, 3 Nov 2011 17:58:22 +0800	[thread overview]
Message-ID: <1320314302-7973-1-git-send-email-Shaohui.Xie@freescale.com> (raw)

Below are codes for accessing usb sysif_regs in driver:

usb_sys_regs = (struct usb_sys_interface *)
	((u32)dr_regs + USB_DR_SYS_OFFSET);

these codes work in 32-bit, but in 64-bit, use u32 to type cast the address
of ioremap is not right, and accessing members of 'usb_sys_regs' will cause
call trace, so use unsigned long for both 32-bit and 64-bit.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 drivers/usb/gadget/fsl_udc_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index c81fbad..581b7cc 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2498,7 +2498,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
 #ifndef CONFIG_ARCH_MXC
 	if (pdata->have_sysif_regs)
 		usb_sys_regs = (struct usb_sys_interface *)
-				((u32)dr_regs + USB_DR_SYS_OFFSET);
+				((unsigned long)dr_regs + USB_DR_SYS_OFFSET);
 #endif
 
 	/* Initialize USB clocks */
-- 
1.6.4

             reply	other threads:[~2011-11-03 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03  9:58 Shaohui Xie [this message]
2011-11-03 11:14 ` [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap David Laight
2011-11-03 11:38 ` Tabi Timur-B04825
2011-11-03 11:38   ` David Laight
2011-11-03 12:07     ` Tabi Timur-B04825
2011-11-03 12:16       ` David Laight
2011-11-03 14:12         ` Timur Tabi
2011-11-03 22:08         ` Segher Boessenkool

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=1320314302-7973-1-git-send-email-Shaohui.Xie@freescale.com \
    --to=shaohui.xie@freescale.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).