Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Sumit Gupta <sumitg@nvidia.com>
To: <krzk@kernel.org>, <treding@nvidia.com>, <jonathanh@nvidia.com>,
	<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>
Cc: <bbasu@nvidia.com>, <sumitg@nvidia.com>
Subject: [PATCH 3/3] memory: tegra234: drop dead NULL check in tegra234_mc_icc_aggregate()
Date: Wed, 27 May 2026 19:31:27 +0530	[thread overview]
Message-ID: <20260527140127.49172-4-sumitg@nvidia.com> (raw)
In-Reply-To: <20260527140127.49172-1-sumitg@nvidia.com>

In tegra234_mc_icc_aggregate(), the 'if (mc)' check inside the
CPU-cluster branch is always true.  'mc' was already dereferenced
via 'mc->bwmgr_mrq_supported' a few lines above, so if it were NULL
the function would have faulted there.  Drop the redundant check.

Reported-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 drivers/memory/tegra/tegra234.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/memory/tegra/tegra234.c b/drivers/memory/tegra/tegra234.c
index 9fbd34d4abe0..982476b67d5a 100644
--- a/drivers/memory/tegra/tegra234.c
+++ b/drivers/memory/tegra/tegra234.c
@@ -1106,10 +1106,8 @@ static int tegra234_mc_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
 
 	if (node->id == TEGRA_ICC_MC_CPU_CLUSTER0 ||
 	    node->id == TEGRA_ICC_MC_CPU_CLUSTER1 ||
-	    node->id == TEGRA_ICC_MC_CPU_CLUSTER2) {
-		if (mc)
-			peak_bw = peak_bw * mc->num_channels;
-	}
+	    node->id == TEGRA_ICC_MC_CPU_CLUSTER2)
+		peak_bw = peak_bw * mc->num_channels;
 
 	*agg_avg += avg_bw;
 	*agg_peak = max(*agg_peak, peak_bw);
-- 
2.34.1


  parent reply	other threads:[~2026-05-27 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 14:01 [PATCH 0/3] memory: tegra: UBSAN fix and cleanups Sumit Gupta
2026-05-27 14:01 ` [PATCH 1/3] memory: tegra186-emc: stop borrowing MC aggregate hook for EMC Sumit Gupta
2026-06-09 15:01   ` Krzysztof Kozlowski
2026-06-09 15:07     ` Jon Hunter
2026-06-09 15:08       ` Krzysztof Kozlowski
2026-05-27 14:01 ` [PATCH 2/3] memory: tegra264: drop redundant tegra264_mc_icc_aggregate() Sumit Gupta
2026-05-27 14:01 ` Sumit Gupta [this message]
2026-06-09 14:51 ` [PATCH 0/3] memory: tegra: UBSAN fix and cleanups Jon Hunter
2026-06-09 15:02 ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260527140127.49172-4-sumitg@nvidia.com \
    --to=sumitg@nvidia.com \
    --cc=bbasu@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox