From patchwork Fri Dec 30 18:06:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008511wrt; Fri, 30 Dec 2022 10:08:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3wG5M1yq8gHUlbq77SU0rBleCRcZGcNLX53UB7XBO3j/oDciAauwAYMDXcaNV38eNafTX X-Received: by 2002:aa7:948b:0:b0:581:bca1:b7a3 with SMTP id z11-20020aa7948b000000b00581bca1b7a3mr9484404pfk.8.1672423712616; Fri, 30 Dec 2022 10:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423712; cv=none; d=google.com; s=arc-20160816; b=hM/3dbjz94AXckpZ/Zl5CF6t9l+4e2vDG917CouLzLae2euc99gktZaedaUOS169gh uYr3b9qdVEdrLDO0l5rmN5XhJBW01BTmzBZh7fPqENtZYg6AJpDJtMqRjTwCAuU8gNLR DRbw3H0o4/9zzW1hF+kP7u7srxHLU2tnfuPEY1/5+ta9Vd3rkKZl6p4X95/vtfrfYGjg AKgckwyiiDr9x1RmxStzNKZSHzkdURU+1L9U/EDg58YSXLMvABzdHk7QXF7fo/NR+AW+ DlHPc8EatW4DdKhoHEJ+WpVJWdmUA/40u4Gca8nWOeclhnxJDhpKzQ74jQbeInGAdDrM jISw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Guls0RsIeVi/vUP74clNMtQZHfZXI0cGi3yo7hPYiks=; b=VhJFTpo4WU2J4zHceyWwzd27mQTtRmqLJmam8yK2qmmHewDwhapPontAGn7hUSdiPf onsyuSSacjHYcclXS+xGcEK+0TiS0sv9mWWTVnZ6HqspfCTmIo9pQ9yUBjOJo+pf28Y0 EmFV8iScjWJZdyYqgyAvBY8p0AX9GucZ1IW0La7m2BEnWd5stQG1axsNr8e8jVrTNMCH h2iTAfHYyrF7iS3Sn4fjit+ZakXA8gbBopoTHYMGPGEw0uFvpLC2uWvu86WI/0eCkthZ Oh71e7y6N79MKSYYpNj6BG5zCOXj7k/oNCDRkFV1X0c/znmLV1Wi2DGB0UIFT41A4sHZ FKRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j26-20020aa7929a000000b0056341219532si20819076pfa.89.2022.12.30.10.08.19; Fri, 30 Dec 2022 10:08:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235470AbiL3SHp (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235444AbiL3SHV (ORCPT ); Fri, 30 Dec 2022 13:07:21 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C5391C42D for ; Fri, 30 Dec 2022 10:07:18 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1pBJmj-0004rR-VU; Fri, 30 Dec 2022 19:07:14 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 10/20] staging: r8188eu: simplify rtw_make_wlanhdr's error handling Date: Fri, 30 Dec 2022 19:06:36 +0100 Message-Id: <20221230180646.91008-11-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753663366670388717?= X-GMAIL-MSGID: =?utf-8?q?1753663366670388717?= Simplify the error handling in rtw_make_wlanhdr. Exit immediately instead of jumping to the end of the function. We don't have to do any clean-up. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 502f9a6f4250..6e3b5649b84c 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -792,8 +792,6 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; u8 qos_option = false; - - int res = _SUCCESS; __le16 *fctrl = &pwlanhdr->frame_control; struct sta_info *psta; @@ -840,8 +838,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr if (psta->qos_option) qos_option = true; } else { - res = _FAIL; - goto exit; + return _FAIL; } if (pattrib->mdata) @@ -897,9 +894,8 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr } } } -exit: - return res; + return _SUCCESS; } s32 rtw_txframes_pending(struct adapter *padapter)