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 5BDC9156237; Fri, 16 Jan 2026 11:47:58 +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=1768564079; cv=none; b=rLj0rCYtCSOu7EXcriEFQ2xTzXAFoo+23XIg0fOQn2HcaHWy2Pb6dipARcLTzjplTdcT5vd9H+7gmbwUGZDnJJOshkg3JpoLj+wu8xw5uz4cW264OmMsVN93kE9UaDcStQlV28W0/1SzA9eeOr6+6+2li3h6fbQ1m3l70dg6EPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768564079; c=relaxed/simple; bh=G61GHChez095a2ya1qSTH70HGFtX2GymqxpfbzIqmaE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EQg6wL+agEhwy1dbz0UvMi3qnME6KlckiB1xUCTo2XxIXkSqONKUrf8dZs94VQUWr1aIsGV11DzFWfFQOxy98/E5d9buaWRWsB/zFBVLZEZN5D4I+x6Zd/3sV/EqIWX/enD5lAG8+nxOd16ZoWDhyeN3zd9oeavAJGtj0X26kLY= 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.99) (envelope-from ) id 1vgiIr-000000001gp-13U9; Fri, 16 Jan 2026 11:47:45 +0000 Date: Fri, 16 Jan 2026 11:47:42 +0000 From: Daniel Golle To: Jakub Kicinski Cc: Hauke Mehrtens , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Minqiang , Xinfa Deng Subject: Re: [PATCH net-next v3 3/6] net: dsa: lantiq: allow arbitrary MII registers Message-ID: References: <20260115191108.1a7eac9f@kernel.org> Precedence: bulk X-Mailing-List: netdev@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: <20260115191108.1a7eac9f@kernel.org> On Thu, Jan 15, 2026 at 07:11:08PM -0800, Jakub Kicinski wrote: > On Fri, 16 Jan 2026 00:07:37 +0000 Daniel Golle wrote: > > +__diag_push(); > > +__diag_ignore_all("-Woverride-init", > > + "logic to initialize all and then override some is OK"); > > This seems quite unjustified to save at a glance 4 lines of code. So I'll spell it out instead. I kinda like the notion of default initializers, it's much more obviously correct and impossible to accidentally leave anything uninitialized (or rather wrongly initialized with 0). In lantiq_gswip.c it would look like this then: .mii_cfg = { [0] = GSWIP_MII_CFGp(0), [1] = GSWIP_MII_CFGp(1), [2 ... 4] = -1, [5] = GSWIP_MII_CFGp(5), [6] = -1, }, .mii_pcdu = { [0] = GSWIP_MII_PCDU0, [1] = GSWIP_MII_PCDU1, [2 ... 4] = -1, [5] = GSWIP_MII_PCDU5, [6] = -1, }, ... .mii_cfg = { [0] = GSWIP_MII_CFGp(0), [1 ... 4] = -1, [5] = GSWIP_MII_CFGp(5), [6] = -1, }, .mii_pcdu = { [0] = GSWIP_MII_PCDU0, [1 ... 4] = -1, [5] = GSWIP_MII_PCDU5, [6] = -1, },