Re: [PATCH 7/7] staging: rtl8188eu: reduce indentation level in rtw_alloc_stainfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
>  }


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux