Skip to contentSkip to conversation

bus: mhi: core: remove redundant initialization of variables state and ee

PATCH Applied Colin King 4 participants 5 messages Mar 11, 2021 – May 26, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 bus: mhi: core: remove redundant initialization of variables state and ee

From: Colin Ian King <[email protected]>

The variables state and ee are being initialized with values that are never read and are being updated later with a new values. The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/bus/mhi/core/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/mhi/core/main.c +2 -2
index 2c61dfd01353..3faf8bade520 100644
@@ -428,9 +428,9 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
 {
 	struct mhi_controller *mhi_cntrl = priv;
 	struct device *dev = &mhi_cntrl->mhi_dev->dev;
-	enum mhi_state state = MHI_STATE_MAX;
+	enum mhi_state state;
 	enum mhi_pm_state pm_state = 0;
-	enum mhi_ee_type ee = MHI_EE_MAX;
+	enum mhi_ee_type ee;
 
 	write_lock_irq(&mhi_cntrl->pm_lock);
 	if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The variables state and ee are being initialized with values that are never read and are being updated later with a new values. The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")

Quoted 23 lines
---
 drivers/bus/mhi/core/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/mhi/core/main.c +2 -3
index 2c61dfd01353..3faf8bade520 100644
@@ -428,9 +428,9 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
 {
        struct mhi_controller *mhi_cntrl = priv;
        struct device *dev = &mhi_cntrl->mhi_dev->dev;
-       enum mhi_state state = MHI_STATE_MAX;
+       enum mhi_state state;
        enum mhi_pm_state pm_state = 0;
-       enum mhi_ee_type ee = MHI_EE_MAX;
+       enum mhi_ee_type ee;
 
        write_lock_irq(&mhi_cntrl->pm_lock);
        if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
--

2.30.2

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variables state and ee are being initialized with values that are never read and are being updated later with a new values. The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")

Thanks,
Mani

Quoted 23 lines
---
 drivers/bus/mhi/core/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/mhi/core/main.c +2 -2
index 2c61dfd01353..3faf8bade520 100644
@@ -428,9 +428,9 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
 {
 	struct mhi_controller *mhi_cntrl = priv;
 	struct device *dev = &mhi_cntrl->mhi_dev->dev;
-	enum mhi_state state = MHI_STATE_MAX;
+	enum mhi_state state;
 	enum mhi_pm_state pm_state = 0;
-	enum mhi_ee_type ee = MHI_EE_MAX;
+	enum mhi_ee_type ee;
 
 	write_lock_irq(&mhi_cntrl->pm_lock);
 	if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
Signature · 1 line
2.30.2
maintainer Applied
#3 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variables state and ee are being initialized with values that are never read and are being updated later with a new values. The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")

Applied to mhi-next!

Thanks,
Mani

Quoted 23 lines
---
 drivers/bus/mhi/core/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/mhi/core/main.c +2 -2
index 2c61dfd01353..3faf8bade520 100644
@@ -428,9 +428,9 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
 {
 	struct mhi_controller *mhi_cntrl = priv;
 	struct device *dev = &mhi_cntrl->mhi_dev->dev;
-	enum mhi_state state = MHI_STATE_MAX;
+	enum mhi_state state;
 	enum mhi_pm_state pm_state = 0;
-	enum mhi_ee_type ee = MHI_EE_MAX;
+	enum mhi_ee_type ee;
 
 	write_lock_irq(&mhi_cntrl->pm_lock);
 	if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
Signature · 1 line
2.30.2
#4 lore raw
In reply to Colin King
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 10 lines · On Thu, 11 Mar 2021 11:17:27 +0000 you wrote:

From: Colin Ian King <[email protected]>

The variables state and ee are being initialized with values that are never read and are being updated later with a new values. The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")

[...]

Here is the summary with links:
- [next] bus: mhi: core: remove redundant initialization of variables state and ee

    https://git.kernel.org/qcom/c/70f7025c854c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html