* [PATCH] mei: Remove some dead code
@ 2021-11-12 10:06 Christophe JAILLET
2021-11-12 11:30 ` Haakon Bugge
0 siblings, 1 reply; 5+ messages in thread
From: Christophe JAILLET @ 2021-11-12 10:06 UTC (permalink / raw)
To: tomas.winkler, arnd, gregkh
Cc: linux-rdma, linux-kernel, kernel-janitors, Christophe JAILLET
'generated' is known to be true here, so "true || whatever" will still be
true.
So, remove some dead code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This is also likely that a bug is lurking here.
Maybe, the following was expected:
- generated = generated ||
+ generated =
(hisr & HISR_INT_STS_MSK) ||
(ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
?
---
drivers/misc/mei/hw-txe.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
index a4e854b9b9e6..00652c137cc7 100644
--- a/drivers/misc/mei/hw-txe.c
+++ b/drivers/misc/mei/hw-txe.c
@@ -994,11 +994,7 @@ static bool mei_txe_check_and_ack_intrs(struct mei_device *dev, bool do_ack)
hhisr &= ~IPC_HHIER_SEC;
}
- generated = generated ||
- (hisr & HISR_INT_STS_MSK) ||
- (ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
-
- if (generated && do_ack) {
+ if (do_ack) {
/* Save the interrupt causes */
hw->intr_cause |= hisr & HISR_INT_STS_MSK;
if (ipc_isr & SEC_IPC_HOST_INT_STATUS_IN_RDY)
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mei: Remove some dead code
2021-11-12 10:06 [PATCH] mei: Remove some dead code Christophe JAILLET
@ 2021-11-12 11:30 ` Haakon Bugge
2021-11-28 11:12 ` Winkler, Tomas
0 siblings, 1 reply; 5+ messages in thread
From: Haakon Bugge @ 2021-11-12 11:30 UTC (permalink / raw)
To: Christophe JAILLET
Cc: tomas.winkler, arnd, gregkh, OFED mailing list, linux-kernel,
kernel-janitors
> On 12 Nov 2021, at 11:06, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
>
> 'generated' is known to be true here, so "true || whatever" will still be
> true.
>
> So, remove some dead code.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This is also likely that a bug is lurking here.
>
> Maybe, the following was expected:
> - generated = generated ||
> + generated =
> (hisr & HISR_INT_STS_MSK) ||
> (ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
>
> ?
I concur about your analysis, but I do not know the intent here.
Håkon
> ---
> drivers/misc/mei/hw-txe.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
> index a4e854b9b9e6..00652c137cc7 100644
> --- a/drivers/misc/mei/hw-txe.c
> +++ b/drivers/misc/mei/hw-txe.c
> @@ -994,11 +994,7 @@ static bool mei_txe_check_and_ack_intrs(struct mei_device *dev, bool do_ack)
> hhisr &= ~IPC_HHIER_SEC;
> }
>
> - generated = generated ||
> - (hisr & HISR_INT_STS_MSK) ||
> - (ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
> -
> - if (generated && do_ack) {
> + if (do_ack) {
> /* Save the interrupt causes */
> hw->intr_cause |= hisr & HISR_INT_STS_MSK;
> if (ipc_isr & SEC_IPC_HOST_INT_STATUS_IN_RDY)
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] mei: Remove some dead code
2021-11-12 11:30 ` Haakon Bugge
@ 2021-11-28 11:12 ` Winkler, Tomas
2021-11-28 14:29 ` gregkh
0 siblings, 1 reply; 5+ messages in thread
From: Winkler, Tomas @ 2021-11-28 11:12 UTC (permalink / raw)
To: Haakon Bugge, Christophe JAILLET
Cc: arnd, gregkh, OFED mailing list, linux-kernel, kernel-janitors
>
>
> > On 12 Nov 2021, at 11:06, Christophe JAILLET
> <christophe.jaillet@wanadoo.fr> wrote:
> >
> > 'generated' is known to be true here, so "true || whatever" will still
> > be true.
> >
> > So, remove some dead code.
> >
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > ---
> > This is also likely that a bug is lurking here.
> >
> > Maybe, the following was expected:
> > - generated = generated ||
> > + generated =
> > (hisr & HISR_INT_STS_MSK) ||
> > (ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
> >
> > ?
>
> I concur about your analysis, but I do not know the intent here.
Your fix is okay, I can ack that patch.
Thanks
Tomas
>
>
> Håkon
>
> > ---
> > drivers/misc/mei/hw-txe.c | 6 +-----
> > 1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
> > index a4e854b9b9e6..00652c137cc7 100644
> > --- a/drivers/misc/mei/hw-txe.c
> > +++ b/drivers/misc/mei/hw-txe.c
> > @@ -994,11 +994,7 @@ static bool mei_txe_check_and_ack_intrs(struct
> mei_device *dev, bool do_ack)
> > hhisr &= ~IPC_HHIER_SEC;
> > }
> >
> > - generated = generated ||
> > - (hisr & HISR_INT_STS_MSK) ||
> > - (ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
> > -
> > - if (generated && do_ack) {
> > + if (do_ack) {
> > /* Save the interrupt causes */
> > hw->intr_cause |= hisr & HISR_INT_STS_MSK;
> > if (ipc_isr & SEC_IPC_HOST_INT_STATUS_IN_RDY)
> > --
> > 2.30.2
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mei: Remove some dead code
2021-11-28 11:12 ` Winkler, Tomas
@ 2021-11-28 14:29 ` gregkh
2021-11-28 16:38 ` Winkler, Tomas
0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2021-11-28 14:29 UTC (permalink / raw)
To: Winkler, Tomas
Cc: Haakon Bugge, Christophe JAILLET, arnd, OFED mailing list,
linux-kernel, kernel-janitors
On Sun, Nov 28, 2021 at 11:12:33AM +0000, Winkler, Tomas wrote:
>
> >
> >
> > > On 12 Nov 2021, at 11:06, Christophe JAILLET
> > <christophe.jaillet@wanadoo.fr> wrote:
> > >
> > > 'generated' is known to be true here, so "true || whatever" will still
> > > be true.
> > >
> > > So, remove some dead code.
> > >
> > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > ---
> > > This is also likely that a bug is lurking here.
> > >
> > > Maybe, the following was expected:
> > > - generated = generated ||
> > > + generated =
> > > (hisr & HISR_INT_STS_MSK) ||
> > > (ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
> > >
> > > ?
> >
> > I concur about your analysis, but I do not know the intent here.
> Your fix is okay, I can ack that patch.
Is that an ack of this patch? If so, please provide that...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] mei: Remove some dead code
2021-11-28 14:29 ` gregkh
@ 2021-11-28 16:38 ` Winkler, Tomas
0 siblings, 0 replies; 5+ messages in thread
From: Winkler, Tomas @ 2021-11-28 16:38 UTC (permalink / raw)
To: gregkh
Cc: Haakon Bugge, Christophe JAILLET, arnd, OFED mailing list,
linux-kernel, kernel-janitors
> On Sun, Nov 28, 2021 at 11:12:33AM +0000, Winkler, Tomas wrote:
> >
> > >
> > >
> > > > On 12 Nov 2021, at 11:06, Christophe JAILLET
> > > <christophe.jaillet@wanadoo.fr> wrote:
> > > >
> > > > 'generated' is known to be true here, so "true || whatever" will
> > > > still be true.
> > > >
> > > > So, remove some dead code.
> > > >
> > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > ---
> > > > This is also likely that a bug is lurking here.
> > > >
> > > > Maybe, the following was expected:
> > > > - generated = generated ||
> > > > + generated =
> > > > (hisr & HISR_INT_STS_MSK) ||
> > > > (ipc_isr & SEC_IPC_HOST_INT_STATUS_PENDING);
> > > >
> > > > ?
> > >
> > > I concur about your analysis, but I do not know the intent here.
> > Your fix is okay, I can ack that patch.
>
> Is that an ack of this patch? If so, please provide that...
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Thanks
Tomas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-28 16:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 10:06 [PATCH] mei: Remove some dead code Christophe JAILLET
2021-11-12 11:30 ` Haakon Bugge
2021-11-28 11:12 ` Winkler, Tomas
2021-11-28 14:29 ` gregkh
2021-11-28 16:38 ` Winkler, Tomas
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).