* [PATCH] UBI: Fix 64-bit calculations
@ 2008-07-03 4:55 Bruce_Leonard
2008-07-03 6:07 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Bruce_Leonard @ 2008-07-03 4:55 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
Artem,
I found another place where promotion was clobbering the 64-bit result.
I'm attaching it rather than sending it inline because my mailer evidently
has a problem with line wraps that I haven't figured out how to fix.
Hopefully it comes through okay. My apologies to the list.
Bruce
[-- Attachment #2: cdev.c patch --]
[-- Type: application/octet-stream, Size: 649 bytes --]
Signed-off-by: Bruce Leonard <brucle@selinc.com>
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 34175ec..88f1b6f 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -432,7 +432,7 @@ static int vol_cdev_ioctl(struct inode *inode, struct file *file,
break;
}
- rsvd_bytes = vol->reserved_pebs * (ubi->leb_size-vol->data_pad);
+ rsvd_bytes = (long long)vol->reserved_pebs * (ubi->leb_size-vol->data_pad);
if (bytes < 0 || bytes > rsvd_bytes) {
err = -EINVAL;
break;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] UBI: Fix 64-bit calculations
2008-07-03 4:55 [PATCH] UBI: Fix 64-bit calculations Bruce_Leonard
@ 2008-07-03 6:07 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2008-07-03 6:07 UTC (permalink / raw)
To: Bruce_Leonard; +Cc: linux-mtd
On Wed, 2008-07-02 at 21:55 -0700, Bruce_Leonard@selinc.com wrote:
> Artem,
>
> I found another place where promotion was clobbering the 64-bit result.
> I'm attaching it rather than sending it inline because my mailer evidently
>
> has a problem with line wraps that I haven't figured out how to fix.
> Hopefully it comes through okay. My apologies to the list.
Thanks for the patch - applied and pushed
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-03 6:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03 4:55 [PATCH] UBI: Fix 64-bit calculations Bruce_Leonard
2008-07-03 6:07 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox