From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 723F8645; Sun, 17 Aug 2025 20:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755463621; cv=none; b=b/jRzBIXs6UKSgYE2kNHDzQMx7cRGO5iAP2p0PRTfC+579Re3YiE9aLwKetNo5ujCY2Iuzlc7okODAlU3RWGH+xFtI7tSnNWpJfutKhuHgr8vipzJZEIRq54thv9KxdhQYnHHJnUwd7KYVXod2dmulXJwZv75NoLFaVmc1o2R2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755463621; c=relaxed/simple; bh=YPQ/WdibnbtkqiA1eF5o0bftUaTo4lS7AKzt4psd3sY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lkARLAOYM0WnhyRTeVqWNjglk54MKHCQUD2oEqZYun8QSgqvHEGjq0yUXKmJbr4KJwVVrexG2zFY8jBQXgxxskJhziUEr8w7fGAUCD+CxDKX99eZrECOpSm1FCAz/upLasG4rUvRp83UdPCVpe84iMQ6CWJiFoiGFSURLMsufW8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.98.2) (envelope-from ) id 1unkHD-000000001zg-3WzH; Sun, 17 Aug 2025 20:46:51 +0000 Date: Sun, 17 Aug 2025 21:46:47 +0100 From: Daniel Golle To: Andrew Lunn Cc: Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hauke Mehrtens , Simon Horman , Russell King , Florian Fainelli , Arkadi Sharshevsky , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Andreas Schirm , Lukas Stockmann , Alexander Sverdlin , Peter Christen , Avinash Jayaraman , Bing tao Xu , Liang Xu , Juraj Povazanec , "Fanni (Fang-Yi) Chan" , "Benny (Ying-Tsan) Weng" , "Livia M. Rosu" , John Crispin Subject: Re: [PATCH RFC net-next 06/23] net: dsa: lantiq_gswip: load model-specific microcode Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Aug 17, 2025 at 05:29:16PM +0200, Andrew Lunn wrote: > > > > +struct gswip_pce_microcode { > > + u16 val_3; > > + u16 val_2; > > + u16 val_1; > > + u16 val_0; > > +}; > > + > > I would leave this where it is, and just have > > struct gswip_pce_microcode; > > Since only a pointer is needed, the compiler does not need the full > type info, at this point. > > The structure itself is rather opaque, and only makes some sort of > sense when next to the MAC_ENTRY macro. The structure is also used in the function gswip_pce_load_microcode(). Now, if we keep defining the struct fields along with the microcode this will become a problem once there is more than one such set of microcode instructions and additional header files for them. Each of them would need to define struct gswip_pce_microcode with its fields. The lantiq_pce.h header then becomes private to the driver for the in-SoC switches, while gswip_pce_load_microcode() would be part of the shared/common module use by both, in-SoC/MMIO switches as well as (newer) MDIO-connected ones, and I would not want to include any of the *_pce.h headers in the shared/common module. Obviously I can just move the struct definition in the later commit which actually separates the MMIO-specific parts of the driver and the common/shared parts into different modules. Is it that what you had in mind?