From patchwork Mon Oct 22 18:45:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joachim Eastwood X-Patchwork-Id: 1627541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 6E216DFB79 for ; Mon, 22 Oct 2012 18:49:44 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQN2F-0008HN-3X; Mon, 22 Oct 2012 18:47:35 +0000 Received: from mail-lb0-f177.google.com ([209.85.217.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TQN1z-0008DM-EY for linux-arm-kernel@lists.infradead.org; Mon, 22 Oct 2012 18:47:20 +0000 Received: by mail-lb0-f177.google.com with SMTP id gi11so1800157lbb.36 for ; Mon, 22 Oct 2012 11:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=ltLfODa/ooodo/7NSnhxPuohNCA4QLCsJAizGwcuoNA=; b=zEXl7tIKa3JXizzk6QxCwEbqVPl4Fp+0AfuNJt9jodKTKb9tJolIzLvbHjccBsFXC6 dkcjD+fvBhYqKk6D3JLxahoexpQs/4ef5o1PwH+pQOW0eTGI7bn7k2jOd1UEv5IulcXI m2Vf+oTVotXct0vUnt53b1kNBbNkLNgdY5z+K3UrGVWYRF/X9NGz/+ZQX7qesUrtvMc1 jNnT20vSAwCQVzjwu/QpQL9cbXQuAxnp9q7NxKxY7pPJgSWXQZ0zf4mSSOfrmTq2/boZ S1oYF2dtuesWydUVZPWgCR+f92SyudGL/4nI/2u1HEQ9hyHPiCmZ7UGVtGvpa9ZY3w2+ /zOg== Received: by 10.152.106.237 with SMTP id gx13mr8925065lab.46.1350931637121; Mon, 22 Oct 2012 11:47:17 -0700 (PDT) Received: from localhost.localdomain ([90.149.223.57]) by mx.google.com with ESMTPS id x5sm3364466lbf.9.2012.10.22.11.47.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Oct 2012 11:47:16 -0700 (PDT) From: Joachim Eastwood To: nicolas.ferre@atmel.com, davem@davemloft.net, hskinnemoen@gmail.com, egtvedt@samfundet.no, plagnioj@jcrosoft.com, bgat@billgatliff.com Subject: [PATCH v3 1/4] net/macb: fix truncate warnings Date: Mon, 22 Oct 2012 20:45:31 +0200 Message-Id: <1350931534-8416-2-git-send-email-manabian@gmail.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1350931534-8416-1-git-send-email-manabian@gmail.com> References: <1350931534-8416-1-git-send-email-manabian@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (manabian[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: netdev@vger.kernel.org, Joachim Eastwood , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When building macb on x86_64 the following warnings show up: drivers/net/ethernet/cadence/macb.c: In function macb_interrupt: drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c: In function macb_reset_hw: drivers/net/ethernet/cadence/macb.c:792:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c:793:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c:796:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] Use -1 insted of ~0UL, as done in other places in the driver, to silence these warnings. Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 6c84a11..6a4f499 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -553,7 +553,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) while (status) { /* close possible race with dev_close */ if (unlikely(!netif_running(dev))) { - macb_writel(bp, IDR, ~0UL); + macb_writel(bp, IDR, -1); break; } @@ -789,11 +789,11 @@ static void macb_reset_hw(struct macb *bp) macb_writel(bp, NCR, MACB_BIT(CLRSTAT)); /* Clear all status flags */ - macb_writel(bp, TSR, ~0UL); - macb_writel(bp, RSR, ~0UL); + macb_writel(bp, TSR, -1); + macb_writel(bp, RSR, -1); /* Disable all interrupts */ - macb_writel(bp, IDR, ~0UL); + macb_writel(bp, IDR, -1); macb_readl(bp, ISR); }