[v2,media] em28xx-cards: remove a wrong indent level

Message ID 20140305110937.GC16926@elgon.mountain (mailing list archive)
State Accepted, archived
Delegated to: Hans Verkuil
Headers

Commit Message

Dan Carpenter March 5, 2014, 11:09 a.m. UTC
  This code is correct but the indenting is wrong and triggers a static
checker warning "add curly braces?".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: in v1 I added curly braces.

--
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
  

Comments

Frank Schaefer March 7, 2014, 4:46 p.m. UTC | #1
Am 05.03.2014 12:09, schrieb Dan Carpenter:
> This code is correct but the indenting is wrong and triggers a static
> checker warning "add curly braces?".
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: in v1 I added curly braces.
>
> diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
> index 4d97a76cc3b0..33f06ffec4b2 100644
> --- a/drivers/media/usb/em28xx/em28xx-cards.c
> +++ b/drivers/media/usb/em28xx/em28xx-cards.c
> @@ -3331,8 +3331,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
>  	if (has_video) {
>  	    if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
>  		dev->analog_xfer_bulk = 1;
> -		em28xx_info("analog set to %s mode.\n",
> -			    dev->analog_xfer_bulk ? "bulk" : "isoc");
> +	    em28xx_info("analog set to %s mode.\n",
> +			dev->analog_xfer_bulk ? "bulk" : "isoc");

Instead of moving em28xx_info(...) to the left the if section needs to
be moved to the right:

- 	    if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
- 		dev->analog_xfer_bulk = 1;
+ 		if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
+ 			dev->analog_xfer_bulk = 1;

While you are at it, could you also do fix the indention in the next
paragraph ?
Thanks !

Regards,
Frank

>  	}
>  	if (has_dvb) {
>  	    if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
> --
> 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

--
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
  
Dan Carpenter March 7, 2014, 5:01 p.m. UTC | #2
On Fri, Mar 07, 2014 at 05:46:28PM +0100, Frank Schäfer wrote:
> 
> Am 05.03.2014 12:09, schrieb Dan Carpenter:
> > This code is correct but the indenting is wrong and triggers a static
> > checker warning "add curly braces?".
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > v2: in v1 I added curly braces.
> >
> > diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
> > index 4d97a76cc3b0..33f06ffec4b2 100644
> > --- a/drivers/media/usb/em28xx/em28xx-cards.c
> > +++ b/drivers/media/usb/em28xx/em28xx-cards.c
> > @@ -3331,8 +3331,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
> >  	if (has_video) {
> >  	    if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
> >  		dev->analog_xfer_bulk = 1;
> > -		em28xx_info("analog set to %s mode.\n",
> > -			    dev->analog_xfer_bulk ? "bulk" : "isoc");
> > +	    em28xx_info("analog set to %s mode.\n",
> > +			dev->analog_xfer_bulk ? "bulk" : "isoc");
> 
> Instead of moving em28xx_info(...) to the left the if section needs to
> be moved to the right:
> 
> - 	    if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
> - 		dev->analog_xfer_bulk = 1;
> + 		if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
> + 			dev->analog_xfer_bulk = 1;

Yes.  I'd happy to.

> 
> While you are at it, could you also do fix the indention in the next
> paragraph ?

The next paragraph is almost identical but my static checker was
ignoring the curly braces because of the blank line.  I'll modify to
complain about that as well.

I'll resend.  Thanks for the review.

regards,
dan carpenter

--
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/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index 4d97a76cc3b0..33f06ffec4b2 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -3331,8 +3331,8 @@  static int em28xx_usb_probe(struct usb_interface *interface,
 	if (has_video) {
 	    if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
 		dev->analog_xfer_bulk = 1;
-		em28xx_info("analog set to %s mode.\n",
-			    dev->analog_xfer_bulk ? "bulk" : "isoc");
+	    em28xx_info("analog set to %s mode.\n",
+			dev->analog_xfer_bulk ? "bulk" : "isoc");
 	}
 	if (has_dvb) {
 	    if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))