All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] patchset for clean-ups in media
@ 2020-03-13 20:47 Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 1/5] staging: media: allegro: align with parenthesis Kaaira Gupta
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 20:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel; +Cc: Kaaira Gupta

This patchset contains cleanups for staging driver `media`.
It removes a few unnecessary parentheses and temporary variables. It
also aligns lines with open parentheses and adds parentheses around and
argument in a macro to make the macro safe of any precedence issues that
might come.

Kaaira Gupta (5):
  staging: media: allegro: align with parenthesis
  staging: media: imx: remove temporary variable
  staging: media: imx: remove parentheses
  staging: media: hanto: remove parentheses
  staging: media: hantro: add parentheses

 drivers/staging/media/allegro-dvt/allegro-core.c | 12 ++++++------
 drivers/staging/media/hantro/hantro_postproc.c   |  4 ++--
 drivers/staging/media/imx/imx6-mipi-csi2.c       |  9 +++------
 drivers/staging/media/imx/imx7-mipi-csis.c       |  2 +-
 4 files changed, 12 insertions(+), 15 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] staging: media: allegro: align with parenthesis
  2020-03-13 20:47 [PATCH 0/5] patchset for clean-ups in media Kaaira Gupta
@ 2020-03-13 20:47 ` Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 2/5] staging: media: imx: remove temporary variable Kaaira Gupta
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 20:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel; +Cc: Kaaira Gupta

Align the lines of allegro-core.c with open parenthesis by giving proper
tabs and thereby fix checkpatch.pl warnings of matching alignment with
open parenthesis. Do it only for lines where character limit doesn't
exceed 80 characters.

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
 drivers/staging/media/allegro-dvt/allegro-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c
index 0a09b3622e78..1162cc38f3fc 100644
--- a/drivers/staging/media/allegro-dvt/allegro-core.c
+++ b/drivers/staging/media/allegro-dvt/allegro-core.c
@@ -2324,10 +2324,10 @@ static int allegro_open(struct file *file)
 			0, ALLEGRO_GOP_SIZE_MAX,
 			1, channel->gop_size);
 	v4l2_ctrl_new_std(handler,
-			&allegro_ctrl_ops,
-			V4L2_CID_MIN_BUFFERS_FOR_OUTPUT,
-			1, 32,
-			1, 1);
+			  &allegro_ctrl_ops,
+			  V4L2_CID_MIN_BUFFERS_FOR_OUTPUT,
+			  1, 32,
+			  1, 1);
 	channel->fh.ctrl_handler = handler;
 
 	channel->mcu_channel_id = -1;
@@ -2933,8 +2933,8 @@ static int allegro_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 	sram_regs = devm_ioremap(&pdev->dev,
-					 sram_res->start,
-					 resource_size(sram_res));
+				 sram_res->start,
+				 resource_size(sram_res));
 	if (IS_ERR(sram_regs)) {
 		dev_err(&pdev->dev, "failed to map sram\n");
 		return PTR_ERR(sram_regs);
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/5] staging: media: imx: remove temporary variable
  2020-03-13 20:47 [PATCH 0/5] patchset for clean-ups in media Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 1/5] staging: media: allegro: align with parenthesis Kaaira Gupta
@ 2020-03-13 20:47 ` Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 3/5] staging: media: imx: remove parentheses Kaaira Gupta
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 20:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel; +Cc: Kaaira Gupta

Remove unnecessary local variable `ret` in file `imx6-mipi-csi2.c` and
directly returning the value assigned to `ret.`

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
 drivers/staging/media/imx/imx6-mipi-csi2.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/imx/imx6-mipi-csi2.c b/drivers/staging/media/imx/imx6-mipi-csi2.c
