From: Michael Walle Date: Tue, 23 Feb 2021 17:46:06 +0100 Subject: [RFC PATCH 1/2] net: dsa: return early if there is no master In-Reply-To: <20210223163251.ncufz5qlcxlndojv@skbuf> References: <20210223161906.9177-1-michael@walle.cc> <20210223161906.9177-2-michael@walle.cc> <20210223163251.ncufz5qlcxlndojv@skbuf> Message-ID: <62b469be489c8ce6f6dfb0bd477c8a50@walle.cc> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 2021-02-23 17:32, schrieb Vladimir Oltean: > On Tue, Feb 23, 2021 at 05:19:05PM +0100, Michael Walle wrote: >> It doesn't make sense to have DSA without a master port. Error out >> early >> if there is no master port. >> >> Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches") >> Signed-off-by: Michael Walle >> --- > > Reviewed-by: Vladimir Oltean > > I think you can also be more aggressive and remove the checks: > > if (!master) > return -EINVAL; > > from dsa_port_send and dsa_port_recv. At least it sounds broken to me > that this could ever happen. Yep, I've seen these, too. I'll send a non-RFC version and remove these. -michael