[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2bc9e96ec06fe94505b5e7d967d1453f072738a6.camel@perches.com>
Date: Sat, 26 Oct 2019 10:18:51 -0700
From: Joe Perches <joe@...ches.com>
To: Michael Straube <straube.linux@...il.com>,
gregkh@...uxfoundation.org
Cc: Larry.Finger@...inger.net, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/7] staging: rtl8188eu: reduce indentation level in
rtw_alloc_stainfo
On Sat, 2019-10-26 at 14:11 +0200, Michael Straube wrote:
> Remove else-arm from if-else statement. Move the else code out of the
> if-else and skip it by adding goto exit to the if block. The exit label
> was directly after the else-arm, so there is no change in behaviour.
> Reduces indentation level and clears a line over 80 characters
> checkpatch warning.
[]
> diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
[]
> @@ -181,70 +181,71 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
> struct sta_info, list);
> if (!psta) {
> spin_unlock_bh(&pfree_sta_queue->lock);
Because exit does no cleanup, it's probably simpler as
return NULL;
and then remove the exit label
> + if (index >= NUM_STA) {
> + RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_,
> + ("ERROR => %s: index >= NUM_STA", __func__));
> + psta = NULL;
> + goto exit;
here too
[]
> +
> exit:
> return psta;
> }
Powered by blists - more mailing lists