kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] iommu/vt-d: remove redundant assignment to variable err
@ 2024-04-11  9:05 Colin Ian King
  2024-04-24  3:45 ` Baolu Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-04-11  9:05 UTC (permalink / raw)
  To: David Woodhouse, Joerg Roedel, Will Deacon, Robin Murphy, iommu
  Cc: kernel-janitors, linux-kernel

Variable err is being assigned a value that is never read. It is
either being re-assigned later on error exit paths, or never referenced
on the non-error path.

Cleans up clang scan build warning:
drivers/iommu/intel/dmar.c:1070:2: warning: Value stored to 'err' is
never read [deadcode.DeadStores]`

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/iommu/intel/dmar.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 36d7427b1202..351be9455214 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1067,7 +1067,6 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
 		goto error_free_seq_id;
 	}
 
-	err = -EINVAL;
 	if (!cap_sagaw(iommu->cap) &&
 	    (!ecap_smts(iommu->ecap) || ecap_slts(iommu->ecap))) {
 		pr_info("%s: No supported address widths. Not attempting DMA translation.\n",
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] iommu/vt-d: remove redundant assignment to variable err
  2024-04-11  9:05 [PATCH][next] iommu/vt-d: remove redundant assignment to variable err Colin Ian King
@ 2024-04-24  3:45 ` Baolu Lu
  0 siblings, 0 replies; 2+ messages in thread
From: Baolu Lu @ 2024-04-24  3:45 UTC (permalink / raw)
  To: Colin Ian King, David Woodhouse, Joerg Roedel, Will Deacon,
	Robin Murphy, iommu
  Cc: baolu.lu, kernel-janitors, linux-kernel

On 4/11/24 5:05 PM, Colin Ian King wrote:
> Variable err is being assigned a value that is never read. It is
> either being re-assigned later on error exit paths, or never referenced
> on the non-error path.
> 
> Cleans up clang scan build warning:
> drivers/iommu/intel/dmar.c:1070:2: warning: Value stored to 'err' is
> never read [deadcode.DeadStores]`
> 
> Signed-off-by: Colin Ian King<colin.i.king@gmail.com>
> ---
>   drivers/iommu/intel/dmar.c | 1 -
>   1 file changed, 1 deletion(-)

Patch has been queued for iommu/vt-d.

Best regards,
baolu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-24  3:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-11  9:05 [PATCH][next] iommu/vt-d: remove redundant assignment to variable err Colin Ian King
2024-04-24  3:45 ` Baolu Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).