All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] rocker: Check Handle PORT_PRE_BRIDGE_FLAGS
@ 2019-02-22 19:46 Dan Carpenter
  2019-02-22 19:48 ` Florian Fainelli
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-02-22 19:46 UTC (permalink / raw)
  To: kernel-janitors

Hello Florian Fainelli,

The patch 93700458ff63: "rocker: Check Handle PORT_PRE_BRIDGE_FLAGS"
from Feb 20, 2019, leads to the following static checker warning:

	drivers/net/ethernet/rocker/rocker_main.c:2087 rocker_port_attr_set()
	warn: missing break? reassigning 'err'

drivers/net/ethernet/rocker/rocker_main.c
    2069 static int rocker_port_attr_set(struct net_device *dev,
    2070 				const struct switchdev_attr *attr,
    2071 				struct switchdev_trans *trans)
    2072 {
    2073 	struct rocker_port *rocker_port = netdev_priv(dev);
    2074 	int err = 0;
    2075 
    2076 	switch (attr->id) {
    2077 	case SWITCHDEV_ATTR_ID_PORT_STP_STATE:
    2078 		err = rocker_world_port_attr_stp_state_set(rocker_port,
    2079 							   attr->u.stp_state,
    2080 							   trans);
    2081 		break;
    2082 	case SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS:
    2083 		err = rocker_world_port_attr_pre_bridge_flags_set(rocker_port,
    2084 							      attr->u.brport_flags,
    2085 							      trans);

I think you wanted a break here.  Or a /* fall through */ comment.

    2086 	case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
--> 2087 		err = rocker_world_port_attr_bridge_flags_set(rocker_port,
    2088 							      attr->u.brport_flags,
    2089 							      trans);
    2090 		break;
    2091 	case SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME:
    2092 		err = rocker_world_port_attr_bridge_ageing_time_set(rocker_port,
    2093 								    attr->u.ageing_time,
    2094 								    trans);
    2095 		break;
    2096 	default:
    2097 		err = -EOPNOTSUPP;
    2098 		break;
    2099 	}
    2100 
    2101 	return err;
    2102 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] rocker: Check Handle PORT_PRE_BRIDGE_FLAGS
  2019-02-22 19:46 [bug report] rocker: Check Handle PORT_PRE_BRIDGE_FLAGS Dan Carpenter
@ 2019-02-22 19:48 ` Florian Fainelli
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2019-02-22 19:48 UTC (permalink / raw)
  To: kernel-janitors

On 2/22/19 11:46 AM, Dan Carpenter wrote:
> Hello Florian Fainelli,
> 
> The patch 93700458ff63: "rocker: Check Handle PORT_PRE_BRIDGE_FLAGS"
> from Feb 20, 2019, leads to the following static checker warning:
> 
> 	drivers/net/ethernet/rocker/rocker_main.c:2087 rocker_port_attr_set()
> 	warn: missing break? reassigning 'err'
> 
> drivers/net/ethernet/rocker/rocker_main.c
>     2069 static int rocker_port_attr_set(struct net_device *dev,
>     2070 				const struct switchdev_attr *attr,
>     2071 				struct switchdev_trans *trans)
>     2072 {
>     2073 	struct rocker_port *rocker_port = netdev_priv(dev);
>     2074 	int err = 0;
>     2075 
>     2076 	switch (attr->id) {
>     2077 	case SWITCHDEV_ATTR_ID_PORT_STP_STATE:
>     2078 		err = rocker_world_port_attr_stp_state_set(rocker_port,
>     2079 							   attr->u.stp_state,
>     2080 							   trans);
>     2081 		break;
>     2082 	case SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS:
>     2083 		err = rocker_world_port_attr_pre_bridge_flags_set(rocker_port,
>     2084 							      attr->u.brport_flags,
>     2085 							      trans);
> 
> I think you wanted a break here.  Or a /* fall through */ comment.

It's fixed with this commit:

https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?idz25c6c0aac85bbc50d3ce49cd08888adb14508b

thanks for your report!
-- 
Florian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-22 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 19:46 [bug report] rocker: Check Handle PORT_PRE_BRIDGE_FLAGS Dan Carpenter
2019-02-22 19:48 ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.