index cd3dd6e33ef0..8ab823042c09 100644
--- a/drivers/staging/media/imx/imx6-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx6-mipi-csi2.c
@@ -592,22 +592,19 @@ static int csi2_probe(struct platform_device *pdev)
 	csi2->pllref_clk = devm_clk_get(&pdev->dev, "ref");
 	if (IS_ERR(csi2->pllref_clk)) {
 		v4l2_err(&csi2->sd, "failed to get pll reference clock\n");
-		ret = PTR_ERR(csi2->pllref_clk);
-		return ret;
+		return PTR_ERR(csi2->pllref_clk);
 	}
 
 	csi2->dphy_clk = devm_clk_get(&pdev->dev, "dphy");
 	if (IS_ERR(csi2->dphy_clk)) {
 		v4l2_err(&csi2->sd, "failed to get dphy clock\n");
-		ret = PTR_ERR(csi2->dphy_clk);
-		return ret;
+		return PTR_ERR(csi2->dphy_clk);
 	}
 
 	csi2->pix_clk = devm_clk_get(&pdev->dev, "pix");
 	if (IS_ERR(csi2->pix_clk)) {
 		v4l2_err(&csi2->sd, "failed to get pixel clock\n");
-		ret = PTR_ERR(csi2->pix_clk);
-		return ret;
+		return PTR_ERR(csi2->pix_clk);
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/5] staging: media: imx: remove parentheses
  2020-03-13 20:47 [PATCH 0/5] patchset for clean-ups in media Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 1/5] staging: media: allegro: align with parenthesis Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 2/5] staging: media: imx: remove temporary variable Kaaira Gupta
@ 2020-03-13 20:47 ` Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 4/5] staging: media: hanto: " Kaaira Gupta
  2020-03-13 20:47 ` [PATCH 5/5] staging: media: hantro: add parentheses Kaaira Gupta
  4 siblings, 0 replies; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 20:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel; +Cc: Kaaira Gupta

Remove unnecessary parentheses around a binary OR in file
imx7-mipi-csis.c. Check reported by coccinelle.

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
 drivers/staging/media/imx/imx7-mipi-csis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index 383abecb3bec..fff676a54990 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -404,7 +404,7 @@ static void mipi_csis_set_hsync_settle(struct csi_state *state, int hs_settle)
 {
 	u32 val = mipi_csis_read(state, MIPI_CSIS_DPHYCTRL);
 
-	val = ((val & ~MIPI_CSIS_DPHYCTRL_HSS_MASK) | (hs_settle << 24));
+	val = (val & ~MIPI_CSIS_DPHYCTRL_HSS_MASK) | (hs_settle << 24);
 
 	mipi_csis_write(state, MIPI_CSIS_DPHYCTRL, val);
 }
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/5] staging: media: hanto: remove parentheses
  2020-03-13 20:47 [PATCH 0/5] patchset for clean-ups in media Kaaira Gupta
                   ` (2 preceding siblings ...)
  2020-03-13 20:47 ` [PATCH 3/5] staging: media: imx: remove parentheses Kaaira Gupta
