Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp3579088rwl; Sun, 6 Nov 2022 01:13:41 -0800 (PST) X-Google-Smtp-Source: AMsMyM7IP/2zrPlQ7WepY+AUg14aVSJ4aiB/giwFU+pTfVaXElUL7gGFNfkkAuqP700hoaKurTJE X-Received: by 2002:a50:c21a:0:b0:463:c2ac:95f6 with SMTP id n26-20020a50c21a000000b00463c2ac95f6mr26775723edf.398.1667726020755; Sun, 06 Nov 2022 01:13:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667726020; cv=none; d=google.com; s=arc-20160816; b=E8EtnlXGvmWaCSDrxd/jkvIBL9UyvGp2o/eEp1HUdjf3PcTnxtHLCCczvyqi6Lvpir cstll79CnCxTcdZL2EHcnH07r7+UJnOE9/be3ezgGyv4TnL9tdip/Yz3y96TL7ccoG2V TKA8hj4Nvmc6gr8XzRCe0GgmNPP4WBbPOHcwItnMEekoPdXtuw5z15PRwuOr03ri+JoA SRL11mE0cB3Sf5/BRgotAhsm3eA8CzU20txMRfEzq6qmPhgOnl/lQPgGS2uKFAk3W7T1 BGebSTr2CZrkh4vJU1OAEudH+omMzWNEbvMtAQit3G5dpKhGQqcCGZM+t9oSVgEs43fH RQhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=3l4jzEeLRkg8lE92fABgUNcuO6SwjrtB4bFsL9Usjs4=; b=bxVmTlGrC7aTJ9/NpMKV03lEeBL1ZpDpInmsoePluzPy/bplLEaaOZwFPTaZp2kfTw tb7b3YS/6Ob+1TLP0016Qr8Wk6ay+OVr/zJ/EWcy4WVgkYPrpF/bw7znjRtoYnBR8QtZ MYDckvbR2W7nPELThuxWD2i1Ik1QOydt+7msif4Se8PAZovSmxvj8lHkYIJGTswpVhxT ey376i9uQxFNk6s4LsAi3F6bbt1FwTKOExB77fhqJoEyIuqFksGjaIy9Fi183cnBhPUq AmyvRmpBMadcNkY89YzrHTRU9vMr3dbQ/RtDdOrOrLof8dPqu48M23dgeob3RUTJdmGA +isg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rn5-20020a170906d92500b0078d0f88a6e9si3879481ejb.284.2022.11.06.01.13.17; Sun, 06 Nov 2022 01:13:40 -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 S229752AbiKFI6Y convert rfc822-to-8bit (ORCPT + 97 others); Sun, 6 Nov 2022 03:58:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiKFI6X (ORCPT ); Sun, 6 Nov 2022 03:58:23 -0500 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B6095 for ; Sun, 6 Nov 2022 01:58:21 -0700 (PDT) Received: from omf04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 708D0140844; Sun, 6 Nov 2022 08:58:20 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA id 5567E20027; Sun, 6 Nov 2022 08:57:23 +0000 (UTC) Message-ID: <6ca906bd81be7c6700068a5c9ba7354e14280619.camel@perches.com> Subject: Re: [PATCH] staging: r8188eu: convert three functions to bool From: Joe Perches To: Michael Straube , gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Date: Sun, 06 Nov 2022 01:58:17 -0700 In-Reply-To: <20221105093916.8255-1-straube.linux@gmail.com> References: <20221105093916.8255-1-straube.linux@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: 5567E20027 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, KHOP_HELO_FCRDNS,SPF_HELO_PASS,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: 4uxoeo1dq3egrbjd7hcj7d3iyewk3jjk X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/LEMc4sjU2B1G35nYKmk26Yld9KNJFg/I= X-HE-Tag: 1667725043-59702 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 On Sat, 2022-11-05 at 10:39 +0100, Michael Straube wrote: > The functions > > is_client_associated_to_ap() > is_client_associated_to_ibss() > is_IBSS_empty() > > return boolean values. Convert their return type to bool and replace > _FAIL, which is defined as 0, with false. Another step to get rid of > _SUCCESS / _FAIL. yay. > diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c [] > +bool is_client_associated_to_ap(struct adapter *padapter) > { > struct mlme_ext_priv *pmlmeext; > struct mlme_ext_info *pmlmeinfo; > > if (!padapter) > - return _FAIL; > + return false; > > pmlmeext = &padapter->mlmeextpriv; > pmlmeinfo = &pmlmeext->mlmext_info; > > if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)) > return true; > - else > - return _FAIL; > + > + return false; instead of if (foo) return true; return false; These could be: return (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE); > +bool is_client_associated_to_ibss(struct adapter *padapter) > { > struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; > struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; > > if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) > return true; > - else > - return _FAIL; > + > + return false; and return (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE);