From patchwork Wed Jan 20 02:08:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 43258 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 8A31EB7CBB for ; Wed, 20 Jan 2010 13:04:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755873Ab0ATCDg (ORCPT ); Tue, 19 Jan 2010 21:03:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755625Ab0ATCDf (ORCPT ); Tue, 19 Jan 2010 21:03:35 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:57204 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755505Ab0ATCDd (ORCPT ); Tue, 19 Jan 2010 21:03:33 -0500 Received: by ewy19 with SMTP id 19so534726ewy.21 for ; Tue, 19 Jan 2010 18:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=t5pEjQK8UtvQPkTkjWPIdPKK2FZPO41KHVYH29+yeg8=; b=fg7ljS1QxntjqYZA+RIZx39Dg8EkwVgTQC7+PhZ5fCGRTuMiEJWVWTruD93R5RPcyp DxDCR0UnMvDMCGxUyRPGHT7/wxQn0JO1hOXbcK1/3y+XE2OBlyag/b+EhgSGKRZZKPi9 zanBE69Po4NyaokKMeus0ploM3jyH66kACv8I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=QoX3nD/6RhYcoiHP/9Nzghm5B8wnp1VjxQQ3LtbklDr3TYEgGdZAivxeWHJw27jv0U Y+72YyX/oLNAqn4zCzzxfpEJy4vESnIuhetGCoafb2l91YM6OSZoZlJXTfNOcy4Aip0x WRP4ZAFuk7QglfWWXVCCjG8/UlFqJaXF0tG/k= Received: by 10.213.96.206 with SMTP id i14mr8180673ebn.74.1263953012350; Tue, 19 Jan 2010 18:03:32 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 28sm9284728eyg.4.2010.01.19.18.03.31 (version=SSLv3 cipher=RC4-MD5); Tue, 19 Jan 2010 18:03:31 -0800 (PST) Message-ID: <4B56659E.3040001@gmail.com> Date: Wed, 20 Jan 2010 03:08:30 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0 MIME-Version: 1.0 To: Solarflare linux maintainers , Steve Hodgson , Ben Hutchings , netdev@vger.kernel.org, Andrew Morton , LKML , "David S. Miller" Subject: [PATCH] sfc: EFX_ETHTOOL_STAT calculates the offset of the efx##source_name's field in both cases Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org EFX_ETHTOOL_STAT calculated the offset of the efx##source_name's field Regardless of whether that field was NULL. Signed-off-by: Roel Kluin --- This looks like a bug, but I am not sure whether I understood this correctly, nor was it tested, was this intended? -- 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/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 6c0bbed..722bac7 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c @@ -41,7 +41,7 @@ struct efx_ethtool_stat { .source = EFX_ETHTOOL_STAT_SOURCE_##source_name, \ .offset = ((((field_type *) 0) == \ &((struct efx_##source_name *)0)->field) ? \ - offsetof(struct efx_##source_name, field) : \ + offsetof(struct efx_##stat_name, field) : \ offsetof(struct efx_##source_name, field)), \ .get_stat = get_stat_function, \ }