Skip to contentSkip to conversation

staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

PATCH Superseded Lisa Nguyen 3 participants 10 messages Oct 28, 2013 – Dec 10, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

Rewrite the return statement in vpfe_video.c to eliminate the use of a ternary operator. This will prevent the checkpatch.pl script from generating a warning saying to remove () from this particular return statement.

---
 drivers/staging/media/davinci_vpfe/vpfe_video.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/media/davinci_vpfe/vpfe_video.c +4 -1
index 24d98a6..49aafe4 100644
@@ -346,7 +346,10 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe)
 	}
 	mutex_unlock(&mdev->graph_mutex);
 
-	return (ret == 0) ? ret : -ETIMEDOUT ;
+	if (ret == 0)
+		return ret;
+	else
+		return -ETIMEDOUT;
 }
 
 /*
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/2 staging: media: davinci_vpfe: Remove spaces before semicolons

Remove unnecessary spaces before semicolons to meet kernel coding style.

---
 drivers/staging/media/davinci_vpfe/dm365_ipipe.c    | 2 +-
 drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 4 ++--
 drivers/staging/media/davinci_vpfe/dm365_isif.c     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +1 -1
index 766a071..b7044a3 100644
@@ -1009,7 +1009,7 @@ static int ipipe_validate_yee_params(struct vpfe_ipipe_yee *yee)
 	    yee->es_ofst_grad > YEE_THR_MASK)
 		return -EINVAL;
 
-	for (i = 0; i < VPFE_IPIPE_MAX_SIZE_YEE_LUT ; i++)
+	for (i = 0; i < VPFE_IPIPE_MAX_SIZE_YEE_LUT; i++)
 		if (yee->table[i] > YEE_ENTRY_MASK)
 			return -EINVAL;
 
drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +2 -2
index e027b92..2d36b60 100644
@@ -791,7 +791,7 @@ ipipe_set_3d_lut_regs(void *__iomem base_addr, void *__iomem isp5_base_addr,
 
 	/* valied table */
 	tbl = lut_3d->table;
