From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1DFFC54E8D for ; Mon, 11 May 2020 16:39:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 977A020714 for ; Mon, 11 May 2020 16:39:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FOM1p5id"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="kRR8fAIc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 977A020714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q/ScnaKQVhFKCe+ON12SrzLdc94S6oDDfild2x08LZM=; b=FOM1p5idEUq5zY ttAUiLD0HRcYyki9mkUa7k7peQ1TP7JdcVThRoPjrh1glhEiApW4zZWwC8HuNo5MnHzXBDQ4LIAiY hdKg9SBg8CZl32bLAh9mDzziE30PKXnshhZZVSojno47h+A4cW9vmzgSck3EU1l+mlceQi/Uxt8Sj aemEF766KvCeeg2z+y34bnuLtlCguA7ky+ffQGWh3Uw325daq3WyYGbgWCeWcqHmpreucAkSPiJgB ZwU9O5YQ29/bX+A9I/zP95pJ45kf9ycwyOg0GSpumsJkYtLyByygNkOUI+kqZdSKhUVdyrZpQx1If T9gMeQpSC0YNm+q4+v5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYBSh-0001co-7r; Mon, 11 May 2020 16:39:27 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYBSX-0001T1-Rw; Mon, 11 May 2020 16:39:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PO2c3L65UWqL1EcOkY6DtrTcnu4QOhrD4mFFAvp9mOQ=; b=kRR8fAIckpSJoyBIVZvk5Ch9q/ 8NsxPE3cQU+6IoWGenHjd+iDoF4PopnCIiln9GsylXeZN+Gmg4aLn2Gh/1wGK/q2s53Oi1jc9iamT 2W8dv+rlBtfIaLOlx01u831Bev6nPjrTpk8VeQZez+6vCAEUVxnsA+6FTKo0EkYG12fU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jYBSM-001sLM-JX; Mon, 11 May 2020 18:39:06 +0200 Date: Mon, 11 May 2020 18:39:06 +0200 From: Andrew Lunn To: Bartosz Golaszewski Subject: Re: [PATCH v2 05/14] net: core: provide priv_to_netdev() Message-ID: <20200511163906.GD413878@lunn.ch> References: <20200511150759.18766-1-brgl@bgdev.pl> <20200511150759.18766-6-brgl@bgdev.pl> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200511150759.18766-6-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200511_093918_802187_E13702EB X-CRM114-Status: UNSURE ( 9.02 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Edwin Peer , devicetree@vger.kernel.org, Stephane Le Provost , Arnd Bergmann , Bartosz Golaszewski , netdev@vger.kernel.org, Sean Wang , linux-kernel@vger.kernel.org, Pedro Tsai , "David S . Miller" , Fabien Parent , Rob Herring , linux-mediatek@lists.infradead.org, Andrew Perepech , John Crispin , Matthias Brugger , Jakub Kicinski , Mark Lee , linux-arm-kernel@lists.infradead.org, Heiner Kallweit Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, May 11, 2020 at 05:07:50PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Appropriate amount of extra memory for private data is allocated at > the end of struct net_device. We have a helper - netdev_priv() - that > returns its address but we don't have the reverse: a function which > given the address of the private data, returns the address of struct > net_device. > > This has caused many drivers to store the pointer to net_device in > the private data structure, which basically means storing the pointer > to a structure in this very structure. To some extent, that is the way it is done now. To do anything else just makes your driver different and so harder to maintain. Is 4/8 bytes for a pointer really worth being different? Andrew _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek