* [PATCH] hso: fix disable_net
@ 2010-11-24 19:35 Filip Aben
2010-11-25 12:16 ` Sergei Shtylyov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Filip Aben @ 2010-11-24 19:35 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
jhovold-Re5JQEeQqe8AvxtiuMwx3w, pki-/L4m51SJ8HhmR6Xm/wNWPw,
j.dumon-x9gZzRpC1QbQT0dZR+AlfA
The HSO driver incorrectly creates a serial device instead of a net
device when disable_net is set. It shouldn't create anything for the
network interface.
Signed-off-by: Filip Aben <f.aben-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
---
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index b154a94..b05c235 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2994,10 +2994,10 @@ static int hso_probe(struct usb_interface *interface,
case HSO_INTF_BULK:
/* It's a regular bulk interface */
- if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) &&
- !disable_net)
+ if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) {
+ if(!disable_net)
hso_dev = hso_create_net_device(interface, port_spec);
- else
+ } else
hso_dev =
hso_create_bulk_serial_device(interface, port_spec);
if (!hso_dev)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hso: fix disable_net
2010-11-24 19:35 [PATCH] hso: fix disable_net Filip Aben
@ 2010-11-25 12:16 ` Sergei Shtylyov
2010-11-25 12:17 ` Sergei Shtylyov
2010-11-25 12:52 ` Johan Hovold
2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2010-11-25 12:16 UTC (permalink / raw)
To: Filip Aben; +Cc: davem, linux-usb, netdev, jhovold, pki, j.dumon
Hello.
On 24-11-2010 22:35, Filip Aben wrote:
> The HSO driver incorrectly creates a serial device instead of a net
> device when disable_net is set. It shouldn't create anything for the
> network interface.
> Signed-off-by: Filip Aben <f.aben@option.com>
> ---
> diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
> index b154a94..b05c235 100644
> --- a/drivers/net/usb/hso.c
> +++ b/drivers/net/usb/hso.c
> @@ -2994,10 +2994,10 @@ static int hso_probe(struct usb_interface *interface,
>
> case HSO_INTF_BULK:
> /* It's a regular bulk interface */
> - if (((port_spec& HSO_PORT_MASK) == HSO_PORT_NETWORK)&&
> - !disable_net)
> + if ((port_spec& HSO_PORT_MASK) == HSO_PORT_NETWORK) {
> + if(!disable_net)
Don't use spaces for indentation.
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hso: fix disable_net
2010-11-24 19:35 [PATCH] hso: fix disable_net Filip Aben
2010-11-25 12:16 ` Sergei Shtylyov
@ 2010-11-25 12:17 ` Sergei Shtylyov
2010-11-25 12:52 ` Johan Hovold
2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2010-11-25 12:17 UTC (permalink / raw)
To: Filip Aben; +Cc: davem, linux-usb, netdev, jhovold, pki, j.dumon
On 24-11-2010 22:35, Filip Aben wrote:
> The HSO driver incorrectly creates a serial device instead of a net
> device when disable_net is set. It shouldn't create anything for the
> network interface.
> Signed-off-by: Filip Aben <f.aben@option.com>
> ---
> diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
> index b154a94..b05c235 100644
> --- a/drivers/net/usb/hso.c
> +++ b/drivers/net/usb/hso.c
> @@ -2994,10 +2994,10 @@ static int hso_probe(struct usb_interface *interface,
>
> case HSO_INTF_BULK:
> /* It's a regular bulk interface */
> - if (((port_spec& HSO_PORT_MASK) == HSO_PORT_NETWORK)&&
> - !disable_net)
> + if ((port_spec& HSO_PORT_MASK) == HSO_PORT_NETWORK) {
> + if(!disable_net)
> hso_dev = hso_create_net_device(interface, port_spec);
> - else
> + } else
There should now be {} on the *else* branch too, according to CodingStyle.
> hso_dev =
> hso_create_bulk_serial_device(interface, port_spec);
> if (!hso_dev)
WBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hso: fix disable_net
2010-11-24 19:35 [PATCH] hso: fix disable_net Filip Aben
2010-11-25 12:16 ` Sergei Shtylyov
2010-11-25 12:17 ` Sergei Shtylyov
@ 2010-11-25 12:52 ` Johan Hovold
2 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2010-11-25 12:52 UTC (permalink / raw)
To: Filip Aben; +Cc: davem, linux-usb, netdev, pki, j.dumon
On Wed, Nov 24, 2010 at 8:35 PM, Filip Aben <f.aben@option.com> wrote:
> The HSO driver incorrectly creates a serial device instead of a net
> device when disable_net is set. It shouldn't create anything for the
> network interface.
Looks good apart from the indentation issue pointed out by Sergei (you
should also
indent the hso_create_net_device line).
As I mentioned in another thread, this was actually suggested about a year ago
but was never accepted due to patch corruption (the other two patches submitted
as part of that series also seem to have been plain wrong, though):
http://kerneltrap.org/mailarchive/linux-netdev/2009/11/19/6261572
Thanks,
Johan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-25 12:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-24 19:35 [PATCH] hso: fix disable_net Filip Aben
2010-11-25 12:16 ` Sergei Shtylyov
2010-11-25 12:17 ` Sergei Shtylyov
2010-11-25 12:52 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).