Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp979230pxb; Tue, 26 Oct 2021 00:02:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvK5rOHsKit60fweJPrBOrtQ08D2mqTR+GId73WjD2rGNAiOrx9WSfv+a+g5bf+bAvC633 X-Received: by 2002:a65:6389:: with SMTP id h9mr17372545pgv.83.1635231757586; Tue, 26 Oct 2021 00:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635231757; cv=none; d=google.com; s=arc-20160816; b=uIm3LwGmSueIBg2XzOM/j/56PnLiFa+qcHbKCJu99dvJMHjjeQgfWMplmM+BbinQdm LoExhTH1IzPWu9hfv5c0FJqk4jV6VzpFs0QCzGm2RQAX/yD7yURTExlCe1cCZmdc0TuQ 4z8h8LYV9SVDrjkEym2KqW0ucYrNycRbVfzho2R0JB7X6IVkbH6XnlNhMrEX3j+FL9m+ 5yg0wP3j4GqoKJNvA/MIF8bl6DM/dBygf9xUmaviPZ7kxqFGevRTOtst80/ommE0aOlP EXD+TXJtkZkDxcE+X+WAsndlLm8kZfbvF71nwSH7Wo+i3Ws18hAaZIrNLA8AbjypuXpF 0IoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=jT56R8thic/ZxbSI8kRsJDsnZUfYJtsBr78ZdkZB++g=; b=yRquvb80OLGjkVtpwvlhItRoe1kUovX1YRap8gbZt7Vduyh9481RoanBxERhvDYAL7 NQQo5WLuf5bJ0xWiAYCFg1OpI8wwSt9+rNNjhDrTdJXjeZnIywSi6D6kHtfKGeUEHvx5 12XREzGilqcff1IjkpdsT0Hv9EQ99ycgZw72mW4FyZoAoaW2bzH6e2jkm9snni9flJlw ANF+521MMQJP6bkpY4i6pJxNw61MtawEW/t3VOBC1N00ZN9Zq6Gdoz39M1jmkmmKoAL4 kDX36hOHokoa8eodTpuql1sbYYRwlDBJvE+Dm9UIhRB2vx0PVcT6McIdW5rowkd8O3YU iajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KTXsGqDU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si18692411plg.200.2021.10.26.00.02.05; Tue, 26 Oct 2021 00:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KTXsGqDU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234483AbhJZD6T (ORCPT + 99 others); Mon, 25 Oct 2021 23:58:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234019AbhJZD6R (ORCPT ); Mon, 25 Oct 2021 23:58:17 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58D77C061745 for ; Mon, 25 Oct 2021 20:55:54 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id y1so9352379plk.10 for ; Mon, 25 Oct 2021 20:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=jT56R8thic/ZxbSI8kRsJDsnZUfYJtsBr78ZdkZB++g=; b=KTXsGqDUekb/etDelz3qvN9JZR/TMLaUheLzeZvpokHqY+rDelz+x8QQqMnuSxo8vx IahoSrHuzbmRjQvRie7WfRxB/bBQHTgBYDcYDrbayZlydlPEK9iCfjXmHJHuVxU51YS+ 3ZhH3UZNITCYZDcg4fh6rQwE6KjQ12f5sOakxfv4YGHKCjkea8VmZ9ZJW3yabbP7uFxr FFPgIC6YpffjvJSi55IoTT7aOpg+E6V1cwjJxDs6AZFmuYtYdYuItkSmCGmjxvGLDHQY RNH7RPOsH35KEqcMIOsAG+x5AwP7hUipnQyUlYbYjQooJIKU/zoVUFT6r8XWMqR9P/aW lY2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=jT56R8thic/ZxbSI8kRsJDsnZUfYJtsBr78ZdkZB++g=; b=M9H4unSpXRVP4m9DNWMP3WiECkHEm7UT1tXGK4+iH/BJGvf0QWKYffNUldKSqeAuJo YH0kxKxTOkoRUJGl08iHahQuEgPnfDwLlYML/P3SpfFzLz/Q9io7nuSRVlrrRhTiBFrP ZOOgHNUpCv5JU3lsLDprpNaizDcsTYzsQQ2v5DoMYiTaRha4wQwbkoTbqvAOehvDp5kw WLgCK7USlqsE5V5L6DoZ3tYeCgvsNBcxXMWkH5UDCTX3jlOuQIM6qXx/SzRgCQ6Ct+lw ejKN0Q2aXHw67rakTbqkpzCI0df1Isf7O7/FE1t9h/FDwc06Kn0WyRaj7ur+e4FfrdrY hgkg== X-Gm-Message-State: AOAM530A0eK+voyYYAJDqgzsYr2BfBi5RYCM0tb8P7HOhlM6xdvHCaxB CSy73MT4AuGkL/n3Gp3p8CM= X-Received: by 2002:a17:902:7e4b:b0:13d:b90d:cdc1 with SMTP id a11-20020a1709027e4b00b0013db90dcdc1mr20615321pln.72.1635220553779; Mon, 25 Oct 2021 20:55:53 -0700 (PDT) Received: from Sauravs-MacBook-Air.local ([59.95.95.35]) by smtp.gmail.com with ESMTPSA id t40sm5167291pfg.142.2021.10.25.20.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 20:55:53 -0700 (PDT) Date: Tue, 26 Oct 2021 09:25:45 +0530 From: Saurav Girepunje To: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, gregkh@linuxfoundation.org, straube.linux@gmail.com, saurav.girepunje@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com Subject: [PATCH] staging: r8188eu: core: remove the goto from rtw_IOL_accquire_xmit_frame Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the goto statement from rtw_IOL_accquire_xmit_frame(). In this function goto can be replace by return statement. As on goto label exit, function only return it is not performing any cleanup. Avoiding goto will improve the function readability. Remove the assignment of NULL to local variable xmit_frame just before return of function. As function return, local variable will be not available on memory. So assigning a NULL value to local variable just before function return does not required. Signed-off-by: Saurav Girepunje --- drivers/staging/r8188eu/core/rtw_iol.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_iol.c b/drivers/staging/r8188eu/core/rtw_iol.c index fe6078864158..7e78b47c1284 100644 --- a/drivers/staging/r8188eu/core/rtw_iol.c +++ b/drivers/staging/r8188eu/core/rtw_iol.c @@ -13,15 +13,14 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter) xmit_frame = rtw_alloc_xmitframe(pxmitpriv); if (!xmit_frame) { DBG_88E("%s rtw_alloc_xmitframe return null\n", __func__); - goto exit; + return NULL; } xmitbuf = rtw_alloc_xmitbuf(pxmitpriv); if (!xmitbuf) { DBG_88E("%s rtw_alloc_xmitbuf return null\n", __func__); rtw_free_xmitframe(pxmitpriv, xmit_frame); - xmit_frame = NULL; - goto exit; + return NULL; } xmit_frame->frame_tag = MGNT_FRAMETAG; @@ -35,7 +34,7 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter) pattrib->subtype = WIFI_BEACON; pattrib->pktlen = 0; pattrib->last_txcmdsz = 0; -exit: + return xmit_frame; } -- 2.33.0