[2/2] staging/media: Fix trailing statements should be on next line in go7007/go7007-fw.c

Message ID 1352115573-8321-1-git-send-email-yamanetoshi@gmail.com (mailing list archive)
State Rejected, archived
Headers

Commit Message

YAMANE Toshiaki Nov. 5, 2012, 11:39 a.m. UTC
  fixed below checkpatch error.
- ERROR: trailing statements should be on next line

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
---
 drivers/staging/media/go7007/go7007-fw.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Mauro Carvalho Chehab Dec. 21, 2012, 8:43 p.m. UTC | #1
Em Mon,  5 Nov 2012 20:39:33 +0900
YAMANE Toshiaki <yamanetoshi@gmail.com> escreveu:

> fixed below checkpatch error.
> - ERROR: trailing statements should be on next line
> 
> Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
> ---
>  drivers/staging/media/go7007/go7007-fw.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/go7007/go7007-fw.c b/drivers/staging/media/go7007/go7007-fw.c
> index f99c05b..cfce760 100644
> --- a/drivers/staging/media/go7007/go7007-fw.c
> +++ b/drivers/staging/media/go7007/go7007-fw.c
> @@ -725,7 +725,8 @@ static int vti_bitlen(struct go7007 *go)
>  {
>  	unsigned int i, max_time_incr = go->sensor_framerate / go->fps_scale;
>  
> -	for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i);
> +	for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i)
> +		;

Nah, this doesn't sound right to me. IMO, in this specific case,
checkpatch.pl did a bad job.

At least on my eyes, the first line is easier to read than the other
two ones.

>  	return i + 1;
>  }
>  


Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Joe Perches Dec. 22, 2012, 7:20 a.m. UTC | #2
On Fri, 2012-12-21 at 18:43 -0200, Mauro Carvalho Chehab wrote:
> Em Mon,  5 Nov 2012 20:39:33 +0900
> YAMANE Toshiaki <yamanetoshi@gmail.com> escreveu:
> 
> > fixed below checkpatch error.
> > - ERROR: trailing statements should be on next line
> > 
> > Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
> > ---
> >  drivers/staging/media/go7007/go7007-fw.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/media/go7007/go7007-fw.c b/drivers/staging/media/go7007/go7007-fw.c
> > index f99c05b..cfce760 100644
> > --- a/drivers/staging/media/go7007/go7007-fw.c
> > +++ b/drivers/staging/media/go7007/go7007-fw.c
> > @@ -725,7 +725,8 @@ static int vti_bitlen(struct go7007 *go)
> >  {
> >  	unsigned int i, max_time_incr = go->sensor_framerate / go->fps_scale;
> >  
> > -	for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i);
> > +	for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i)
> > +		;
> 
> Nah, this doesn't sound right to me. IMO, in this specific case,
> checkpatch.pl did a bad job.

Is this even guaranteed to exit the loop?
Maybe using ffs would be more sensible.


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/staging/media/go7007/go7007-fw.c b/drivers/staging/media/go7007/go7007-fw.c
index f99c05b..cfce760 100644
--- a/drivers/staging/media/go7007/go7007-fw.c
+++ b/drivers/staging/media/go7007/go7007-fw.c
@@ -725,7 +725,8 @@  static int vti_bitlen(struct go7007 *go)
 {
 	unsigned int i, max_time_incr = go->sensor_framerate / go->fps_scale;
 
-	for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i);
+	for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i)
+		;
 	return i + 1;
 }