* [PATCH] usb: storage: fix capacity detection on 64 bit systems
@ 2019-04-17 10:18 Peter Mamonov
2019-04-17 19:11 ` Andrey Smirnov
0 siblings, 1 reply; 3+ messages in thread
From: Peter Mamonov @ 2019-04-17 10:18 UTC (permalink / raw)
To: s.hauer; +Cc: barebox, Peter Mamonov
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
---
drivers/usb/storage/usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 8218bb2a71..18f69f8478 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -316,7 +316,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev)
{
struct us_data *us = pblk_dev->us;
ccb us_ccb;
- unsigned long *pcap;
+ u32 *pcap;
int result = 0;
us_ccb.pdata = us_io_buf;
@@ -357,7 +357,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev)
result = -EIO;
goto Exit;
}
- pcap = (unsigned long *)us_ccb.pdata;
+ pcap = (u32 *)us_ccb.pdata;
US_DEBUGP("Read Capacity returns: 0x%lx, 0x%lx\n", pcap[0], pcap[1]);
pblk_dev->blk.num_blocks = usb_limit_blk_cnt(be32_to_cpu(pcap[0]) + 1);
if (be32_to_cpu(pcap[1]) != SECTOR_SIZE)
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: storage: fix capacity detection on 64 bit systems
2019-04-17 10:18 [PATCH] usb: storage: fix capacity detection on 64 bit systems Peter Mamonov
@ 2019-04-17 19:11 ` Andrey Smirnov
2019-04-18 9:12 ` Peter Mamonov
0 siblings, 1 reply; 3+ messages in thread
From: Andrey Smirnov @ 2019-04-17 19:11 UTC (permalink / raw)
To: Peter Mamonov; +Cc: Barebox List
On Wed, Apr 17, 2019 at 3:18 AM Peter Mamonov <pmamonov@gmail.com> wrote:
>
Peter:
This was fixed in
http://lists.infradead.org/pipermail/barebox/2019-March/037526.html.
Latest next should contain that patch.
Thanks,
Andrey Smirnov
> Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
> ---
> drivers/usb/storage/usb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> index 8218bb2a71..18f69f8478 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -316,7 +316,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev)
> {
> struct us_data *us = pblk_dev->us;
> ccb us_ccb;
> - unsigned long *pcap;
> + u32 *pcap;
> int result = 0;
>
> us_ccb.pdata = us_io_buf;
> @@ -357,7 +357,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev)
> result = -EIO;
> goto Exit;
> }
> - pcap = (unsigned long *)us_ccb.pdata;
> + pcap = (u32 *)us_ccb.pdata;
> US_DEBUGP("Read Capacity returns: 0x%lx, 0x%lx\n", pcap[0], pcap[1]);
> pblk_dev->blk.num_blocks = usb_limit_blk_cnt(be32_to_cpu(pcap[0]) + 1);
> if (be32_to_cpu(pcap[1]) != SECTOR_SIZE)
> --
> 2.20.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: storage: fix capacity detection on 64 bit systems
2019-04-17 19:11 ` Andrey Smirnov
@ 2019-04-18 9:12 ` Peter Mamonov
0 siblings, 0 replies; 3+ messages in thread
From: Peter Mamonov @ 2019-04-18 9:12 UTC (permalink / raw)
To: Andrey Smirnov; +Cc: Barebox List
Hi, Andrey,
On Wed, Apr 17, 2019 at 12:11:57PM -0700, Andrey Smirnov wrote:
> On Wed, Apr 17, 2019 at 3:18 AM Peter Mamonov <pmamonov@gmail.com> wrote:
> >
>
> Peter:
>
> This was fixed in
> http://lists.infradead.org/pipermail/barebox/2019-March/037526.html.
> Latest next should contain that patch.
Sorry, I missed this message as well as `%lx` in my patch :)
Thanks,
Peter
>
> Thanks,
> Andrey Smirnov
>
> > Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
> > ---
> > drivers/usb/storage/usb.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> > index 8218bb2a71..18f69f8478 100644
> > --- a/drivers/usb/storage/usb.c
> > +++ b/drivers/usb/storage/usb.c
> > @@ -316,7 +316,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev)
> > {
> > struct us_data *us = pblk_dev->us;
> > ccb us_ccb;
> > - unsigned long *pcap;
> > + u32 *pcap;
> > int result = 0;
> >
> > us_ccb.pdata = us_io_buf;
> > @@ -357,7 +357,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev)
> > result = -EIO;
> > goto Exit;
> > }
> > - pcap = (unsigned long *)us_ccb.pdata;
> > + pcap = (u32 *)us_ccb.pdata;
> > US_DEBUGP("Read Capacity returns: 0x%lx, 0x%lx\n", pcap[0], pcap[1]);
> > pblk_dev->blk.num_blocks = usb_limit_blk_cnt(be32_to_cpu(pcap[0]) + 1);
> > if (be32_to_cpu(pcap[1]) != SECTOR_SIZE)
> > --
> > 2.20.1
> >
> >
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-18 9:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 10:18 [PATCH] usb: storage: fix capacity detection on 64 bit systems Peter Mamonov
2019-04-17 19:11 ` Andrey Smirnov
2019-04-18 9:12 ` Peter Mamonov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox