* [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee
@ 2021-03-11 11:17 Colin King
2021-03-14 8:21 ` Loic Poulain
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Colin King @ 2021-03-11 11:17 UTC (permalink / raw)
To: Manivannan Sadhasivam, Jeffrey Hugo, linux-arm-msm
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/bus/mhi/core/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
index 2c61dfd01353..3faf8bade520 100644
--- a/drivers/bus/mhi/core/main.c
+++ b/drivers/bus/mhi/core/main.c
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee
2021-03-11 11:17 [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee Colin King
@ 2021-03-14 8:21 ` Loic Poulain
2021-03-15 4:05 ` Manivannan Sadhasivam
2021-03-15 4:27 ` Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Loic Poulain @ 2021-03-14 8:21 UTC (permalink / raw)
To: Colin King
Cc: Manivannan Sadhasivam, Jeffrey Hugo, linux-arm-msm,
kernel-janitors, open list
On Thu, 11 Mar 2021 at 12:18, Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
> ---
> drivers/bus/mhi/core/main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
> index 2c61dfd01353..3faf8bade520 100644
> --- a/drivers/bus/mhi/core/main.c
> +++ b/drivers/bus/mhi/core/main.c
> @@ -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
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee
2021-03-11 11:17 [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee Colin King
2021-03-14 8:21 ` Loic Poulain
@ 2021-03-15 4:05 ` Manivannan Sadhasivam
2021-03-15 4:27 ` Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2021-03-15 4:05 UTC (permalink / raw)
To: Colin King; +Cc: Jeffrey Hugo, linux-arm-msm, kernel-janitors, linux-kernel
On Thu, Mar 11, 2021 at 11:17:27AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Thanks,
Mani
> ---
> drivers/bus/mhi/core/main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
> index 2c61dfd01353..3faf8bade520 100644
> --- a/drivers/bus/mhi/core/main.c
> +++ b/drivers/bus/mhi/core/main.c
> @@ -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
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee
2021-03-11 11:17 [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee Colin King
2021-03-14 8:21 ` Loic Poulain
2021-03-15 4:05 ` Manivannan Sadhasivam
@ 2021-03-15 4:27 ` Manivannan Sadhasivam
2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2021-03-15 4:27 UTC (permalink / raw)
To: Colin King; +Cc: Jeffrey Hugo, linux-arm-msm, kernel-janitors, linux-kernel
On Thu, Mar 11, 2021 at 11:17:27AM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to mhi-next!
Thanks,
Mani
> ---
> drivers/bus/mhi/core/main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
> index 2c61dfd01353..3faf8bade520 100644
> --- a/drivers/bus/mhi/core/main.c
> +++ b/drivers/bus/mhi/core/main.c
> @@ -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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-15 4:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-11 11:17 [PATCH][next] bus: mhi: core: remove redundant initialization of variables state and ee Colin King
2021-03-14 8:21 ` Loic Poulain
2021-03-15 4:05 ` Manivannan Sadhasivam
2021-03-15 4:27 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox