From patchwork Sat Jun 27 00:10:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Cernekee X-Patchwork-Id: 29219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4251FB7090 for ; Sat, 27 Jun 2009 10:38:43 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MKLt5-0006l0-Lf; Sat, 27 Jun 2009 00:35:23 +0000 Received: from [65.98.92.6] (helo=b32.net) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1MKLsw-0006kd-07 for linux-mtd@lists.infradead.org; Sat, 27 Jun 2009 00:35:21 +0000 Received: (qmail 19375 invoked from network); 27 Jun 2009 00:35:10 -0000 Received: from unknown (HELO two) (127.0.0.1) by 127.0.0.1 with SMTP; 27 Jun 2009 00:35:10 -0000 Received: by two (sSMTP sendmail emulation); Fri, 26 Jun 2009 17:35:10 -0700 From: Kevin Cernekee To: , Date: Fri, 26 Jun 2009 17:10:50 -0700 Subject: [PATCH] UBIFS: Fix integer overflow warnings Message-Id: <3f15c0091535d0ab4a1d45cbc9eb3667@localhost> X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.1 RDNS_NONE Delivered to trusted network by a host with no rDNS Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 --- 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);