@ 2020-03-13 20:47 ` Kaaira Gupta
  2020-03-13 21:06   ` [Outreachy kernel] " Julia Lawall
  2020-03-13 20:47 ` [PATCH 5/5] staging: media: hantro: add parentheses Kaaira Gupta
  4 siblings, 1 reply; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 20:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel; +Cc: Kaaira Gupta

Remove unnecessary parentheses in file hantro_postproc.c. Check reported
by coccinelle.

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
 drivers/staging/media/hantro/hantro_postproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
index 28a85d301d7f..d99238f4753c 100644
--- a/drivers/staging/media/hantro/hantro_postproc.c
+++ b/drivers/staging/media/hantro/hantro_postproc.c
@@ -15,14 +15,14 @@
 #define HANTRO_PP_REG_WRITE(vpu, reg_name, val) \
 { \
 	hantro_reg_write((vpu), \
-			 &((vpu)->variant->postproc_regs->reg_name), \
+			 &(vpu)->variant->postproc_regs->reg_name, \
 			 (val)); \
 }
 
 #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
 { \
 	hantro_reg_write_s((vpu), \
-			   &((vpu)->variant->postproc_regs->reg_name), \
+			   &(vpu)->variant->postproc_regs->reg_name, \
 			   (val)); \
 }
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/5] staging: media: hantro: add parentheses
  2020-03-13 20:47 [PATCH 0/5] patchset for clean-ups in media Kaaira Gupta
                   ` (3 preceding siblings ...)
  2020-03-13 20:47 ` [PATCH 4/5] staging: media: hanto: " Kaaira Gupta
@ 2020-03-13 20:47 ` Kaaira Gupta
  2020-03-13 21:05   ` [Outreachy kernel] " Julia Lawall
  4 siblings, 1 reply; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 20:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel; +Cc: Kaaira Gupta

Add parentheses around `reg_name` to be safe of precedence issues in
a Macro in file hantro_postproc.c. Warning reported by checkpatch.pl

Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
---
 drivers/staging/media/hantro/hantro_postproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
index d99238f4753c..c731cda822c2 100644
--- a/drivers/staging/media/hantro/hantro_postproc.c
+++ b/drivers/staging/media/hantro/hantro_postproc.c
@@ -22,7 +22,7 @@
 #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
 { \
 	hantro_reg_write_s((vpu), \
-			   &(vpu)->variant->postproc_regs->reg_name, \
+			   &(vpu)->variant->postproc_regs->(reg_name), \
 			   (val)); \
 }
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] staging: media: hantro: add parentheses
  2020-03-13 20:47 ` [PATCH 5/5] staging: media: hantro: add parentheses Kaaira Gupta
@ 2020-03-13 21:05   ` Julia Lawall
  2020-03-13 21:10     ` Kaaira Gupta
  2020-03-13 21:19     ` Kaaira Gupta
  0 siblings, 2 replies; 13+ messages in thread
From: Julia Lawall @ 2020-03-13 21:05 UTC (permalink / raw)
  To: Kaaira Gupta; +Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel



On Sat, 14 Mar 2020, Kaaira Gupta wrote:

> Add parentheses around `reg_name` to be safe of precedence issues in
> a Macro in file hantro_postproc.c. Warning reported by checkpatch.pl
>
> Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
> ---
>  drivers/staging/media/hantro/hantro_postproc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> index d99238f4753c..c731cda822c2 100644
> --- a/drivers/staging/media/hantro/hantro_postproc.c
> +++ b/drivers/staging/media/hantro/hantro_postproc.c
> @@ -22,7 +22,7 @@
>  #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
>  { \
>  	hantro_reg_write_s((vpu), \
> -			   &(vpu)->variant->postproc_regs->reg_name, \
> +			   &(vpu)->variant->postproc_regs->(reg_name), \

Does this compile?  I didn't know that you could put parentheses around a
field name.

Maybe the macro isn't actually used?

In any case, I don't think any precedence problem is possible.

julia

>  			   (val)); \
>  }
>
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313204739.32676-6-kgupta%40es.iitr.ac.in.
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 4/5] staging: media: hanto: remove parentheses
  2020-03-13 20:47 ` [PATCH 4/5] staging: media: hanto: " Kaaira Gupta
@ 2020-03-13 21:06   ` Julia Lawall
  2020-03-13 21:17     ` Kaaira Gupta
  0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2020-03-13 21:06 UTC (permalink / raw)
  To: Kaaira Gupta; +Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel



On Sat, 14 Mar 2020, Kaaira Gupta wrote:

> Remove unnecessary parentheses in file hantro_postproc.c. Check reported
> by coccinelle.
>
> Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
> ---
>  drivers/staging/media/hantro/hantro_postproc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> index 28a85d301d7f..d99238f4753c 100644
> --- a/drivers/staging/media/hantro/hantro_postproc.c
> +++ b/drivers/staging/media/hantro/hantro_postproc.c
> @@ -15,14 +15,14 @@
>  #define HANTRO_PP_REG_WRITE(vpu, reg_name, val) \
>  { \
>  	hantro_reg_write((vpu), \
> -			 &((vpu)->variant->postproc_regs->reg_name), \
> +			 &(vpu)->variant->postproc_regs->reg_name, \
>  			 (val)); \
>  }
>
>  #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
>  { \
>  	hantro_reg_write_s((vpu), \
> -			   &((vpu)->variant->postproc_regs->reg_name), \
> +			   &(vpu)->variant->postproc_regs->reg_name, \
>  			   (val)); \
>  }

