Skip to contentSkip to conversation

soundwire: intel_auxdevice: remove redundant assignment to variable link_flags

PATCH Applied Colin Ian King 3 participants 3 messages Feb 5, 2024 – Feb 7, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soundwire: intel_auxdevice: remove redundant assignment to variable link_flags

The variable link_flags is being initialized with a value that is never read, it is being re-assigned later on. The initialization is redundant and can be removed.

Cleans up clang scan build warning:
drivers/soundwire/intel_auxdevice.c:624:2: warning: Value stored to 'link_flags' is never read [deadcode.DeadStores]

---
 drivers/soundwire/intel_auxdevice.c | 2 --
 1 file changed, 2 deletions(-)
drivers/soundwire/intel_auxdevice.c +0 -2
index 93698532deac..95125cc2fc59 100644
@@ -621,8 +621,6 @@ static int __maybe_unused intel_resume(struct device *dev)
 		return 0;
 	}
 
-	link_flags = md_flags >> (bus->link_id * 8);
-
 	if (pm_runtime_suspended(dev)) {
 		dev_dbg(dev, "pm_runtime status was suspended, forcing active\n");
 
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

Thanks for the clean-up!

Quoted 18 lines

The variable link_flags is being initialized with a value that is never read, it is being re-assigned later on. The initialization is redundant and can be removed.

Cleans up clang scan build warning:
drivers/soundwire/intel_auxdevice.c:624:2: warning: Value stored to 'link_flags' is never read [deadcode.DeadStores]

---
 drivers/soundwire/intel_auxdevice.c | 2 --
 1 file changed, 2 deletions(-)
drivers/soundwire/intel_auxdevice.c +0 -0
index 93698532deac..95125cc2fc59 100644

drivers/soundwire/intel_auxdevice.c static int __maybe_unused intel_resume(struct device *dev) · line 625

Quoted 5 lines
drivers/soundwire/intel_auxdevice.c +0 -2
@@ -621,8 +621,6 @@ static int __maybe_unused intel_resume(struct device *dev)
 		return 0;
 	}
 
-	link_flags = md_flags >> (bus->link_id * 8);
-

this redundant line is 3+ years old now, added in a2d9c161db24 ("soundwire: intel: pm_runtime idle scheduling")

Quoted 3 lines
drivers/soundwire/intel_auxdevice.c +0 -0
 	if (pm_runtime_suspended(dev)) {
 		dev_dbg(dev, "pm_runtime status was suspended, forcing active\n");
 
maintainer Applied
#2 lore raw
In reply to Colin Ian King
Quoted 9 lines · Colin Ian King

The variable link_flags is being initialized with a value that is never read, it is being re-assigned later on. The initialization is redundant and can be removed.

Cleans up clang scan build warning:
drivers/soundwire/intel_auxdevice.c:624:2: warning: Value stored to 'link_flags' is never read [deadcode.DeadStores]

[...]

Applied, thanks!

[1/1] soundwire: intel_auxdevice: remove redundant assignment to variable link_flags

      commit: 9282cfa2eb080e3bbb95f488af35618b614cdf76

Best regards,

Signature · 1 line
~Vinod