2021-04-12 12:58:10

by Aline Santana Cordeiro

[permalink] [raw]
Subject: [Outreachy kernel][PATCH 1/4 v2] staging: media: omap4iss: Replace macro function by static inline function in file iss.c

Replace macro function by static inline function.
Issue suggested by Julia.

Signed-off-by: Aline Santana Cordeiro <[email protected]>
---

Changes since v1:
- Insert file path in commit message

drivers/staging/media/omap4iss/iss.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
index c89f268a..3bbc39e 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -27,22 +27,24 @@
#include "iss.h"
#include "iss_regs.h"

-#define ISS_PRINT_REGISTER(iss, name)\
- dev_dbg(iss->dev, "###ISS " #name "=0x%08x\n", \
- iss_reg_read(iss, OMAP4_ISS_MEM_TOP, ISS_##name))
+static inline iss_print_register(iss, name)
+{
+ dev_dbg(iss->dev, "###ISS " #name "=0x%08x\n",
+ iss_reg_read(iss, OMAP4_ISS_MEM_TOP, ISS_##name));
+}

static void iss_print_status(struct iss_device *iss)
{
dev_dbg(iss->dev, "-------------ISS HL Register dump-------------\n");

- ISS_PRINT_REGISTER(iss, HL_REVISION);
- ISS_PRINT_REGISTER(iss, HL_SYSCONFIG);
- ISS_PRINT_REGISTER(iss, HL_IRQSTATUS(5));
- ISS_PRINT_REGISTER(iss, HL_IRQENABLE_SET(5));
- ISS_PRINT_REGISTER(iss, HL_IRQENABLE_CLR(5));
- ISS_PRINT_REGISTER(iss, CTRL);
- ISS_PRINT_REGISTER(iss, CLKCTRL);
- ISS_PRINT_REGISTER(iss, CLKSTAT);
+ iss_print_register(iss, HL_REVISION);
+ iss_print_register(iss, HL_SYSCONFIG);
+ iss_print_register(iss, HL_IRQSTATUS(5));
+ iss_print_register(iss, HL_IRQENABLE_SET(5));
+ iss_print_register(iss, HL_IRQENABLE_CLR(5));
+ iss_print_register(iss, CTRL);
+ iss_print_register(iss, CLKCTRL);
+ iss_print_register(iss, CLKSTAT);

dev_dbg(iss->dev, "-----------------------------------------------\n");
}
--
2.7.4


2021-04-12 13:42:15

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [Outreachy kernel][PATCH 1/4 v2] staging: media: omap4iss: Replace macro function by static inline function in file iss.c

Hi Aline,

While testing on a device isn't a requirement as you can't be expected
to have the necessary hardware, changes are expected to be at least
compile-tested before being submitted.

On Mon, Apr 12, 2021 at 09:57:09AM -0300, Aline Santana Cordeiro wrote:
> Replace macro function by static inline function.
> Issue suggested by Julia.
>
> Signed-off-by: Aline Santana Cordeiro <[email protected]>
> ---
>
> Changes since v1:
> - Insert file path in commit message
>
> drivers/staging/media/omap4iss/iss.c | 24 +++++++++++++-----------
> 1 file changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
> index c89f268a..3bbc39e 100644
> --- a/drivers/staging/media/omap4iss/iss.c
> +++ b/drivers/staging/media/omap4iss/iss.c
> @@ -27,22 +27,24 @@
> #include "iss.h"
> #include "iss_regs.h"
>
> -#define ISS_PRINT_REGISTER(iss, name)\
> - dev_dbg(iss->dev, "###ISS " #name "=0x%08x\n", \
> - iss_reg_read(iss, OMAP4_ISS_MEM_TOP, ISS_##name))
> +static inline iss_print_register(iss, name)
> +{
> + dev_dbg(iss->dev, "###ISS " #name "=0x%08x\n",
> + iss_reg_read(iss, OMAP4_ISS_MEM_TOP, ISS_##name));
> +}
>
> static void iss_print_status(struct iss_device *iss)
> {
> dev_dbg(iss->dev, "-------------ISS HL Register dump-------------\n");
>
> - ISS_PRINT_REGISTER(iss, HL_REVISION);
> - ISS_PRINT_REGISTER(iss, HL_SYSCONFIG);
> - ISS_PRINT_REGISTER(iss, HL_IRQSTATUS(5));
> - ISS_PRINT_REGISTER(iss, HL_IRQENABLE_SET(5));
> - ISS_PRINT_REGISTER(iss, HL_IRQENABLE_CLR(5));
> - ISS_PRINT_REGISTER(iss, CTRL);
> - ISS_PRINT_REGISTER(iss, CLKCTRL);
> - ISS_PRINT_REGISTER(iss, CLKSTAT);
> + iss_print_register(iss, HL_REVISION);
> + iss_print_register(iss, HL_SYSCONFIG);
> + iss_print_register(iss, HL_IRQSTATUS(5));
> + iss_print_register(iss, HL_IRQENABLE_SET(5));
> + iss_print_register(iss, HL_IRQENABLE_CLR(5));
> + iss_print_register(iss, CTRL);
> + iss_print_register(iss, CLKCTRL);
> + iss_print_register(iss, CLKSTAT);
>
> dev_dbg(iss->dev, "-----------------------------------------------\n");
> }

--
Regards,

Laurent Pinchart

2021-04-12 17:31:43

by Aline Santana Cordeiro

[permalink] [raw]
Subject: Re: [Outreachy kernel][PATCH 1/4 v2] staging: media: omap4iss: Replace macro function by static inline function in file iss.c

Em seg, 2021-04-12 às 18:11 +0300, Laurent Pinchart escreveu:
> Hi Aline,
>
> On Mon, Apr 12, 2021 at 10:58:45AM -0300, ascordeiro wrote:
> > Em seg, 2021-04-12 às 16:40 +0300, Laurent Pinchart escreveu:
> > > While testing on a device isn't a requirement as you can't be
> > > expected
> > > to have the necessary hardware, changes are expected to be at
> > > least
> > > compile-tested before being submitted.
> >
> > Hi Laurent,
> >
> > I thought recompiling the kernel would be enough in this case.
> > I recompiled it in native Ubuntu 16.04 without errors.
>
> Did it compile the driver you modified ?
>
I'm sorry, It didn't. I forgot to enable the option to compile the
driver as a module in "make menuconfig" and now I'm seeing the problems
I generated.

Thank you for warning me,
Aline

2021-04-12 17:38:55

by Julia Lawall

[permalink] [raw]
Subject: Re: [Outreachy kernel][PATCH 1/4 v2] staging: media: omap4iss: Replace macro function by static inline function in file iss.c



On Mon, 12 Apr 2021, ascordeiro wrote:

> Em seg, 2021-04-12 às 18:11 +0300, Laurent Pinchart escreveu:
> > Hi Aline,
> >
> > On Mon, Apr 12, 2021 at 10:58:45AM -0300, ascordeiro wrote:
> > > Em seg, 2021-04-12 às 16:40 +0300, Laurent Pinchart escreveu:
> > > > While testing on a device isn't a requirement as you can't be
> > > > expected
> > > > to have the necessary hardware, changes are expected to be at
> > > > least
> > > > compile-tested before being submitted.
> > >
> > > Hi Laurent,
> > >
> > > I thought recompiling the kernel would be enough in this case.
> > > I recompiled it in native Ubuntu 16.04 without errors.
> >
> > Did it compile the driver you modified ?
> >
> I'm sorry, It didn't. I forgot to enable the option to compile the
> driver as a module in "make menuconfig" and now I'm seeing the problems
> I generated.

You can easily compile a single file using make path/foo.o and a single
directory using make path/.

julia

2021-04-12 17:44:59

by Aline Santana Cordeiro

[permalink] [raw]
Subject: Re: [Outreachy kernel][PATCH 1/4 v2] staging: media: omap4iss: Replace macro function by static inline function in file iss.c

Em seg, 2021-04-12 às 19:36 +0200, Julia Lawall escreveu:
>
>
> On Mon, 12 Apr 2021, ascordeiro wrote:
>
> > Em seg, 2021-04-12 às 18:11 +0300, Laurent Pinchart escreveu:
> > > Hi Aline,
> > >
> > > On Mon, Apr 12, 2021 at 10:58:45AM -0300, ascordeiro wrote:
> > > > Em seg, 2021-04-12 às 16:40 +0300, Laurent Pinchart escreveu:
> > > > > While testing on a device isn't a requirement as you can't be
> > > > > expected
> > > > > to have the necessary hardware, changes are expected to be at
> > > > > least
> > > > > compile-tested before being submitted.
> > > >
> > > > Hi Laurent,
> > > >
> > > > I thought recompiling the kernel would be enough in this case.
> > > > I recompiled it in native Ubuntu 16.04 without errors.
> > >
> > > Did it compile the driver you modified ?
> > >
> > I'm sorry, It didn't. I forgot to enable the option to compile the
> > driver as a module in "make menuconfig" and now I'm seeing the
> > problems
> > I generated.
>
> You can easily compile a single file using make path/foo.o and a
> single
> directory using make path/.
>
> julia

Ok! I'll do that from now on.

Thank you for the help,
Aline

2021-04-13 03:14:00

by Aline Santana Cordeiro

[permalink] [raw]
Subject: Re: [Outreachy kernel][PATCH 1/4 v2] staging: media: omap4iss: Replace macro function by static inline function in file iss.c

Em seg, 2021-04-12 às 16:40 +0300, Laurent Pinchart escreveu:
> While testing on a device isn't a requirement as you can't be
> expected
> to have the necessary hardware, changes are expected to be at least
> compile-tested before being submitted.

Hi Laurent,

I thought recompiling the kernel would be enough in this case.
I recompiled it in native Ubuntu 16.04 without errors.

Thank you for the feedback.
Aline

2021-04-13 03:36:58

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [Outreachy kernel][PATCH 1/4 v2] staging: media: omap4iss: Replace macro function by static inline function in file iss.c

Hi Aline,

On Mon, Apr 12, 2021 at 10:58:45AM -0300, ascordeiro wrote:
> Em seg, 2021-04-12 às 16:40 +0300, Laurent Pinchart escreveu:
> > While testing on a device isn't a requirement as you can't be expected
> > to have the necessary hardware, changes are expected to be at least
> > compile-tested before being submitted.
>
> Hi Laurent,
>
> I thought recompiling the kernel would be enough in this case.
> I recompiled it in native Ubuntu 16.04 without errors.

Did it compile the driver you modified ?

--
Regards,

Laurent Pinchart