Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp984324pxb; Tue, 26 Oct 2021 00:09:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhqnxRJRcfKT9+JemeKn13FmMUgNef16I64bDxAkOtYHGuni9AVx8QdbWXJGs2CWzfHzH1 X-Received: by 2002:a05:6402:1d49:: with SMTP id dz9mr32506140edb.55.1635232181200; Tue, 26 Oct 2021 00:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635232181; cv=none; d=google.com; s=arc-20160816; b=BvAFrUjf+rTySgcfkjK2vKWGIZS+e3SNAiVi0NMQHf4IIyBya8VjjZK1qiKo6BrQFU p0Yz+6gvozloZE0lti40k5MR4X+YZriN65knJ1wfEYfkB2lrqX7HXQySIY9VqTv67YtY LlZ6gVtTEswCBjOBm+KshmhxE/ExGtA/mdOyJPlnUL4GZL9Ta14uGjD6rGWdGVkyMY7L bsvIEVOFOytP2TNZxBsy0PDi2g6N07UmzKqbNP2m6fYCYdO5mO4Q+ADo36LdNWYTLRMd CnOGHgvwBdLvZ6LqMyltvmHEWgWuB2t+FA74waW6pTWn8wpvuqdlv2YawgAqJib9K1TH wT5g== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=Hx0Eqo7j7Ae6J4amGIr+4h4z6SdYI7gzU+CGdT6AfLs=; b=bs183K7NwzLjCU98UFBTCed5+Y3kpvO9jeH4j5omrGUuEbVbCpII6wncGbJPU2HEsd hD27EDdHJCBpNCQHxBRERtlmKcpkrKAllKFhIfev8riRN2MKI4+xXNDvnzJSP1QEsq/l kmplln1NILvWrru+Qi42hKCpQBmOJV5riBGBCiZDm46HvmrYz9XTffAJI30ObuFJUPyT wN2CPes0EHkgcqrh7gzibjqK7mRsE2a/8g5VDmsRx87U8x5mx1Otcrw6oXfE5tMtQdxB lqtTuc5E3ng5Rced0CJm6es7ihXIm45SEFvVCZmLqH/dGBwmWQPwUCcB2b88j2YAAOqZ PvVA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si9997111eds.543.2021.10.26.00.09.16; Tue, 26 Oct 2021 00:09:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbhJZEck (ORCPT + 99 others); Tue, 26 Oct 2021 00:32:40 -0400 Received: from smtprelay0215.hostedemail.com ([216.40.44.215]:37350 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230414AbhJZEck (ORCPT ); Tue, 26 Oct 2021 00:32:40 -0400 Received: from omf01.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 0B9871829805C; Tue, 26 Oct 2021 04:30:16 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA id 9DC7917276; Tue, 26 Oct 2021 04:30:14 +0000 (UTC) Message-ID: <8a28c2abf1857c631bd6af52364d7f055a6c0ee9.camel@perches.com> Subject: Re: [PATCH] staging: rtl8723bs: core: remove local variable and goto statement From: Joe Perches To: Saurav Girepunje , gregkh@linuxfoundation.org, fabioaiuto83@gmail.com, ross.schm.dev@gmail.com, marcocesati@gmail.com, matthew.v.deangelis@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com Date: Mon, 25 Oct 2021 21:30:13 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9DC7917276 X-Spam-Status: No, score=1.60 X-Stat-Signature: rqs99ogcamans6mwa5jtuzrr116szy8u X-Rspamd-Server: rspamout02 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19mwDJx49hqd+DvWov5aICK54jupwZnYlQ= X-HE-Tag: 1635222614-65343 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-10-26 at 09:54 +0530, Saurav Girepunje wrote: > In the function rtw_validate_bssid() remove the goto statement. > As on goto exit label, function is returning without any cleanup. > In this function goto statement can be replace by simple return > statement, which will improve readability. After replacing > the goto statement local variable ret is also not needed. So > remove the ret local variable. [] > diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c [] > @@ -24,15 +24,10 @@ u8 rtw_validate_bssid(u8 *bssid) > > u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid) > { > - u8 ret = true; > - > - if (ssid->ssid_length > 32) { > - ret = false; > - goto exit; > - } > + if (ssid->ssid_length > 32) > + return false; > > -exit: > - return ret; > + return true; > } bool rtw_validate_ssid(const struct ndis_802_11_ssid *ssid) { return ssid->ssid_length <= 32; }