diff mbox

[media] em28xx-cards: don't print a misleading message

Message ID 20140217200419.GB9845@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Feb. 17, 2014, 8:04 p.m. UTC
There were some missing curly braces so it always says that the transfer
mode changed even if it didn't.  Also the indenting uses spaces instead
of tabs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
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 Schäfer Feb. 24, 2014, 6:04 p.m. UTC | #1
Am 17.02.2014 21:04, schrieb Dan Carpenter:
> There were some missing curly braces so it always says that the transfer
> mode changed even if it didn't.

It's not a transfer mode change, it's the initial selection (which never
changes).
The intention of this section is to print which interface (type) is
choosen for analog video.
The same is done for digital video (DVB) a few lines later.
I think we should just switch from info to debug level.

>   Also the indenting uses spaces instead
> of tabs.
Yes, indenting is wrong and that's what causes the confusion here. ;-)

>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
> index 4d97a76cc3b0..e8eedd35eea5 100644
> --- a/drivers/media/usb/em28xx/em28xx-cards.c
> +++ b/drivers/media/usb/em28xx/em28xx-cards.c
> @@ -3329,10 +3329,11 @@ static int em28xx_usb_probe(struct usb_interface *interface,
>  
>  	/* Select USB transfer types to use */
>  	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");
> +		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");
Now you will never hit the "isoc" path.

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 Feb. 24, 2014, 6:13 p.m. UTC | #2
Thank you so much for the review.  I should have noticed that myself...
I will send a patch to correct the indenting instead.

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

Patch

diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index 4d97a76cc3b0..e8eedd35eea5 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -3329,10 +3329,11 @@  static int em28xx_usb_probe(struct usb_interface *interface,
 
 	/* Select USB transfer types to use */
 	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");
+		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");
+		}
 	}
 	if (has_dvb) {
 	    if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))