From patchwork Tue Jun 11 15:41:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13693949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D642DC27C75 for ; Tue, 11 Jun 2024 15:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3hu2NnT04t/3ambQLxaiGfaUXqhmpb5eopYurHE0uto=; b=JItvLrknVRBqtq zDR34RrNF4QunqeooAGBa0fx8VLJXzuDhK15hjf3MD+NTgbH4av7te4xsRW8UJP0u/PVYV7vEFDm3 40xAqkaxNrA5kiAhDVY44AUJUcj9K1DSsU1SN1fu4eDMeBv0tCCyTcIQE69QPAEi+EtVexHdbHbk/ vMmF91dewEXbqpkQ2r+FdKvXoGHmZThomFvQ5ZaxbXl7qbJYAKlUnnj9NfTPgmCSnHvF/QBGCstRJ Ivt+sHjADHumxxD8+mOZzXUEZN0mAsOidxE9OXMHPtNo2Z9BKGpCU+qQy6+iva0xgO2NwM7CRu0JN 7f4bbFlLvtsRC39xy3Iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sH3dA-00000009N02-2A8k; Tue, 11 Jun 2024 15:41:52 +0000 Received: from out-176.mta1.migadu.com ([95.215.58.176]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sH3d0-00000009MyJ-2ZZ7 for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2024 15:41:50 +0000 X-Envelope-To: radhey.shyam.pandey@amd.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718120500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Z0Vgu6hdIvIVHzLZcergBK6nr3ePcLKNG4v8w8fbW/8=; b=dGNevke6WTxqQAkrfIqw7QRNI0mRnNauqDnz1hh7etTXzDWMMq6lWSatpTUZyMvsPlZb66 afA3090PWTNdLC/gZ6UqGAhlIC80BR7ABNilvA01aa6kYf30ZbkfQlJW8gp5YgK/4fTsYg AIGtZK7Y8MTD4Qlfd59KKs5B6duTrGo= X-Envelope-To: andrew@lunn.ch X-Envelope-To: netdev@vger.kernel.org X-Envelope-To: kuba@kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: linux@armlinux.org.uk X-Envelope-To: michal.simek@amd.com X-Envelope-To: pabeni@redhat.com X-Envelope-To: edumazet@google.com X-Envelope-To: davem@davemloft.net X-Envelope-To: linux-arm-kernel@lists.infradead.org X-Envelope-To: sean.anderson@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sean Anderson To: Radhey Shyam Pandey , Andrew Lunn , netdev@vger.kernel.org Cc: Jakub Kicinski , linux-kernel@vger.kernel.org, Russell King , Michal Simek , Paolo Abeni , Eric Dumazet , "David S . Miller" , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err Date: Tue, 11 Jun 2024 11:41:16 -0400 Message-Id: <20240611154116.2643662-1-sean.anderson@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240611_084148_857706_623E4B95 X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This error message can be triggered by userspace. Use NL_SET_ERR_MSG so the message is returned to the user and to avoid polluting the kernel logs. Additionally, change the return value from EFAULT to EBUSY to better reflect the error (which has nothing to do with addressing). Signed-off-by: Sean Anderson Reviewed-by: Andrew Lunn Reviewed-by: Radhey Shyam Pandey --- Changes in v2: - Split off from stats series - Document return value change drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index c29809cd9201..5f98daa5b341 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1945,9 +1945,9 @@ axienet_ethtools_set_coalesce(struct net_device *ndev, struct axienet_local *lp = netdev_priv(ndev); if (netif_running(ndev)) { - netdev_err(ndev, - "Please stop netif before applying configuration\n"); - return -EFAULT; + NL_SET_ERR_MSG(extack, + "Please stop netif before applying configuration"); + return -EBUSY; } if (ecoalesce->rx_max_coalesced_frames)