From patchwork Fri Nov 11 08:37:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 18541 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp620904wru; Fri, 11 Nov 2022 00:43:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf5yi11rCJEltXcnm6mvchHFE25YYf9huSG9jmWGf+FAuPwz0faPXwhb78N75SbYm5fg2nHB X-Received: by 2002:a17:907:c68a:b0:78d:860b:788f with SMTP id ue10-20020a170907c68a00b0078d860b788fmr1003479ejc.561.1668156191895; Fri, 11 Nov 2022 00:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668156191; cv=none; d=google.com; s=arc-20160816; b=VTFwp1T+5sZhLaYziUtszzDAVgRXIzuMeddSvnMN5DtIPF1wkfJmqRfnVWLQhuSnmA Nqs0h1lXFjMy7IZd6qCZvHNkjuvEcRDHGFW0Pnw2NMtgncQXq7F9x2xaqTHO7WF2pj5q IadB4xI6Txt5hjrqw/9zIqvsCC4vCaqmJTAOBK5kaqzRXakKX5K11nbiYvCxCLu5ek1S tBQDXrdB2ig1IxbWFvRlS8ThSOqr6uByI7WLRqRlRg6bCGab0ozSrLzugkUldY4cDey0 kSz4sVx5JrebFMQ1qokaEiUXhqEsLCAJMFgrWmI9JmMT+/LTNJa7URUjI3vSFkscuXOl O+mw== 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 :dkim-signature; bh=vMeVhviS95T1ATK054u2qDdwy0bMtS+NUWOBe0eridQ=; b=QdTNwz6HRxEBIbnL5zkEmpCIgdDL4hE979IyHmPlSlcSpTwsotuwNOuSfszYqqdSfk ITPA/OgCPuM220iXiS/5szdsxFwm8Mu9LwPQUkoFnPCI67IR7xnLm6IJmeUYHqa1NRz1 GMrjTYs0HiZVgV4HmXSB+Nim8glrezIWBhRc1Ihe9wJYk9Ce01sg1E9iTce+zubLlooJ ssnUyXF8zqEgE/k2R0xNZrgysaKd8vDwZ7hdW7l1ofimahWviXxgHvk8nybnTF6tSTS9 UjjOuKM7c62cejjYHLVxQZyOIrKvXE4s1IIKEWxsAGJ3MlBI3AQ8+242Dio9KhnjpDXO w8YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iH9iTA5V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca17-20020a170906a3d100b007a71a3cb3afsi1296170ejb.294.2022.11.11.00.42.48; Fri, 11 Nov 2022 00:43:11 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iH9iTA5V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233185AbiKKIhr (ORCPT + 99 others); Fri, 11 Nov 2022 03:37:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233071AbiKKIho (ORCPT ); Fri, 11 Nov 2022 03:37:44 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E26786315A for ; Fri, 11 Nov 2022 00:37:43 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id m22so10977873eji.10 for ; Fri, 11 Nov 2022 00:37:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vMeVhviS95T1ATK054u2qDdwy0bMtS+NUWOBe0eridQ=; b=iH9iTA5VKXpqT2HFYwETbz/+vaY4WLsnQs+IbfOUNUawdLJZBm/3smJ59KoKMj2V9G EpjPgn2TId1nY/N3qn0PJ2ae1VajgHPjXAm+/0kRJKYQ2nLYZQsgyQbvlmHeNQtgZ2Bu QAUnafvRC+dUfqju9fO+joNG0CfpmtAt1dt8h4+stcnVb2Wjq5ek9jerS9SJ6QWseuQu XvTVBHyQW9efizj6/Gi13K1XzN1F+qc8PG1FOIZYa6bama5yGzRM67o36B2LVbcsfciv WZq3wIijkR0DN15mSy3+XGQkpBcL9n3Qcq+of4SJfJv36TAtIazAongvCPLYkZcH1tpt c2WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vMeVhviS95T1ATK054u2qDdwy0bMtS+NUWOBe0eridQ=; b=Xy5hkvU9bZnrAnSw2lL1Nr9o2qnGA7nRrCgUM6jrDzqkFVNkyN8w2f/gCjGpyXHV3a nug/+QBfQlXZgzGecMSzdIykBkBMVWrqhirRbzpLhXTT/qJl6vEoGJWT18c5ilpRqr5K ViVtIun9I/nebmGyMoqz2C7lDnqA0Pkwh3G4igDKnPPvJpmHFTNnnk3HPod+WJKU7J6z ZBlAGOOmAS0QX6pBs+4SHsq0uF447JTKQchFL5U9c8bjM8bLWa6CONlp2oYJmriUZUGo t3gw321hu9ZHhOj/JwSTfC3iY+OareSxAEWlLdti4bonj3rn0BlyuEgJ0UaMzGhjk2vp Y+bQ== X-Gm-Message-State: ANoB5pmNxsbo75C99qnyy9nFe5HQ4ZDzP/SmbwtdHd25dEUzOKtVzmY0 QT9FpOi29xTKIsr3N7F7jfw= X-Received: by 2002:a17:906:b891:b0:7a5:f8a5:6f81 with SMTP id hb17-20020a170906b89100b007a5f8a56f81mr959785ejb.570.1668155862529; Fri, 11 Nov 2022 00:37:42 -0800 (PST) Received: from localhost.localdomain (ip5f5abb9a.dynamic.kabel-deutschland.de. [95.90.187.154]) by smtp.gmail.com with ESMTPSA id b2-20020a1709063ca200b007ae566edb8bsm643190ejh.73.2022.11.11.00.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 00:37:42 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 1/4] staging: r8188eu: convert aes_cipher() to void Date: Fri, 11 Nov 2022 09:37:30 +0100 Message-Id: <20221111083733.3144-2-straube.linux@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111083733.3144-1-straube.linux@gmail.com> References: <20221111083733.3144-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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?1749188547363673996?= X-GMAIL-MSGID: =?utf-8?q?1749188547363673996?= The function aes_cipher() returns always _SUCCESS and its callers do not use the return value. So we can convert the return type to void and get rid of another use of _SUCCESS. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_security.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_security.c b/drivers/staging/r8188eu/core/rtw_security.c index 5bba57d18b5f..780019ce1b98 100644 --- a/drivers/staging/r8188eu/core/rtw_security.c +++ b/drivers/staging/r8188eu/core/rtw_security.c @@ -954,7 +954,7 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) } -static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) +static void aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) { uint qc_exists, a4_exists, i, j, payload_remainder, num_blocks, payload_index; @@ -1083,8 +1083,6 @@ static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) bitwise_xor(aes_out, padded_buffer, chain_buffer); for (j = 0; j < 8; j++) pframe[payload_index++] = chain_buffer[j]; - - return _SUCCESS; } u32 rtw_aes_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe) From patchwork Fri Nov 11 08:37:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 18542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp620956wru; Fri, 11 Nov 2022 00:43:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf5aXc+4uFcitidLTdzer63baOJilHtw1j5rdzQh0u/5T0msuCACJsseBzkiPqOvmIxLy4pF X-Received: by 2002:a17:902:6b46:b0:17f:7f42:aa25 with SMTP id g6-20020a1709026b4600b0017f7f42aa25mr1664230plt.51.1668156201405; Fri, 11 Nov 2022 00:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668156201; cv=none; d=google.com; s=arc-20160816; b=b2X/ZgVzZk3pBTVfH3cDmdTOXVqtS563TlgqlANZpPZrls4fb0CVEVa7FT3jqT7lP0 RJjfVwTZRTMFH7xEBbBstrdnOSQoOLYFl9GA87h/pi+vPnZi3FIZ21hc3b0uqT+qISJL QGfgcRr1GDwFl49LYONUtHJb8U5MXjFzUk51dupSeiLb1AIlOQ6UNfirqAJneT7im7aa eFsQRgWw3f3+LqW+86E6lBjbbO2Tdouhr1eBRe33EONdZ1eEx5KrnHlZZ/2/VAvl+nMJ VWHNAjB+SkyUS0YXmRq0ABObAB4qjH7KrB1eVE4eF+nM45QD+ZhJdwGF/BCZwp/Zw2bU 6ofQ== 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 :dkim-signature; bh=3DfnILufOOdX5Kg+pMaqFVKzb+AWaHeWfhqHmZ5gkkQ=; b=VRvQ2RGomtQctFePWAuB0Upe0hGOUUp2fufPA4ztcdwDL4mSk/PKAV82Lx5BtSbyZc M2+3PqYjbqT36l+zQxHkJFRRCAG61h4o8QjOjMO9E0OwrKe180YriXWdLSgv+r7f10wQ 1SXQF2OOfYIeJdsenhMqcbwzuI7taF0H7cTUBA12ttbgROj1tkUCZkq91Oh5YvjScYhI Vt0pD61XcW8iUHebsbmo0WUGGAI6vk2cerEVUbnxoxq4evMO0fviu3ZM0ccZzA7HqhUS bIHpeXZ+/jydP3Pt4PZDLYohs3KG03WsnMqm6pxUA3a2cpYXbiOg2vAKtOyQNlITX7yH rH4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MS0P2Mcy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 68-20020a630047000000b0046ff2d3ec3bsi1809360pga.866.2022.11.11.00.43.07; Fri, 11 Nov 2022 00:43:21 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MS0P2Mcy; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233243AbiKKIhx (ORCPT + 99 others); Fri, 11 Nov 2022 03:37:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233071AbiKKIht (ORCPT ); Fri, 11 Nov 2022 03:37:49 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AC347C8DA for ; Fri, 11 Nov 2022 00:37:48 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id n12so10972392eja.11 for ; Fri, 11 Nov 2022 00:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3DfnILufOOdX5Kg+pMaqFVKzb+AWaHeWfhqHmZ5gkkQ=; b=MS0P2McydCUAf7eSsNKhvvmIAlUVNE26AUM7kKUv7Uh0YTiBiU8DFPJuCHGx31eEtd Qkz3BNQd43fNTOrFoRHi3E7f/P0xAdFodl7EWgBj7QePxFQITOseXV5/8OcIdxdJry67 DZF2UCG4dAH7RDbAJbV8WLcV2nf2m6RN/slhibUTcOFwu1ljkuQXHmWhLyj4ikvGA6hN e/l0i9aYwI7blBu9KMMP7wyeYSdzPx0ua2PChGIWjvHbKOfCLCuJaJ4R69OEXwgbJR6C rT/d2nFb/ztrtOZtyRiIOwV+uo/UjrjsZ+1IMNsFmbJ/3l8Ax6j3WdnGmDmfgUKyDwa6 kZBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3DfnILufOOdX5Kg+pMaqFVKzb+AWaHeWfhqHmZ5gkkQ=; b=H2es9m/gLHHF8vNBY91W4QR/SqjP3vW3hNlYYYyD9fr8K2f7NrTFbRrhgK1p+CfVGi ojRaX1W6IHyoBg6+xnV2H7VZqe6yPTefb9iBCxukSig2weF6JfAH334qBabJdNUbrwbP O9T8+eUcDEBVViUWghz3GEtJcfPSasT7jujjU+9GtZkDtvjLkuFNyHACFEPqMqXwCbwx VA7H3o9sslgcg2k8MEDJ+uNCvo8wLwzOXoXSBR6s9LMW2Dd1oEcHHgmve+/Z2WiguOAC AAnQQOKd89wx/MG1t+7F5HrWipanccwkr77rZGn/dPGh4uXLMCXlU7BowZ7TWGrPHvIj rTJQ== X-Gm-Message-State: ANoB5pkD57Gv86XFGASREiucgWtK9Ct8hWnrQPxzam3wM9ofmVzO0m9y 0HWk111ZZb/PLuuGZnWqYhI= X-Received: by 2002:a17:906:5054:b0:79b:413b:d64 with SMTP id e20-20020a170906505400b0079b413b0d64mr997764ejk.538.1668155867208; Fri, 11 Nov 2022 00:37:47 -0800 (PST) Received: from localhost.localdomain (ip5f5abb9a.dynamic.kabel-deutschland.de. [95.90.187.154]) by smtp.gmail.com with ESMTPSA id b2-20020a1709063ca200b007ae566edb8bsm643190ejh.73.2022.11.11.00.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 00:37:46 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 2/4] staging: r8188eu: convert rtw_xmit_resource_alloc() to common error logic Date: Fri, 11 Nov 2022 09:37:31 +0100 Message-Id: <20221111083733.3144-3-straube.linux@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111083733.3144-1-straube.linux@gmail.com> References: <20221111083733.3144-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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?1749188556650118034?= X-GMAIL-MSGID: =?utf-8?q?1749188556650118034?= Convert the function rtw_xmit_resource_alloc() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_xmit.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index bd6c1a401c59..c0fda6ce7c56 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -38,7 +38,7 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *px { pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); if (!pxmitbuf->pallocated_buf) - return _FAIL; + return -ENOMEM; pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); pxmitbuf->dma_transfer_addr = 0; @@ -46,10 +46,10 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *px pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL); if (!pxmitbuf->pxmit_urb) { kfree(pxmitbuf->pallocated_buf); - return _FAIL; + return -ENOMEM; } - return _SUCCESS; + return 0; } static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, @@ -151,12 +151,12 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->ext_tag = false; /* Tx buf allocation may fail sometimes, so sleep and retry. */ - res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); - if (res == _FAIL) { + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) { msleep(10); - res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); - if (res == _FAIL) + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) { + res = _FAIL; goto free_xmitbuf; + } } pxmitbuf->flags = XMIT_VO_QUEUE; @@ -188,8 +188,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->padapter = padapter; pxmitbuf->ext_tag = true; - res = rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ); - if (res == _FAIL) { + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) { res = _FAIL; goto free_xmit_extbuf; } From patchwork Fri Nov 11 08:37:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 18543 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp620976wru; Fri, 11 Nov 2022 00:43:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sektLTmNzjvEDLtzlhoaJeZeevN+Zt3h1mRGVmHKaqD+UN88aMmVKdc+3cvNfb4HwBwqu X-Received: by 2002:a17:902:b417:b0:188:4ba9:79ee with SMTP id x23-20020a170902b41700b001884ba979eemr1645658plr.83.1668156206677; Fri, 11 Nov 2022 00:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668156206; cv=none; d=google.com; s=arc-20160816; b=YGJ4F3CtTMnxSlwDilbeOJ2wNLdikFZay7XA0FZ13YzQ3x1lH4PGZW5xIBDLSLCjxL cJ7KxWLuVgUXMW8+Sk5l9/DagJQa6Ik9W/xO9EIR60C/6S7Ad2imKHYdm6gjT+kYcLJu CVHlpignDgE2AC90ZX/LwzJRqKnYVED2Dm67mPnB3acd9Njexcg2vn2fT3uALogSMDtH 0qjLhOYEp2kF/Xo40ovNXXHXwyaE37UiVxKkuyqOQDmYOPvtiYuQSmpHmiEY2OSmkpDA NLOdijWAIm4kC9eQlJKhRPgLtzxDFALG9YM/C5CkcBmI7uepN8kIqbw0XsV/4xezfrtp BLCw== 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 :dkim-signature; bh=4UYmpKHsIr2qFT7M5inAn4KP/0IUYZikxzDGvUZY1YE=; b=wZbVSUR88O9tev3nFka0TCycaGsEolBu10GLhx2ZWOYSlNlh/vrd2643ekIxdPoIfz MpMz2KZl5nDB7kwCQu9e99juJO6M9OqOZ5I/RJdsDiyRw7jYhPbaGdSVL5S5MPuw/8if F/k8XW5f17ddUwNJnSPiitV3XflxykjfsDWFcWqCqmaszJNc3aLdh6kaN0AbAp9RhY4U 9s9PhTek7tWMa7StOX0vtAfMz7I3OCYgF9NdTmWmtIpfqwNRHcsrWdCNOr2kBhV9UImM lIBzGDAnNx+TyBWNHM04ll+4BaQy4kA2D1Bpz/zKuNUG84BjjXAqXr+bQrWTLnu66xu4 WKoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UQrzctyh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a170902cacb00b0018686834315si1549323pld.431.2022.11.11.00.43.13; Fri, 11 Nov 2022 00:43:26 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UQrzctyh; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232985AbiKKIh7 (ORCPT + 99 others); Fri, 11 Nov 2022 03:37:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233194AbiKKIhu (ORCPT ); Fri, 11 Nov 2022 03:37:50 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38072654DB for ; Fri, 11 Nov 2022 00:37:49 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id f5so11045043ejc.5 for ; Fri, 11 Nov 2022 00:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4UYmpKHsIr2qFT7M5inAn4KP/0IUYZikxzDGvUZY1YE=; b=UQrzctyhSUruz7hukRcYiRergxj/lpzlJuqn9IYYCx8q8WcTX11QIA1Z2iEUcFt0gd GGrTTrNXaKpl9NdH6YqI0knvp1Bkdfh2lR2B2m8VYsQM+N48RKipOeF2348z0XToU7qY gbUiOYN6juqY1ITOusxq81EZ6HdxfYMjssineB6fCS5O95IMlMb+DMNeRpBLZD18+Ia2 DC2Wo30qij3bKu0yc6YK6zcC6sgqk2ABtiQNlsJ/ajBDgiVXPEKHkf3aOUgrNu33RQDO HWTG83PvAM6lchc/LG3rrcnXFYSk1GZkD8asBbaQSuO6RxxGJhROJEqcOLw7bOvN1S/7 cV0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4UYmpKHsIr2qFT7M5inAn4KP/0IUYZikxzDGvUZY1YE=; b=vMJ1FPiE8Eo9s45d15IusnXorV/L1yuqBZmbgn3Qtx/9Kbtr6F8IbXrB9sy+QSwwbw j43DBNjIIQR4rlnJHKK4j2YfQrFdASGpp4nNqmWtVNsCnoYlYeXRgvpHrdXUmEc7xH3N Fho81YW/6a6YnGKU2fzdY7FGDvUtRkrXMvS6qQAYt7h5T66uSiC1t5o/JJpFbkD4EJPo WVX/JwMbg1MGQ6Um9ZOwDMFFNK1xQXJqQH5BmpABq0h4IoBUjz1KoGJq0h1tave4s/9L 2sf0C6dp2i1U1sbZqDWGGUom33wa9VxuRWT3azBR0NFFJgjRnWlevgR8E0euwU61yn29 13LQ== X-Gm-Message-State: ANoB5pm6fGTQlqKEuLEmxrZ7iUH9TGuJU4gQice405IyUJsHrhXH8Sv+ QY0wyeT3lkeG4y3eM+fGmNg= X-Received: by 2002:a17:906:5e05:b0:7ae:21bc:89f0 with SMTP id n5-20020a1709065e0500b007ae21bc89f0mr1089186eju.132.1668155867840; Fri, 11 Nov 2022 00:37:47 -0800 (PST) Received: from localhost.localdomain (ip5f5abb9a.dynamic.kabel-deutschland.de. [95.90.187.154]) by smtp.gmail.com with ESMTPSA id b2-20020a1709063ca200b007ae566edb8bsm643190ejh.73.2022.11.11.00.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 00:37:47 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 3/4] staging: r8188eu: convert _rtw_init_xmit_priv() to common error logic Date: Fri, 11 Nov 2022 09:37:32 +0100 Message-Id: <20221111083733.3144-4-straube.linux@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111083733.3144-1-straube.linux@gmail.com> References: <20221111083733.3144-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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?1749188562709933095?= X-GMAIL-MSGID: =?utf-8?q?1749188562709933095?= Convert the function _rtw_init_xmit_priv() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_xmit.c | 28 +++++++--------------- drivers/staging/r8188eu/include/rtw_xmit.h | 2 +- drivers/staging/r8188eu/os_dep/os_intfs.c | 2 +- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index c0fda6ce7c56..34494f08c0cd 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -59,12 +59,11 @@ static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *px kfree(pxmitbuf->pallocated_buf); } -s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) +int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) { int i; struct xmit_buf *pxmitbuf; struct xmit_frame *pxframe; - int res = _SUCCESS; u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; @@ -97,7 +96,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) if (!pxmitpriv->pallocated_frame_buf) { pxmitpriv->pxmit_frame_buf = NULL; - res = _FAIL; goto exit; } pxmitpriv->pxmit_frame_buf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_frame_buf), 4); @@ -132,10 +130,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4); - if (!pxmitpriv->pallocated_xmitbuf) { - res = _FAIL; + if (!pxmitpriv->pallocated_xmitbuf) goto free_frame_buf; - } pxmitpriv->pxmitbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmitbuf), 4); /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */ @@ -153,10 +149,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) /* Tx buf allocation may fail sometimes, so sleep and retry. */ if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) { msleep(10); - if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) { - res = _FAIL; + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) goto free_xmitbuf; - } } pxmitbuf->flags = XMIT_VO_QUEUE; @@ -172,10 +166,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); - if (!pxmitpriv->pallocated_xmit_extbuf) { - res = _FAIL; + if (!pxmitpriv->pallocated_xmit_extbuf) goto free_xmitbuf; - } pxmitpriv->pxmit_extbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4); @@ -188,10 +180,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->padapter = padapter; pxmitbuf->ext_tag = true; - if (rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) { - res = _FAIL; + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) goto free_xmit_extbuf; - } list_add_tail(&pxmitbuf->list, &pxmitpriv->free_xmit_extbuf_queue.queue); pxmitbuf++; @@ -199,10 +189,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; - if (rtw_alloc_hwxmits(padapter)) { - res = _FAIL; + if (rtw_alloc_hwxmits(padapter)) goto free_xmit_extbuf; - } rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); @@ -225,7 +213,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) rtl8188eu_init_xmit_priv(padapter); - return _SUCCESS; + return 0; free_xmit_extbuf: pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; @@ -245,7 +233,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) free_frame_buf: vfree(pxmitpriv->pallocated_frame_buf); exit: - return res; + return -ENOMEM; } static void rtw_pkt_complete(struct adapter *padapter, struct sk_buff *pkt) diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index cff065554608..6e7ebea5362d 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -351,7 +351,7 @@ s32 rtw_txframes_pending(struct adapter *padapter); s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pattrib); void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry); -s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter); +int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter); void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv); int rtw_alloc_hwxmits(struct adapter *padapter); void rtw_free_hwxmits(struct adapter *padapter); diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index 66556e07ed93..44eb95a7682c 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -480,7 +480,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) init_mlme_ext_priv(padapter); - if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) { + if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter)) { dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_xmit_priv failed\n"); goto free_mlme_ext; } From patchwork Fri Nov 11 08:37:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 18544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp621194wru; Fri, 11 Nov 2022 00:44:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4YRViQUAcgKEJb13HClkrpMRkgkr7E8tV0btxFiIFXKq0xwtoP/JRduEViw3rg3XRIslYd X-Received: by 2002:a17:90a:fb92:b0:212:d9fe:a94 with SMTP id cp18-20020a17090afb9200b00212d9fe0a94mr885366pjb.58.1668156244707; Fri, 11 Nov 2022 00:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668156244; cv=none; d=google.com; s=arc-20160816; b=W2Rk44dVzeH4X+tz8ARfwgzqoHWykwng1Q9BDko8eiExvSXxaCHTgRlixUgCwmv0UI tUcQ1ISPPQK6a8sWNA9LURM3FXGB5TUJCULil6y3GQ/Y9QYgeg6/nX1fkcbugmrNRU4P Yq/FHoX0/zRuB/qZFNqS8Dga6uKZ9e2bGXWwSqAUhEuiWqsJDUeqX1+sMDMAD5yGwpkn NzGk/xdU8SCsm3La/wGvTnQlq9bOkUOPHwpKo/oEpF5rs7WUydlYvj+3iYs8KvRtwT/k C4RpBPFq3nMA+xvqaT3rsU6mPVK+PoPqZlgWIqR6JNw0qi3yG2CQI7ydwkPuNMeEdyO7 0k9g== 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 :dkim-signature; bh=Si9XFxNri8mLzDVBs0OAg9hzoexdDFNJE3YaOOciu+c=; b=lrTTNe9vnga0jG4iuU+x6YPbgPqsL1fKn0/fC5khku/tpcgclgCfw4mFcvwpJZVBG5 Ju+bvI80DOsdT520/jieF18ahbu6oKyu323KafTYceB0UiakE3rhKaHkk5SzoP5m/ZZ9 Sw1pavJoaeiUfPmcuoHkiHaK2w27HygrTqJlZd1NUZLn1Qp5UDarNCIQgQHMNzCzMbeq SakYS7sCmfcA7SjRkY1yijcOM4H3FqwaFVb4ljMkfGGluZn4svqzTmhD3l3UykAWtj/L ZTcElQM8vXsccMD6UNw/5TXVqtlltSblSnel+4DW/N5DOdSm8glaW1ga4+dSEROcimFC rsYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XSBHG4K3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r28-20020a63205c000000b0046ec0715bd9si1798806pgm.818.2022.11.11.00.43.51; Fri, 11 Nov 2022 00:44:04 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XSBHG4K3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232182AbiKKIiF (ORCPT + 99 others); Fri, 11 Nov 2022 03:38:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233197AbiKKIhu (ORCPT ); Fri, 11 Nov 2022 03:37:50 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CACC47C8D6 for ; Fri, 11 Nov 2022 00:37:49 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id 21so6690872edv.3 for ; Fri, 11 Nov 2022 00:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Si9XFxNri8mLzDVBs0OAg9hzoexdDFNJE3YaOOciu+c=; b=XSBHG4K3p/UZ1gh1fnNp1FKmdxFFb86t/hTrcXm/F/Jg3sWvT63v7SO1kiP4P3dvL5 qgWEMfqY4lTw39sNBWEzvM7sPBP1PJh8/V9/S0mTdQuCTANNeM3MKh6ZOzhVjo7wKTAC IqqgQ2zZu3fSO3tqVYm5vYSk6bF0o819y2tiS/OTF1wCzCmWQ/eoczRz9GSfkHXdqNGn ET7ixl/C+7sh/jdAecuHccCSm0fXfJk+h85RNfD7WVPwHCj0RFGD63MWbMkghCx1S4JY XBmDfjUChVxH8mOgoNDI/FS5bqQ76XsVAmKIo++I6j+KHIi7h3rnZoAQWvr9pUkC/Ne1 VrRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Si9XFxNri8mLzDVBs0OAg9hzoexdDFNJE3YaOOciu+c=; b=U+6Fp1i+WQpA4dshXpWDJgxlR5ixXA0GK1gCyKf99/qftRnKiOG1HDupWvU9WiVkPa YutHdCwE58fxS+KIVQB/8J1JTFgnApEFq3lGNDKEmmfzrAsyfnvDg2ZnFmFWDQ7W5e9b bztq6tTOF7LIGt7FEPg5SHy3GJlsIpL9Qc+I79yo+zE2E7oJB3Dw9FKHYd9zutOvuDLk JoxU/oeA7txVgTlEag1XTPc3CwkCUgrHuJoZc0wr34oViKMrPdqwC1n13QGc0asn28rr tM7W1yhWu/i6oYgaRCilEQLLEWSUl71Y7C2+rYe8ohgOy6uOSJcNoq7Ka81oQKxNHcnP yLgQ== X-Gm-Message-State: ANoB5plfevxvSVsxfGKlHZ4oFahNDZQVzbjudHgO7Aj7dCJla/9m3rAf hIG0hAbC55YSzcdbSjIgrk0= X-Received: by 2002:aa7:c3d1:0:b0:45a:2d7c:f3a0 with SMTP id l17-20020aa7c3d1000000b0045a2d7cf3a0mr597699edr.98.1668155868387; Fri, 11 Nov 2022 00:37:48 -0800 (PST) Received: from localhost.localdomain (ip5f5abb9a.dynamic.kabel-deutschland.de. [95.90.187.154]) by smtp.gmail.com with ESMTPSA id b2-20020a1709063ca200b007ae566edb8bsm643190ejh.73.2022.11.11.00.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 00:37:48 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 4/4] staging: r8188eu: binstallGrpkey is set to _FAIL Date: Fri, 11 Nov 2022 09:37:33 +0100 Message-Id: <20221111083733.3144-5-straube.linux@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111083733.3144-1-straube.linux@gmail.com> References: <20221111083733.3144-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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?1749188602482625743?= X-GMAIL-MSGID: =?utf-8?q?1749188602482625743?= The variable binstallGrpkey is set to _FAIL which is defined as 0. Use false to set the variable to get rid of another use of _FAIL. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/os_dep/os_intfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index 44eb95a7682c..2f59bb994796 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -405,7 +405,7 @@ static void rtw_init_default_value(struct adapter *padapter) pmlmepriv->htpriv.ampdu_enable = false;/* set to disabled */ /* security_priv */ - psecuritypriv->binstallGrpkey = _FAIL; + psecuritypriv->binstallGrpkey = false; psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt; psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */