From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2508FC433F5 for ; Tue, 29 Mar 2022 19:58:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241103AbiC2UAS (ORCPT ); Tue, 29 Mar 2022 16:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235687AbiC2UAM (ORCPT ); Tue, 29 Mar 2022 16:00:12 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F9DDF1E for ; Tue, 29 Mar 2022 12:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648583908; x=1680119908; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6lXzXPNeWSTZUKpGd3f1DaStNivl3hsDdk61LrorPAo=; b=bp83OO7zxePMZs1hkZvUppQqyBFhJ3lhdRwu69vm1a4K2VvwWYL6YOKP ZDtGAHDZiGl9NUDN1JLZ4IfkshSono18/XVrHdymhB6DvBkKYTvKJft0h hlXGhT4Iq9en8L2jJ8TjK8zW9filVUcyb83z/E3VUQZONuVJtNmQGqEI/ CTlUejL/PpudckRwXd4nCm10nQ6kFmPlhkYoCl8treV/05V6cfzoQk84U 8Rg51kAPGFD4jCDIHyo0WN4UHdhKe2oUbDnsgMXnRyLsIjmjvpeXDJPqg ymjE2t9a4P+z+BhIwTdQKkuGEoxmSdfVNxCWJVy+UYpbC90gVsHvA6+pZ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10301"; a="246850540" X-IronPort-AV: E=Sophos;i="5.90,220,1643702400"; d="scan'208";a="246850540" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 12:58:27 -0700 X-IronPort-AV: E=Sophos;i="5.90,220,1643702400"; d="scan'208";a="564919141" Received: from alison-desk.jf.intel.com (HELO alison-desk) ([10.54.74.41]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 12:58:27 -0700 Date: Tue, 29 Mar 2022 13:00:53 -0700 From: Alison Schofield To: Sevinj Aghayeva Cc: Greg Kroah-Hartman , Fabio Aiuto , Lee Jones , Muhammad Usama Anjum , "Fabio M. De Francesco" , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev Subject: Re: [PATCH] staging: rtl8723bs: Remove redundant else branches. Message-ID: <20220329200053.GA1170989@alison-desk> References: <20220329140904.GA3566@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220329140904.GA3566@ubuntu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sevinj, You can do this to make sure your commit msg 'looks' similar to others in the file: $git log --pretty=oneline --abbrev-commit d6ad258ae15d staging: rtl8723bs: Remove redundant else branches. 24e65aac9457 staging: rtl8723bs: remove rf type branching (fourth patch) 167fc30e8e51 staging: rtl8723bs: remove unused macros d7361874468f staging: rtl8723bs: fix camel case in struct wlan_bcn_info 6994aa430368 staging: rtl8723bs: fix camel case in struct ndis_802_11_ssid That tells me the 'Remove' should not start with an uppercase and there should be no period at the end of line. Note that I look at this per patch, because different drivers and subsystems have different conventions. The point is to try to discern the prevailing style, and follow it. Please check the get_maintainers instruction in the first patch tutorial. I only got this: $ git show HEAD | perl scripts/get_maintainer.pl --separator , --nokeywords --nogit --nogit-fallback --norolestats Greg Kroah-Hartman ,linux-staging@lists.linux.dev,linux-kernel@vger.kernel.org On Tue, Mar 29, 2022 at 07:09:04AM -0700, Sevinj Aghayeva wrote: Please state the 'why' of this patch. ie something like: Adhere to Linux kernel coding style. > This patch fixes the following checkpatch.pl warning: The phrases 'This patch' is frowned upon as unecessarily wordy. Perhaps simply: Reported by checkpatch: You have another patch in flight with similar things to update. Please post a v2 of that one that addresses the feedback given here. I thought both patches had good scope in that they addressed multiple instances of the same issue in a single file. Thanks! Alison > > WARNING: else is not generally useful after a break or return > > Signed-off-by: Sevinj Aghayeva > --- > .../staging/rtl8723bs/core/rtw_ieee80211.c | 32 ++++++++----------- > 1 file changed, 13 insertions(+), 19 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c > index b449be537376..27de086903e2 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c > +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c > @@ -94,16 +94,14 @@ bool rtw_is_cckratesonly_included(u8 *rate) > > int rtw_check_network_type(unsigned char *rate, int ratelen, int channel) > { > - if (channel > 14) { > + if (channel > 14) > return WIRELESS_INVALID; > - } else { /* could be pure B, pure G, or B/G */ > - if (rtw_is_cckratesonly_included(rate)) > - return WIRELESS_11B; > - else if (rtw_is_cckrates_included(rate)) > - return WIRELESS_11BG; > - else > - return WIRELESS_11G; > - } > + /* could be pure B, pure G, or B/G */ > + if (rtw_is_cckratesonly_included(rate)) > + return WIRELESS_11B; > + if (rtw_is_cckrates_included(rate)) > + return WIRELESS_11BG; > + return WIRELESS_11G; > } > > u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source, > @@ -151,11 +149,10 @@ u8 *rtw_get_ie(u8 *pbuf, signed int index, signed int *len, signed int limit) > if (*p == index) { > *len = *(p + 1); > return p; > - } else { > - tmp = *(p + 1); > - p += (tmp + 2); > - i += (tmp + 2); > } > + tmp = *(p + 1); > + p += (tmp + 2); > + i += (tmp + 2); > if (i >= limit) > break; > } > @@ -199,9 +196,8 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u > *ielen = in_ie[cnt+1]+2; > > break; > - } else { > - cnt += in_ie[cnt+1]+2; /* goto next */ > } > + cnt += in_ie[cnt+1]+2; /* goto next */ > } > > return target_ie; > @@ -697,9 +693,8 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) > cnt += in_ie[cnt+1]+2; > > break; > - } else { > - cnt += in_ie[cnt+1]+2; /* goto next */ > } > + cnt += in_ie[cnt+1]+2; /* goto next */ > } > > return wpsie_ptr; > @@ -748,9 +743,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att > *len_attr = attr_len; > > break; > - } else { > - attr_ptr += attr_len; /* goto next */ > } > + attr_ptr += attr_len; /* goto next */ > } > > return target_attr_ptr; > -- > 2.25.1 > >