-	for (i = 0 ; i < VPFE_IPIPE_MAX_SIZE_3D_LUT; i++) {
+	for (i = 0; i < VPFE_IPIPE_MAX_SIZE_3D_LUT; i++) {
 		/* Each entry has 0-9 (B), 10-19 (G) and
 		20-29 R values */
 		val = tbl[i].b & D3_LUT_ENTRY_MASK;
@@ -899,7 +899,7 @@ ipipe_set_gbce_regs(void *__iomem base_addr, void *__iomem isp5_base_addr,
 	if (!gbce->table)
 		return;
 
-	for (count = 0; count < VPFE_IPIPE_MAX_SIZE_GBCE_LUT ; count += 2)
+	for (count = 0; count < VPFE_IPIPE_MAX_SIZE_GBCE_LUT; count += 2)
 		w_ip_table(isp5_base_addr, ((gbce->table[count + 1] & mask) <<
 		GBCE_ENTRY_SHIFT) | (gbce->table[count] & mask),
 		((count/2) << 2) + GBCE_TB_START_ADDR);
drivers/staging/media/davinci_vpfe/dm365_isif.c +1 -1
index ff48fce..4171cfd 100644
@@ -918,7 +918,7 @@ isif_config_dfc(struct vpfe_isif_device *isif, struct vpfe_isif_dfc *vdfc)
 		   (0 << ISIF_VDFC_EN_SHIFT), DFCCTL);
 
 	isif_write(isif->isif_cfg.base_addr, 0x6, DFCMEMCTL);
-	for (i = 0 ; i < vdfc->num_vdefects; i++) {
+	for (i = 0; i < vdfc->num_vdefects; i++) {
 		count = DFC_WRITE_WAIT_COUNT;
 		while (count &&
 			(isif_read(isif->isif_cfg.base_addr, DFCMEMCTL) & 0x2))
Signature · 1 line
1.8.1.2
#3 lore raw

Re: [PATCH 2/2] staging: media: davinci_vpfe: Remove spaces before semicolons

Hi Prabhakar,

Quoted 7 lines · On Wednesday 30 October 2013 13:20:25 Prabhakar Lad wrote:
Quoted 4 lines · Lisa Nguyen

Remove unnecessary spaces before semicolons to meet kernel coding style.

Do you plan to send a pull request for these two patches ?

Signature · 3 lines
Regards,

Laurent Pinchart
#4 lore raw

Re: [PATCH 2/2] staging: media: davinci_vpfe: Remove spaces before semicolons

Hi Laurent,

Quoted 4 lines · Laurent Pinchart

Hi Prabhakar,

Quoted 1 line · On Wednesday 30 October 2013 13:20:25 Prabhakar Lad wrote:

On Tue, Oct 29, 2013 at 2:53 AM, Lisa Nguyen <[email protected]> wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Remove unnecessary spaces before semicolons to meet kernel coding style.

Do you plan to send a pull request for these two patches ?

I had asked for a change in the first patch but Lisa never turned back :( anyway I'll fix it and issue a pull request today to Mauro.

Thanks,
--Prabhakar Lad

#5 lore raw

Re: [PATCH 2/2] staging: media: davinci_vpfe: Remove spaces before semicolons

Hi everyone,

Quoted 11 lines · Prabhakar Lad

Hi Laurent,

Quoted 7 lines · Laurent Pinchart

Hi Prabhakar,

Quoted 4 lines · On Wednesday 30 October 2013 13:20:25 Prabhakar Lad wrote:
Quoted 3 lines · Lisa Nguyen

Remove unnecessary spaces before semicolons to meet kernel coding style.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Do you plan to send a pull request for these two patches ?

I had asked for a change in the first patch but Lisa never turned back :( anyway I'll fix it and issue a pull request today to Mauro.

My apologies. What happened was that I originally had sent these two patches to the staging mailing list. Greg KH advised me to send these to Mauro and the linux-media mailing list instead. As a result, there was a debate about the way the return statement was written in my first patch between Greg and a fellow developer, so I wasn't sure who to listen to. I was in the midst of changing jobs, so this didn't take top priority.

Again, sorry, but I thank you for considering my patches.

Lisa

#6 lore raw

Re: [PATCH 2/2] staging: media: davinci_vpfe: Remove spaces before semicolons

Hi Lisa,

Quoted 24 lines · Lisa Nguyen

Hi everyone,

Quoted 11 lines · Prabhakar Lad

Hi Laurent,

Quoted 7 lines · Laurent Pinchart

Hi Prabhakar,

Quoted 4 lines · On Wednesday 30 October 2013 13:20:25 Prabhakar Lad wrote:
Quoted 3 lines · Lisa Nguyen

Remove unnecessary spaces before semicolons to meet kernel coding style.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Do you plan to send a pull request for these two patches ?

I had asked for a change in the first patch but Lisa never turned back :( anyway I'll fix it and issue a pull request today to Mauro.

Quoted 8 lines

My apologies. What happened was that I originally had sent these two patches to the staging mailing list. Greg KH advised me to send these to Mauro and the linux-media mailing list instead. As a result, there was a debate about the way the return statement was written in my first patch between Greg and a fellow developer, so I wasn't sure who to listen to. I was in the midst of changing jobs, so this didn't take top priority.

Ok, do you plan to post it now ?

Regards,
--Prabhakar Lad

#7 lore raw

Re: [PATCH 2/2] staging: media: davinci_vpfe: Remove spaces before semicolons

Hi Prabhakar,

Quoted 35 lines · Prabhakar Lad

Hi Lisa,

Quoted 24 lines · Lisa Nguyen

Hi everyone,

Quoted 11 lines · Prabhakar Lad

Hi Laurent,

Quoted 7 lines · Laurent Pinchart

Hi Prabhakar,

Quoted 4 lines · On Wednesday 30 October 2013 13:20:25 Prabhakar Lad wrote:
Quoted 3 lines · Lisa Nguyen

Remove unnecessary spaces before semicolons to meet kernel coding style.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Do you plan to send a pull request for these two patches ?

I had asked for a change in the first patch but Lisa never turned back :( anyway I'll fix it and issue a pull request today to Mauro.

Quoted 8 lines

My apologies. What happened was that I originally had sent these two patches to the staging mailing list. Greg KH advised me to send these to Mauro and the linux-media mailing list instead. As a result, there was a debate about the way the return statement was written in my first patch between Greg and a fellow developer, so I wasn't sure who to listen to. I was in the midst of changing jobs, so this didn't take top priority.

Quoted 1 line

Ok, do you plan to post it now ?

To be clear, I'd only have to update the first patch, correct?

#8 lore raw

Re: [PATCH 2/2] staging: media: davinci_vpfe: Remove spaces before semicolons

Hi Lisa,

Quoted 39 lines · Lisa Nguyen

Hi Prabhakar,

Quoted 35 lines · Prabhakar Lad

Hi Lisa,

Quoted 32 lines · Lisa Nguyen

Hi everyone,

Quoted 11 lines · Prabhakar Lad

Hi Laurent,

Quoted 7 lines · Laurent Pinchart

Hi Prabhakar,

Quoted 4 lines · On Wednesday 30 October 2013 13:20:25 Prabhakar Lad wrote:
Quoted 3 lines · Lisa Nguyen

Remove unnecessary spaces before semicolons to meet kernel coding style.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Do you plan to send a pull request for these two patches ?

I had asked for a change in the first patch but Lisa never turned back :( anyway I'll fix it and issue a pull request today to Mauro.

My apologies. What happened was that I originally had sent these two patches to the staging mailing list. Greg KH advised me to send these to Mauro and the linux-media mailing list instead. As a result, there was a debate about the way the return statement was written in my first patch between Greg and a fellow developer, so I wasn't sure who to listen to. I was in the midst of changing jobs, so this didn't take top priority.

Quoted 3 lines
Quoted 1 line

Ok, do you plan to post it now ?

To be clear, I'd only have to update the first patch, correct?

Yes!

Regards,
--Prabhakar Lad

#9 lore raw
In reply to Lisa Nguyen

Hi Lisa,

Thanks for the patch.

Quoted 15 lines · Lisa Nguyen

Rewrite the return statement in vpfe_video.c to eliminate the use of a ternary operator. This will prevent the checkpatch.pl script from generating a warning saying to remove () from this particular return statement.

---
 drivers/staging/media/davinci_vpfe/vpfe_video.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/media/davinci_vpfe/vpfe_video.c +0 -0
index 24d98a6..49aafe4 100644

drivers/staging/media/davinci_vpfe/vpfe_video.c static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) · line 351

Quoted 7 lines
drivers/staging/media/davinci_vpfe/vpfe_video.c +3 -1
@@ -346,7 +346,10 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe)
        }
        mutex_unlock(&mdev->graph_mutex);
 
-       return (ret == 0) ? ret : -ETIMEDOUT ;
+       if (ret == 0)
+               return ret;
+       else

I would remove this else and align the below return statement.

drivers/staging/media/davinci_vpfe/vpfe_video.c static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) · line 355

Quoted 4 lines
drivers/staging/media/davinci_vpfe/vpfe_video.c +1 -0
+               return -ETIMEDOUT;
 }
 
 /*

Regards,
--Prabhakar Lad