I don't think that vpu and val need parentheses either, ie the occurrence
of vpu that is the first argument to hantro_reg_write_s.

julia

>
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313204739.32676-5-kgupta%40es.iitr.ac.in.
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] staging: media: hantro: add parentheses
  2020-03-13 21:05   ` [Outreachy kernel] " Julia Lawall
@ 2020-03-13 21:10     ` Kaaira Gupta
  2020-03-13 21:22       ` Julia Lawall
  2020-03-13 21:19     ` Kaaira Gupta
  1 sibling, 1 reply; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 21:10 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kaaira Gupta, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	outreachy-kernel

On Fri, Mar 13, 2020 at 10:05:08PM +0100, Julia Lawall wrote:
> 
> 
> On Sat, 14 Mar 2020, Kaaira Gupta wrote:
> 
> > Add parentheses around `reg_name` to be safe of precedence issues in
> > a Macro in file hantro_postproc.c. Warning reported by checkpatch.pl
> >
> > Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
> > ---
> >  drivers/staging/media/hantro/hantro_postproc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> > index d99238f4753c..c731cda822c2 100644
> > --- a/drivers/staging/media/hantro/hantro_postproc.c
> > +++ b/drivers/staging/media/hantro/hantro_postproc.c
> > @@ -22,7 +22,7 @@
> >  #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
> >  { \
> >  	hantro_reg_write_s((vpu), \
> > -			   &(vpu)->variant->postproc_regs->reg_name, \
> > +			   &(vpu)->variant->postproc_regs->(reg_name), \
> 
> Does this compile?  I didn't know that you could put parentheses around a
> field name.

Yes it compiles.

> 
> Maybe the macro isn't actually used?
> 
> In any case, I don't think any precedence problem is possible.

Yes, you are right. There won't be any precedence issues in this case.
Sorry for the misunderstanding.

Thanks!

> 
> julia
> 
> >  			   (val)); \
> >  }
> >
> > --
> > 2.17.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313204739.32676-6-kgupta%40es.iitr.ac.in.
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.2003132204070.2355%40hadrien.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 4/5] staging: media: hanto: remove parentheses
  2020-03-13 21:06   ` [Outreachy kernel] " Julia Lawall
@ 2020-03-13 21:17     ` Kaaira Gupta
  0 siblings, 0 replies; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 21:17 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kaaira Gupta, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	outreachy-kernel

On Fri, Mar 13, 2020 at 10:06:46PM +0100, Julia Lawall wrote:
> 
> 
> On Sat, 14 Mar 2020, Kaaira Gupta wrote:
> 
> > Remove unnecessary parentheses in file hantro_postproc.c. Check reported
> > by coccinelle.
> >
> > Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
> > ---
> >  drivers/staging/media/hantro/hantro_postproc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> > index 28a85d301d7f..d99238f4753c 100644
> > --- a/drivers/staging/media/hantro/hantro_postproc.c
> > +++ b/drivers/staging/media/hantro/hantro_postproc.c
> > @@ -15,14 +15,14 @@
> >  #define HANTRO_PP_REG_WRITE(vpu, reg_name, val) \
> >  { \
> >  	hantro_reg_write((vpu), \
> > -			 &((vpu)->variant->postproc_regs->reg_name), \
> > +			 &(vpu)->variant->postproc_regs->reg_name, \
> >  			 (val)); \
> >  }
> >
> >  #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
> >  { \
> >  	hantro_reg_write_s((vpu), \
> > -			   &((vpu)->variant->postproc_regs->reg_name), \
> > +			   &(vpu)->variant->postproc_regs->reg_name, \
> >  			   (val)); \
> >  }
> 
> I don't think that vpu and val need parentheses either, ie the occurrence
> of vpu that is the first argument to hantro_reg_write_s.

