Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759866AbYFWVMq (ORCPT ); Mon, 23 Jun 2008 17:12:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755942AbYFWVMg (ORCPT ); Mon, 23 Jun 2008 17:12:36 -0400 Received: from mgw1.diku.dk ([130.225.96.91]:42817 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754395AbYFWVMf (ORCPT ); Mon, 23 Jun 2008 17:12:35 -0400 Date: Mon, 23 Jun 2008 23:12:31 +0200 (CEST) From: Julia Lawall To: florian.fainelli@telecomint.eu, jgarzik@pobox.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drivers/net/r6040.c: Eliminate double sizeof Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1033 Lines: 38 From: Julia Lawall Taking sizeof the result of sizeof is quite strange and does not seem to be what is wanted here. This was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // @@ expression E; @@ - sizeof ( sizeof (E) - ) // Signed-off-by: Julia Lawall --- diff -u -p a/drivers/net/r6040.c b/drivers/net/r6040.c --- a/drivers/net/r6040.c 2008-06-17 19:46:52.000000000 +0200 +++ b/drivers/net/r6040.c 2008-06-23 22:55:11.000000000 +0200 @@ -273,7 +273,7 @@ static void r6040_init_ring_desc(struct dma_addr_t mapping = desc_dma; while (size-- > 0) { - mapping += sizeof(sizeof(*desc)); + mapping += sizeof(*desc); desc->ndesc = cpu_to_le32(mapping); desc->vndescp = desc + 1; desc++; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/