Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp537037lqt; Thu, 6 Jun 2024 10:28:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQkxBG4Kx5iBPz8YgyH5qLH2UQBYsuWgSOndFt7nvE7Tt5AAym5IA6KQ7whL9OlUNFi4xYjdQAD6tUS58b0aDil8LSvvN1lq/zjw2DpA== X-Google-Smtp-Source: AGHT+IGDADtz2hAnpSRq5gCHdLa/H1pDo2JyH0hx4LMTbkJ8Jd1K5x3lgizeMw8VYuvVc4y808kF X-Received: by 2002:a17:902:f689:b0:1f6:a43:89c3 with SMTP id d9443c01a7336-1f6d03ab70bmr3148075ad.57.1717694927571; Thu, 06 Jun 2024 10:28:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717694927; cv=pass; d=google.com; s=arc-20160816; b=H6wdeDs65Z6P5Lb+qBE5ol47rUH+ScX9+Kr+RMJOPAVUtvasGYgZBNZHfNnaxjeXeL N/rbzmAD9v+l2ZdU8LYMnL+CGgR4t2uCQkLcH0tkM03aVppRdGX0jGhgVC8a1BHqhDAU VSU0i26HNP1Uw8cgQpsRv4pGlk2+UwlKKYwPL93HwLqQfiz6jlfCxkv08NWR5KDObjaM 99BlzQDkFUsd5r5sCf4yux810em89s1dKSWRVmRGHh5kkqRuk7RkToWGgxVWoxXtccfc srp6LFPSQJxSLlrRyFqfw/IechuI794pY5UDJLlfPIRAjmkLFg1DUtMGFzs9RTwnOvJd 2yvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ma8i9n0Ul2xhEENoFuQX+QsntPlbItenEYXbdtOE3xI=; fh=o2pYZQfGy+CHSC49c+OpA33C4SMY76wbolUR5Drq8H0=; b=WCg+YkgZ0k5Aqf2TSVk+BiCXavxlS8NKIXR39TPbJPRyySUkAqrUXiDAmNtxX4G5He N2AHpV8FPNdSs3JDowWBsxzmk7LmFKr8O13jvFy2z2kkAB/zD3BF3Ppe9GR9o0AiUwSW DEJOPZ24NtwkgZBhYi+44jpCUzSeMww6pL2DOg2qrs1svzXS2syyujllRkiu4OgI7mVi DNECzBHXuGvQ5hKncwLC0LctKaq+emPrBiCcYpjRyp7BXsGrItdi5L6cX6jjUCNq9FBE A3WmwUQRsaXhzqnxWeGzR2uXGT4jwoCFEezFeVgX6iv+yJsup545o+vbOxaH0d2czoip BTow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iHRnrKN9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-204797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7e5092si14965805ad.377.2024.06.06.10.28.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:28:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iHRnrKN9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-204797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 35D72288E4C for ; Thu, 6 Jun 2024 17:27:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E9F31991B9; Thu, 6 Jun 2024 17:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iHRnrKN9" Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 799F61990C8; Thu, 6 Jun 2024 17:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717694835; cv=none; b=UDxVBQbfT2sujRcKeU3tMZ0DdrIUvrJgl62pa+xQh6/PE1wJ7qVsVcgxFr2DopEz5KKBt83g4HFc8EIbFfTyxV+pNsg/W9wDqKIT6+meeZso227t7k4Khfu1AV+A+Zvs2m5gq8+GR0mi00CMaSRpTYowQeWpEZDQt38naZsPyA4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717694835; c=relaxed/simple; bh=00CNnKfYf4m94sDjDxhhBBDOl45dZ+7MLCQdgobspB8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pp2T3yzgaEQC3PumC9XSd+CxQnJCVBte6z7YGyOYrgvi8VySzcR8GkG+7bRQFRKj9Wql29bP5tFXoKuyqpTeP8z6Scauax0bVzYbmde9HhQ/NqDgeaD9n+UT3tb2xFH7qF/xuKEdXhL0hFG+f2Iw3fkveWtO+tmiWhk6CpronNo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iHRnrKN9; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-52b919d214cso1239245e87.2; Thu, 06 Jun 2024 10:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717694831; x=1718299631; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ma8i9n0Ul2xhEENoFuQX+QsntPlbItenEYXbdtOE3xI=; b=iHRnrKN9IegKtTFMMs670+xcdcbx/IT7ak2Wax5SAmL7vvWTwBR+clQms4fOjXDE73 faXzvTq0svubA0pn05aoE0pr61G8ihfs3E1kblcdwD7vREaIO3sf4kzvJg2nGclU8WXk I8AOsE2cw3tUuvStxFD1beTH9TIPpHWAFCknUsxgF+pgi5CRNkyGiHdqVwYtVzMFNWLN tg5P+YtaBpQHP/wPHyIxi8HeCCuSwSQg78JCpIGo79DCAZwWyMslCswU4pgm/lHjea4I W/+Z27a7wpIW9/qlKfDomOhGtCTCy3nxMRGs2BbXvHKO8bH5kBZnTYPFhCIIG/lMSFu5 hQPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717694831; x=1718299631; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ma8i9n0Ul2xhEENoFuQX+QsntPlbItenEYXbdtOE3xI=; b=dbw3mf5DOFMYBFpmIURnTqebNH/5Lm3Qr1IUqwxUDVhNPs/BEfMxplCLG2Q6fCLfHg Oyi9fRT/8dsGZzd2ZUOfvgn2dFC7GU7BMQ3+cY5DvuCl9HSw3RvPiOAxGhuCFaDeTG8m 3CeUWpGvdYExSCXo1JZ3TZbRwUUBKgO2Cv2zspSMGOlV5cAFrgyWEsa76AUwd7HkPH7a hb2t5u1xXw83cpUDw32Ca4S3dZNlnk/tHp8AwFSWoffZSH4VT2sHJ1/7Sp0UHAhsXjPX oRvMqUBSQtvXI1ikuwVm5lF7sPE/iIkPMwVGu83d7XPOBCwXR7iCxt8CSzqUSL1aEnTg HzOw== X-Forwarded-Encrypted: i=1; AJvYcCVfq8c8FUmp0T4r+aI8C8Sfbz+R2JE6CttGOmNXjpPeK4n8LWWcyXSxj1nJ6ts3ICFSWjoavPfHF+b8Oa7LJAZxlqNxSWXMgrkSz+GXedHOOS9OeltKA2eb43Q490RzZwjbXp13JhW7w0TTC/464vmq6ikLmgHBn9mMe6WHSqbzOqJhwgV6LeYzLUTafSupMQtliHAAGUCqWwzusDSDWKB4 X-Gm-Message-State: AOJu0YxgRNfokfHx/8Rf3mlpevCeIcayQCWQFfCJLtb+5yw0uSMPE35X ccW4ZKTldXQM8sFsx2zfogolGpS+UP836CzBUtxhKYEoa8c6fALy X-Received: by 2002:a05:6512:2812:b0:529:b6e9:7978 with SMTP id 2adb3069b0e04-52bb9f8ef6fmr224153e87.37.1717694831074; Thu, 06 Jun 2024 10:27:11 -0700 (PDT) Received: from [10.0.0.42] (host-85-29-124-88.kaisa-laajakaista.fi. [85.29.124.88]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52bb433c894sm251499e87.256.2024.06.06.10.27.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jun 2024 10:27:10 -0700 (PDT) Message-ID: <0a77e955-e5a6-4a0e-8c1d-8b2ebd0d1eec@gmail.com> Date: Thu, 6 Jun 2024 20:30:43 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next] dmaengine: ti: k3-udma-glue: clean up return in k3_udma_glue_rx_get_irq() To: Dan Carpenter Cc: Vinod Koul , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , MD Danish Anwar , Roger Quadros , Grygorii Strashko , Julien Panis , Chintan Vankar , Diogo Ivo , Simon Horman , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org References: <2f28f769-6929-4fc2-b875-00bf1d8bf3c4@kili.mountain> Content-Language: en-US From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= In-Reply-To: <2f28f769-6929-4fc2-b875-00bf1d8bf3c4@kili.mountain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 6/6/24 5:23 PM, Dan Carpenter wrote: > Currently the k3_udma_glue_rx_get_irq() function returns either negative > error codes or zero on error. Generally, in the kernel, zero means > success so this be confusing and has caused bugs in the past. Also the > "tx" version of this function only returns negative error codes. Let's > clean this "rx" function so both functions match. > > This patch has no effect on runtime. Acked-by: Peter Ujfalusi > > Signed-off-by: Dan Carpenter > --- > drivers/dma/ti/k3-udma-glue.c | 3 +++ > drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 ++-- > drivers/net/ethernet/ti/icssg/icssg_common.c | 4 +--- > 3 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/dma/ti/k3-udma-glue.c b/drivers/dma/ti/k3-udma-glue.c > index c9b93055dc9d..b96b448a0e69 100644 > --- a/drivers/dma/ti/k3-udma-glue.c > +++ b/drivers/dma/ti/k3-udma-glue.c > @@ -1531,6 +1531,9 @@ int k3_udma_glue_rx_get_irq(struct k3_udma_glue_rx_channel *rx_chn, > flow->virq = k3_ringacc_get_ring_irq_num(flow->ringrx); > } > > + if (!flow->virq) > + return -ENXIO; > + > return flow->virq; > } > EXPORT_SYMBOL_GPL(k3_udma_glue_rx_get_irq); > diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c > index 4e50b3792888..8c26acc9cde1 100644 > --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c > +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c > @@ -2424,10 +2424,10 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common) > > rx_chn->irq = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i); > > - if (rx_chn->irq <= 0) { > + if (rx_chn->irq < 0) { > dev_err(dev, "Failed to get rx dma irq %d\n", > rx_chn->irq); > - ret = -ENXIO; > + ret = rx_chn->irq; > goto err; > } > } > diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c > index 088ab8076db4..cac7863c5cb2 100644 > --- a/drivers/net/ethernet/ti/icssg/icssg_common.c > +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c > @@ -440,9 +440,7 @@ int prueth_init_rx_chns(struct prueth_emac *emac, > fdqring_id = k3_udma_glue_rx_flow_get_fdq_id(rx_chn->rx_chn, > i); > ret = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i); > - if (ret <= 0) { > - if (!ret) > - ret = -ENXIO; > + if (ret < 0) { > netdev_err(ndev, "Failed to get rx dma irq"); > goto fail; > } -- Péter