From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751427AbcLESGs (ORCPT ); Mon, 5 Dec 2016 13:06:48 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:34180 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbcLESGq (ORCPT ); Mon, 5 Dec 2016 13:06:46 -0500 Subject: Re: [patch net v3] net: fec: fix compile with CONFIG_M5272 To: Vitaly Wool References: <1480959661-29834-1-git-send-email-nikita.yoush@cogentembedded.com> Cc: Johannes Berg , Troy Kisky , linux-kernel@vger.kernel.org, Chris Healy , "David S. Miller" , Fugang Duan , Eric Nelson , Andrew Lunn , Fabio Estevam , netdev@vger.kernel.org, Philippe Reynes From: Nikita Yushchenko Message-ID: Date: Mon, 5 Dec 2016 21:06:41 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +#define FEC_STATS_SIZE (ARRAY_SIZE(fec_stats) * sizeof(u64)) > > > Do I take it right this actually translates to (sizeof(fec_stats) / > sizeof(u64) * sizeof(u64))? No. fec_stats is an array of structs, each struct has car arrsy and integer, and size of that is definitely not bytes. ARRAY_SIZE(fec_stats) is number of stats, i.e. it is returned from fec_enet_get_sset_count() Each stat in blob is u64. Thus (ARRAY_SIZE(fec_stats) * sizeof(u64)) is size of stats blob.