lkml.org 
[lkml]   [2009]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] UBIFS: Fix integer overflow warnings
This warning was observed on MIPS32 using 2.6.31-rc1 and gcc-4.2.0:

fs/ubifs/io.c: In function 'ubifs_wbuf_init':
fs/ubifs/io.c:860: warning: integer overflow in expression
fs/ubifs/io.c:860: warning: integer overflow in expression
fs/ubifs/io.c:860: warning: integer overflow in expression

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
index bc58571..184157e 100644
--- a/fs/ubifs/io.c
+++ b/fs/ubifs/io.c
@@ -857,7 +857,8 @@ int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf)
* and hard limits.
*/
hardlimit = ktime_set(DEFAULT_WBUF_TIMEOUT_SECS, 0);
- wbuf->delta = (DEFAULT_WBUF_TIMEOUT_SECS * NSEC_PER_SEC) * 2 / 10;
+ wbuf->delta = ((unsigned long long)DEFAULT_WBUF_TIMEOUT_SECS *
+ NSEC_PER_SEC) * 2 / 10;
wbuf->softlimit = ktime_sub_ns(hardlimit, wbuf->delta);
hrtimer_set_expires_range_ns(&wbuf->timer, wbuf->softlimit,
wbuf->delta);
--

\
 
 \ /
  Last update: 2009-06-27 02:37    [W:0.043 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site