Yes, you are right! I'll remove them as well.
Thanks.

> 
> julia
> 
> >
> > --
> > 2.17.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313204739.32676-5-kgupta%40es.iitr.ac.in.
> >


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] staging: media: hantro: add parentheses
  2020-03-13 21:05   ` [Outreachy kernel] " Julia Lawall
  2020-03-13 21:10     ` Kaaira Gupta
@ 2020-03-13 21:19     ` Kaaira Gupta
  2020-03-13 21:23       ` Julia Lawall
  1 sibling, 1 reply; 13+ messages in thread
From: Kaaira Gupta @ 2020-03-13 21:19 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kaaira Gupta, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	outreachy-kernel

On Fri, Mar 13, 2020 at 10:05:08PM +0100, Julia Lawall wrote:
> 
> 
> On Sat, 14 Mar 2020, Kaaira Gupta wrote:
> 
> > Add parentheses around `reg_name` to be safe of precedence issues in
> > a Macro in file hantro_postproc.c. Warning reported by checkpatch.pl
> >
> > Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
> > ---
> >  drivers/staging/media/hantro/hantro_postproc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> > index d99238f4753c..c731cda822c2 100644
> > --- a/drivers/staging/media/hantro/hantro_postproc.c
> > +++ b/drivers/staging/media/hantro/hantro_postproc.c
> > @@ -22,7 +22,7 @@
> >  #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
> >  { \
> >  	hantro_reg_write_s((vpu), \
> > -			   &(vpu)->variant->postproc_regs->reg_name, \
> > +			   &(vpu)->variant->postproc_regs->(reg_name), \
> 
> Does this compile?  I didn't know that you could put parentheses around a
> field name.
> 
> Maybe the macro isn't actually used?
> 
> In any case, I don't think any precedence problem is possible.

In such a case where I have to remove a patch from the patchset, should
I send a different patchset or should I write in the log of the cover
letter that a patch was deleted?

> 
> julia
> 
> >  			   (val)); \
> >  }
> >
> > --
> > 2.17.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313204739.32676-6-kgupta%40es.iitr.ac.in.
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.2003132204070.2355%40hadrien.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] staging: media: hantro: add parentheses
  2020-03-13 21:10     ` Kaaira Gupta
@ 2020-03-13 21:22       ` Julia Lawall
  0 siblings, 0 replies; 13+ messages in thread
From: Julia Lawall @ 2020-03-13 21:22 UTC (permalink / raw)
  To: Kaaira Gupta; +Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel



On Sat, 14 Mar 2020, Kaaira Gupta wrote:

> On Fri, Mar 13, 2020 at 10:05:08PM +0100, Julia Lawall wrote:
> >
> >
> > On Sat, 14 Mar 2020, Kaaira Gupta wrote:
> >
> > > Add parentheses around `reg_name` to be safe of precedence issues in
> > > a Macro in file hantro_postproc.c. Warning reported by checkpatch.pl
> > >
> > > Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
> > > ---
> > >  drivers/staging/media/hantro/hantro_postproc.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> > > index d99238f4753c..c731cda822c2 100644
> > > --- a/drivers/staging/media/hantro/hantro_postproc.c
> > > +++ b/drivers/staging/media/hantro/hantro_postproc.c
> > > @@ -22,7 +22,7 @@
> > >  #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
> > >  { \
> > >  	hantro_reg_write_s((vpu), \
> > > -			   &(vpu)->variant->postproc_regs->reg_name, \
> > > +			   &(vpu)->variant->postproc_regs->(reg_name), \
> >
> > Does this compile?  I didn't know that you could put parentheses around a
> > field name.
>
> Yes it compiles.

It's not so easy to tell if a macro compiles.  You have to be sure that
the macro is actually used.

julia

>
> >
> > Maybe the macro isn't actually used?
> >
> > In any case, I don't think any precedence problem is possible.
>
> Yes, you are right. There won't be any precedence issues in this case.
> Sorry for the misunderstanding.
>
> Thanks!
>
> >
> > julia
> >
> > >  			   (val)); \
> > >  }
> > >
> > > --
> > > 2.17.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313204739.32676-6-kgupta%40es.iitr.ac.in.
> > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.2003132204070.2355%40hadrien.
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313211007.GA1084%40kaaira-HP-Pavilion-Notebook.
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] staging: media: hantro: add parentheses
  2020-03-13 21:19     ` Kaaira Gupta
@ 2020-03-13 21:23       ` Julia Lawall
  0 siblings, 0 replies; 13+ messages in thread
