2022-04-21 21:18:38

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH 1/3] ASoC: sh: rz-ssi: Drop unused macros

Drop unused macros SSIFSR_TDC and SSIFSR_RDC.

Reported-by: Nobuhiro Iwamatsu <[email protected]>
Signed-off-by: Lad Prabhakar <[email protected]>
---
sound/soc/sh/rz-ssi.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
index e8edaed05d4c..cec458b8c507 100644
--- a/sound/soc/sh/rz-ssi.c
+++ b/sound/soc/sh/rz-ssi.c
@@ -59,9 +59,7 @@
#define SSIFSR_RDC_MASK 0x3f
#define SSIFSR_RDC_SHIFT 8

-#define SSIFSR_TDC(x) (((x) & 0x1f) << 24)
#define SSIFSR_TDE BIT(16)
-#define SSIFSR_RDC(x) (((x) & 0x1f) << 8)
#define SSIFSR_RDF BIT(0)

#define SSIOFR_LRCONT BIT(8)
--
2.17.1


2022-04-25 15:17:34

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/3] ASoC: sh: rz-ssi: Drop unused macros

Hi Prabhakar,

On Fri, Apr 22, 2022 at 7:32 PM Lad Prabhakar
<[email protected]> wrote:
> Drop unused macros SSIFSR_TDC and SSIFSR_RDC.
>
> Reported-by: Nobuhiro Iwamatsu <[email protected]>
> Signed-off-by: Lad Prabhakar <[email protected]>

Thanks for your patch!

What does this fix?
Is the real issue that there are 32 FIFO entries, and the TDC and RDC
fields are 6 bits wide, while the mask uses 0x1f instead of 0x3f?

> --- a/sound/soc/sh/rz-ssi.c
> +++ b/sound/soc/sh/rz-ssi.c
> @@ -59,9 +59,7 @@
> #define SSIFSR_RDC_MASK 0x3f
> #define SSIFSR_RDC_SHIFT 8
>
> -#define SSIFSR_TDC(x) (((x) & 0x1f) << 24)
> #define SSIFSR_TDE BIT(16)
> -#define SSIFSR_RDC(x) (((x) & 0x1f) << 8)
> #define SSIFSR_RDF BIT(0)
>
> #define SSIOFR_LRCONT BIT(8)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-04-25 20:25:39

by Prabhakar

[permalink] [raw]
Subject: Re: [PATCH 1/3] ASoC: sh: rz-ssi: Drop unused macros

Hi Geert,

Thank you for the review.

On Mon, Apr 25, 2022 at 1:49 PM Geert Uytterhoeven <[email protected]> wrote:
>
> Hi Prabhakar,
>
> On Fri, Apr 22, 2022 at 7:32 PM Lad Prabhakar
> <[email protected]> wrote:
> > Drop unused macros SSIFSR_TDC and SSIFSR_RDC.
> >
> > Reported-by: Nobuhiro Iwamatsu <[email protected]>
> > Signed-off-by: Lad Prabhakar <[email protected]>
>
> Thanks for your patch!
>
> What does this fix?
> Is the real issue that there are 32 FIFO entries, and the TDC and RDC
> fields are 6 bits wide, while the mask uses 0x1f instead of 0x3f?
>
I was in two minds here as you have already spotted the masks are
incorrect, instead of fixing the masks I choose to drop the macros
itself as they were not used. Let me know what are your thoughts on
this.

Cheers,
Prabhakar

> > --- a/sound/soc/sh/rz-ssi.c
> > +++ b/sound/soc/sh/rz-ssi.c
> > @@ -59,9 +59,7 @@
> > #define SSIFSR_RDC_MASK 0x3f
> > #define SSIFSR_RDC_SHIFT 8
> >
> > -#define SSIFSR_TDC(x) (((x) & 0x1f) << 24)
> > #define SSIFSR_TDE BIT(16)
> > -#define SSIFSR_RDC(x) (((x) & 0x1f) << 8)
> > #define SSIFSR_RDF BIT(0)
> >
> > #define SSIOFR_LRCONT BIT(8)
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

2022-04-25 23:54:37

by Prabhakar

[permalink] [raw]
Subject: Re: [PATCH 1/3] ASoC: sh: rz-ssi: Drop unused macros

Hi Geert,

On Mon, Apr 25, 2022 at 5:14 PM Geert Uytterhoeven <[email protected]> wrote:
>
> Hi Prabhakar,
>
> On Mon, Apr 25, 2022 at 6:09 PM Lad, Prabhakar
> <[email protected]> wrote:
> > On Mon, Apr 25, 2022 at 1:49 PM Geert Uytterhoeven <[email protected]> wrote:
> > > On Fri, Apr 22, 2022 at 7:32 PM Lad Prabhakar
> > > <[email protected]> wrote:
> > > > Drop unused macros SSIFSR_TDC and SSIFSR_RDC.
> > > >
> > > > Reported-by: Nobuhiro Iwamatsu <[email protected]>
> > > > Signed-off-by: Lad Prabhakar <[email protected]>
> > >
> > > Thanks for your patch!
> > >
> > > What does this fix?
> > > Is the real issue that there are 32 FIFO entries, and the TDC and RDC
> > > fields are 6 bits wide, while the mask uses 0x1f instead of 0x3f?
> > >
> > I was in two minds here as you have already spotted the masks are
> > incorrect, instead of fixing the masks I choose to drop the macros
> > itself as they were not used. Let me know what are your thoughts on
> > this.
>
> IC.
>
> I don't have a preference.
> So please either remove them, and make it clear they were wrong,
> so no one is tempted to just revert the removal to start using the
> definitions, or either keep them, and fix the definitions.
>
I'll go with dropping them and make it clear they were wrong.

Cheers,
Prabhakar

> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

2022-04-26 08:37:27

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/3] ASoC: sh: rz-ssi: Drop unused macros

Hi Prabhakar,

On Mon, Apr 25, 2022 at 6:09 PM Lad, Prabhakar
<[email protected]> wrote:
> On Mon, Apr 25, 2022 at 1:49 PM Geert Uytterhoeven <[email protected]> wrote:
> > On Fri, Apr 22, 2022 at 7:32 PM Lad Prabhakar
> > <[email protected]> wrote:
> > > Drop unused macros SSIFSR_TDC and SSIFSR_RDC.
> > >
> > > Reported-by: Nobuhiro Iwamatsu <[email protected]>
> > > Signed-off-by: Lad Prabhakar <[email protected]>
> >
> > Thanks for your patch!
> >
> > What does this fix?
> > Is the real issue that there are 32 FIFO entries, and the TDC and RDC
> > fields are 6 bits wide, while the mask uses 0x1f instead of 0x3f?
> >
> I was in two minds here as you have already spotted the masks are
> incorrect, instead of fixing the masks I choose to drop the macros
> itself as they were not used. Let me know what are your thoughts on
> this.

IC.

I don't have a preference.
So please either remove them, and make it clear they were wrong,
so no one is tempted to just revert the removal to start using the
definitions, or either keep them, and fix the definitions.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds