Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp188585rdb; Tue, 5 Dec 2023 02:37:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAYHz+BEGaBfJdakYU1w6TAclFuHqJz2dD1386AqWRhClStHc52Jshg3xbyqIuHsUlet9o X-Received: by 2002:a05:6a20:a3a4:b0:18f:97c:9793 with SMTP id w36-20020a056a20a3a400b0018f097c9793mr4961699pzk.123.1701772676845; Tue, 05 Dec 2023 02:37:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701772676; cv=none; d=google.com; s=arc-20160816; b=WQyryiodDN7ndUWrK9BXGijTKbmypfcYNtAsIaDr9mTbw6dZrxxxA9oZtLuETHSrUM jLJCb67f2lMy0/5Iu36QqqZGaMjNxtE1I4otKmptuGtd5ym4/uE2zONQPnrsCAlJe+o0 szaatuImot9TtkskEG9rt2PeUBugqpUbde7V3wxh361oRPMv+yiwYvrgeOJ4IItkEPB7 DrhNWajOOVTcXyCylLQlwiWNEC9h0XTHS/PZECW/KV/Z1YYRFnt3mwto/TYrfLR1MlKj PQFvk6f43YcF6IQyqYBc6KOdLz9eCGR4t5AJA0QaUMJ0KGNRscPliU7dppT2dNZwb8Sb NwXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U54qqy6N0N2c+9OxOcQWdVdaen6MX6mbtv2CDF+JdLE=; fh=NoYD4WQZNjSG2Bb9ocssXw4U79pWAZvdivFB0JgByN0=; b=xK942aBUroJJ+Cmir5uLcLm8zut6MipMX/jtiPAVysx2yY7UEaKXYam15AfdXx3eN/ ttuzXUCkQKktlve10ZQT15woFIWWEMGavo0k5zcbkb61IWGp101EPzi85Qhg9HKp/dqb brasEPUYK/RzBpwwTLhbCUQaj4AYaIyhlqkIYcLEzklpxkFzDbE8T40RzGNXr+ALbjSX rpbEnYDYsgtqjniBRBGHtIdGz6E3pRz3tKdjio2TQGGlzCg2i3siP66rSKq1ptWpnqvg 98Most5EXe3OmbehalQJla+Cwa02aPOE37kkzJbLLEYwKhUFeKUXLJsQagLEsotxKMvv 5kWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DTH8mjP1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bf5-20020a656d05000000b0059bdf5a4ecfsi9558108pgb.247.2023.12.05.02.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 02:37:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DTH8mjP1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id F2B9C8220121; Tue, 5 Dec 2023 02:37:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345009AbjLEKgM (ORCPT + 99 others); Tue, 5 Dec 2023 05:36:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235059AbjLEKgD (ORCPT ); Tue, 5 Dec 2023 05:36:03 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D781116; Tue, 5 Dec 2023 02:36:09 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50bf1e32571so2829680e87.2; Tue, 05 Dec 2023 02:36:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701772567; x=1702377367; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U54qqy6N0N2c+9OxOcQWdVdaen6MX6mbtv2CDF+JdLE=; b=DTH8mjP1m4kawMzdG4DddIKZWvbVLaOt2K1oFbLr7kigi19BATgk2AuTWxseGVUjvI 1wUOtMICDoBOgl1FwX2PDLPTvgMhIc6CoqJPSUzzjslqe77iA+MIEo5r46GYab/uQtSS cGsc6gk53ZGJdDjVeIF8vbpvlAUJ+miweQYoJ/m9ZhlhTqRAwcArbtKthTGiffgFThMD u5WOvHXSRrRh3t4nLsah4DazYGLRIe5al7IXZOAHocfnQD4iLsJEAxuf4eZPzCJquYPS uWE4QMmeguec16mcALV2FXcKoVbc+5xMBGgAuzdsFb+O7gjHSvyQK6OJ2rX7pCIKUO1D MGvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701772567; x=1702377367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U54qqy6N0N2c+9OxOcQWdVdaen6MX6mbtv2CDF+JdLE=; b=q4+y5zp/linR+n1OcPB1admQ91eU0JEQTyrjjhxjDb/OsaLQi9B81nUmD7lF8S8swn H5oKqN/mq9ueE4tmL4nWgiW8DJp39ocLCGQo/1TsuR60Y8YtZD28GaHC7z/5zp4QXOi9 s7ZTqbYWmlDTcAT1kg8tidOLWuXIhbTo4WlAoMuHVgn728u5gRJS1DzzVBGaWX0QtmI1 yqCV5IS8+U+qbQJghFUgoKfGkmx/EyBbQR3LHOCdGPtcMo0z1/q21vnI5LWaU9+0QaQt 9nGRx6nrb2dmE8sEdivP5LwOtep9dB/BG70uRtuHpVEvoOEoQC+t7JFeInrSJ+PZYHVe ewmw== X-Gm-Message-State: AOJu0YxXJ4OXUGGXAJCTYF1hFeVlCmaryMb+F4et2F4HrEHb3KYn0ftE KJAJLNXLe9/b5m5fuCX3UjQ= X-Received: by 2002:a05:6512:e89:b0:50b:e384:2c5c with SMTP id bi9-20020a0565120e8900b0050be3842c5cmr3164864lfb.136.1701772567319; Tue, 05 Dec 2023 02:36:07 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id d10-20020ac241ca000000b0050be6252444sm991214lfi.133.2023.12.05.02.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 02:36:06 -0800 (PST) From: Serge Semin To: Andrew Lunn , Heiner Kallweit , Russell King , Alexandre Torgue , Jose Abreu , Jose Abreu , Maxime Chevallier , Tomer Maimon , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Serge Semin , openbmc@lists.ozlabs.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 03/16] net: pcs: xpcs: Return EINVAL in the internal methods Date: Tue, 5 Dec 2023 13:35:24 +0300 Message-ID: <20231205103559.9605-4-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231205103559.9605-1-fancer.lancer@gmail.com> References: <20231205103559.9605-1-fancer.lancer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 05 Dec 2023 02:37:50 -0800 (PST) In particular the xpcs_soft_reset() and xpcs_do_config() functions currently return -1 if invalid auto-negotiation mode is specified. That value can be then passed to the generic kernel subsystems which require a standard kernel errno value. Even though the error conditions are very specific (memory corruption or buggy implementation) using a hard-coded -1 literal doesn't seem correct anyway. Signed-off-by: Serge Semin --- drivers/net/pcs/pcs-xpcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 7f8c63922a4b..92c47da61db4 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -292,7 +292,7 @@ static int xpcs_soft_reset(struct dw_xpcs *xpcs, dev = MDIO_MMD_VEND2; break; default: - return -1; + return -EINVAL; } ret = xpcs_write(xpcs, dev, MDIO_CTRL1, MDIO_CTRL1_RESET); @@ -889,7 +889,7 @@ int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface, return ret; break; default: - return -1; + return -EINVAL; } if (compat->pma_config) { -- 2.42.1