Re: [PATCH] net/bonding: adjust codingstyle for bond_3ad files

Joe Perches
2011-05-10T00:15:26Z

On Mon, 2011-05-09 at 21:08 -0300, Rafael Aquini wrote:
> drivers/net/bonding/bond_3ad.c | 886 +++++++++++++++++++++++-----------------
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> @@ -411,36 +407,37 @@ static inline void __initialize_port_locks(struct port *port)
> */
> static u16 __ad_timer_to_ticks(u16 timer_type, u16 par)
> {
> - u16 retval = 0; /* to silence the compiler */
> + u16 uninitialized_var(retval);

uninitialized_var isn't necessary. Every case will set retval.

> switch (timer_type) {
[]
> + default:
> + /* Exception: unexpected timer_type received */
> + pr_debug("Unexpected AD timer_type: %d\n", timer_type);
> + retval = 0;
> + break;
> }
> return retval;
> }