Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753678AbbERQEl (ORCPT ); Mon, 18 May 2015 12:04:41 -0400 Received: from s159.web-hosting.com ([68.65.121.203]:39589 "EHLO s159.web-hosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932450AbbERQE2 (ORCPT ); Mon, 18 May 2015 12:04:28 -0400 MIME-Version: 1.0 In-Reply-To: <20150518143844.GK14154@mwanda> References: <1431958626-4345-1-git-send-email-jteki@openedev.com> <20150518143844.GK14154@mwanda> Date: Mon, 18 May 2015 21:34:19 +0530 Message-ID: Subject: Re: [PATCH v2] staging: rtl8712: Use ether_addr_copy() instead of memcpy() From: Jagan Teki To: Dan Carpenter Cc: devel@driverdev.osuosl.org, Florian Schilhabel , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Larry Finger Content-Type: text/plain; charset=UTF-8 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server159.web-hosting.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - openedev.com X-Get-Message-Sender-Via: server159.web-hosting.com: authenticated_id: jteki@openedev.com X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2079 Lines: 51 On 18 May 2015 at 20:08, Dan Carpenter wrote: > On Mon, May 18, 2015 at 07:47:06PM +0530, Jagan Teki wrote: >> struct eeprom_priv { >> u8 bautoload_fail_flag; /* 0 1 */ >> u8 bempty; /* 1 1 */ >> u8 sys_config; /* 2 1 */ >> u8 mac_addr[6]; /* 3 6 */ >> ...... >> }; > > This means it's not aligned as we want. Why size upto mac_addr is 9 and is not divisible by 2 is it? or the mac_addr size is 6 which is divisible by 2 (__align(2)) this is full pahole: struct eeprom_priv { u8 bautoload_fail_flag; /* 0 1 */ u8 bempty; /* 1 1 */ u8 sys_config; /* 2 1 */ u8 mac_addr[6]; /* 3 6 */ u8 config0; /* 9 1 */ u16 channel_plan; /* 10 2 */ u8 country_string[3]; /* 12 3 */ u8 tx_power_b[15]; /* 15 15 */ u8 tx_power_g[15]; /* 30 15 */ u8 tx_power_a[201]; /* 45 201 */ /* --- cacheline 3 boundary (192 bytes) was 54 bytes ago --- */ u8 efuse_eeprom_data[256]; /* 246 256 */ /* XXX 2 bytes hole, try to pack */ /* --- cacheline 7 boundary (448 bytes) was 56 bytes ago --- */ enum RT_CUSTOMER_ID CustomerID; /* 504 4 */ /* size: 508, cachelines: 8, members: 12 */ /* sum members: 506, holes: 1, sum holes: 2 */ /* last cacheline: 60 bytes */ }; thanks! -- Jagan Teki, Openedev. -- 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/