From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 71239308F16; Fri, 22 Aug 2025 14:34:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755873284; cv=none; b=tFJ3t5hRBmJXuWkPNAvvzIB4Hp08rEx9aYQS9CSHeMwgRg+Ww1a7R4bZtyRKmZi8U1KhLHiHpWDF3feoOnuW1qa1sgLY6cORKL6g6E7VWKyrDiJBZYcthG4x6BRDE6iEll3VjfvSLGpshN9REnWFxmM+lTYtgSELFGEx/f8qbKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755873284; c=relaxed/simple; bh=VII7U6zoNNMy6Odpt6FG1UI25vengIXA2fltFhm+W7Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A0i+WwGJuV0MSPEsNC/Hq5OZkApinVbUa00QkK7rmoLT7FY1Vh8wjVRFHzvaxtYVGwBgpLt95z8PNCzRzcabtYMXjg56KwluAsw+M17PdEboIhxt7MHIISeAPCVQShG0+lHnHBO6tt6x+qV0dAdZ0r28rQEHUnS9BYO4fNrFo5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=ouDdew2s; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="ouDdew2s" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=ogSGEAU2urSqL2qER3Zt/zAjp+FjNQ7ySdicQ6sxfPM=; b=ouDdew2scoE5UdbmgR+qZ6fyUY ixVCBd5kSQvJG2mCWuXRTFp+I/74SXkF0H7ZcKef+NiMw7BMrk7UeFBNoJwyL6M+EMIVVNV5Xohh8 Bp/H+DUd8b5kGHuR0ljOFinlLEPzfAsuf7l6eZVz7YB1qALzU/l5O1IXgTdJn+IRg3DE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1upSq2-005aXb-Dt; Fri, 22 Aug 2025 16:33:54 +0200 Date: Fri, 22 Aug 2025 16:33:54 +0200 From: Andrew Lunn To: Yibo Dong Cc: Parthiban.Veerasooran@microchip.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, corbet@lwn.net, gur.stavi@huawei.com, maddy@linux.ibm.com, mpe@ellerman.id.au, danishanwar@ti.com, lee@trager.us, gongfan1@huawei.com, lorenzo@kernel.org, geert+renesas@glider.be, lukas.bulwahn@redhat.com, alexanderduyck@fb.com, richardcochran@gmail.com, kees@kernel.org, gustavoars@kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH net-next v7 4/5] net: rnpgbe: Add basic mbx_fw support Message-ID: References: <20250822023453.1910972-1-dong100@mucse.com> <20250822023453.1910972-5-dong100@mucse.com> <9fc58eb7-e3d8-4593-9d62-82ec40d4c7d2@microchip.com> <7D780BA46B65623F+20250822053740.GC1931582@nic-Precision-5820-Tower> <8fc334ac-cef8-447b-8a5b-9aa899e0d457@microchip.com> 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: > /* Initialized as a defensive measure to handle edge cases > * where try_cnt might be modified > */ > int err = -EIO; We don't use defensive code in the kernel. Defensive code suggests you don't actually know what your driver is doing and you are guessing this might happen. You should convince yourself it is possible/impossible and write the code as needed. Andrew