From: Julia Lawall @ 2020-03-13 21:23 UTC (permalink / raw)
  To: Kaaira Gupta; +Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, outreachy-kernel



On Sat, 14 Mar 2020, Kaaira Gupta wrote:

> On Fri, Mar 13, 2020 at 10:05:08PM +0100, Julia Lawall wrote:
> >
> >
> > On Sat, 14 Mar 2020, Kaaira Gupta wrote:
> >
> > > Add parentheses around `reg_name` to be safe of precedence issues in
> > > a Macro in file hantro_postproc.c. Warning reported by checkpatch.pl
> > >
> > > Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
> > > ---
> > >  drivers/staging/media/hantro/hantro_postproc.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> > > index d99238f4753c..c731cda822c2 100644
> > > --- a/drivers/staging/media/hantro/hantro_postproc.c
> > > +++ b/drivers/staging/media/hantro/hantro_postproc.c
> > > @@ -22,7 +22,7 @@
> > >  #define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \
> > >  { \
> > >  	hantro_reg_write_s((vpu), \
> > > -			   &(vpu)->variant->postproc_regs->reg_name, \
> > > +			   &(vpu)->variant->postproc_regs->(reg_name), \
> >
> > Does this compile?  I didn't know that you could put parentheses around a
> > field name.
> >
> > Maybe the macro isn't actually used?
> >
> > In any case, I don't think any precedence problem is possible.
>
> In such a case where I have to remove a patch from the patchset, should
> I send a different patchset or should I write in the log of the cover
> letter that a patch was deleted?

Explaining the change in the log would be fine.  eg

v2: renumbered the patch to account for a deleted patch in the series

julia

>
> >
> > julia
> >
> > >  			   (val)); \
> > >  }
> > >
> > > --
> > > 2.17.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200313204739.32676-6-kgupta%40es.iitr.ac.in.
> > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.2003132204070.2355%40hadrien.
>


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-03-13 21:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 20:47 [PATCH 0/5] patchset for clean-ups in media Kaaira Gupta
2020-03-13 20:47 ` [PATCH 1/5] staging: media: allegro: align with parenthesis Kaaira Gupta
2020-03-13 20:47 ` [PATCH 2/5] staging: media: imx: remove temporary variable Kaaira Gupta
2020-03-13 20:47 ` [PATCH 3/5] staging: media: imx: remove parentheses Kaaira Gupta
2020-03-13 20:47 ` [PATCH 4/5] staging: media: hanto: " Kaaira Gupta
2020-03-13 21:06   ` [Outreachy kernel] " Julia Lawall
2020-03-13 21:17     ` Kaaira Gupta
2020-03-13 20:47 ` [PATCH 5/5] staging: media: hantro: add parentheses Kaaira Gupta
2020-03-13 21:05   ` [Outreachy kernel] " Julia Lawall
2020-03-13 21:10     ` Kaaira Gupta
2020-03-13 21:22       ` Julia Lawall
2020-03-13 21:19     ` Kaaira Gupta
2020-03-13 21:23       ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.