From patchwork Sun Sep 5 19:00:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 63856 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 069ACB70EC for ; Mon, 6 Sep 2010 05:01:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754673Ab0IETAc (ORCPT ); Sun, 5 Sep 2010 15:00:32 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:35474 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754697Ab0IES7h (ORCPT ); Sun, 5 Sep 2010 14:59:37 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id AD9E819BDC5; Sun, 5 Sep 2010 20:59:36 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09076-02; Sun, 5 Sep 2010 20:59:35 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id 93D8619BDC8; Sun, 5 Sep 2010 20:59:32 +0200 (CEST) From: Julia Lawall To: Chas Williams Cc: kernel-janitors@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] drivers/atm/firestream.c: Fix unsigned return type Date: Sun, 5 Sep 2010 21:00:23 +0200 Message-Id: <1283713226-8429-6-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1283713226-8429-1-git-send-email-julia@diku.dk> References: <1283713226-8429-1-git-send-email-julia@diku.dk> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The function has an unsigned return type, but returns a negative constant to indicate an error condition. The result of calling the function is always stored in a variable of type (signed) int, and thus unsigned can be dropped from the return type. A sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @exists@ identifier f; constant C; @@ unsigned f(...) { <+... * return -C; ...+> } // Signed-off-by: Julia Lawall --- drivers/atm/firestream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 8717809..1af977e 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -444,8 +444,8 @@ static inline void fs_kfree_skb (struct sk_buff * skb) #define ROUND_NEAREST 3 /********** make rate (not quite as much fun as Horizon) **********/ -static unsigned int make_rate (unsigned int rate, int r, - u16 * bits, unsigned int * actual) +static int make_rate(unsigned int rate, int r, + u16 *bits, unsigned int *actual) { unsigned char exp = -1; /* hush gcc */ unsigned int man = -1; /* hush gcc */