This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Fri Apr 26 05:14:13 2024 >From mailfetcher Sun Jan 2 17:44:18 2022 Envelope-to: lkml@grols.ch Delivery-date: Sun, 02 Jan 2022 17:43:55 +0100 Received: from stout.grols.ch [195.201.141.146] by 72459556e3a9 with IMAP (fetchmail-6.3.26) for (single-drop); Sun, 02 Jan 2022 17:44:17 +0100 (CET) Received: from vger.kernel.org ([23.128.96.18]) by stout.grols.ch with esmtp (Exim 4.92) (envelope-from ) id 1n43xb-0001UX-FA for lkml@grols.ch; Sun, 02 Jan 2022 17:43:55 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230284AbiABQnl (ORCPT ); Sun, 2 Jan 2022 11:43:41 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:47316 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiABQnk (ORCPT ); Sun, 2 Jan 2022 11:43:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subjec Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1n43xE-000JsH-6L; Sun, 02 Jan 2022 17:43:32 +0100 Date: Sun, 2 Jan 2022 17:43:32 +0100 From: Andrew Lunn To: Daniel Golle Cc: linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Fietkau , John Crispin , Sean Wang , Subject: Re: [PATCH v10 1/3] net: ethernet: mtk_eth_soc: fix return value and refactor MDIO ops Message-Id: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Precedence: bulk List-Id: X-Mailing-List: linux-kernel@vger.kernel.org Received-SPF: pass client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org X-Spam-Score: -1.9 X-Spam-Score-Bar: - X-Spam-Action: no action X-Spam-Report: Action: no action Symbol: TO_DN_SOME(0.00) Symbol: R_SPF_ALLOW(-0.20) Symbol: DWL_DNSWL_FAIL(0.00) Symbol: RCVD_COUNT_THREE(0.00) Symbol: DKIM_TRACE(0.00) Symbol: MAILLIST(-0.10) Symbol: RCVD_NO_TLS_LAST(0.10) Symbol: RCVD_IN_DNSWL_FAIL(0.00) Symbol: MIM =17> +static int _mtk_mdio_write(struct mtk_eth *eth, u32 phy_addr, u32 phy= _reg, > + u32 write_data) > { > if (mtk_mdio_busy_wait(eth)) > - return -1; > - > - write_data &=3D 0xffff; > + return -EBUSY; -ETIMEDOUT would be more normal. I would probably also change mtk_mdio_busy_wait() so that it either returned 0, or -ETIMEDOUT. That is the general pattern in Linux, return 0 on success, or a negative error code. Returning -1 is an invitation for trouble. The code would then become ret =3D mtk_mdio_busy_wait(eth); if (ret < 0) return ret; which is a very common pattern in Linux. Andrew