From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754791AbdKAQrN (ORCPT ); Wed, 1 Nov 2017 12:47:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbdKAQrL (ORCPT ); Wed, 1 Nov 2017 12:47:11 -0400 Date: Wed, 1 Nov 2017 17:47:23 +0100 From: Greg KH To: Kien Ha Cc: Dan Carpenter , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: rtlwifi: Fix line too long warning Message-ID: <20171101164723.GA9034@kroah.com> References: <1509297176.4894.4.camel@gmail.com> <20171030120214.knmechriwu62yh2t@mwanda> <1509425284.1199.11.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1509425284.1199.11.camel@gmail.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 31, 2017 at 12:48:04AM -0400, Kien Ha wrote: > >From aa0f4ae8c325545b1fd794d6bbf8c4d2f64e2ec2 Mon Sep 17 00:00:00 2001 > From: Kien Ha > Date: Fri, 27 Oct 2017 14:07:55 -0400 > Subject: [PATCH v2] staging: rtlwifi: Fix line too long warning Why is all of this here in the "changelog body" of the patch? > > Made nested if else statement more concise to help conform to coding > style. > > Signed-off-by: Kien Ha > --- > Changes in v2: > - Improve block of code to be more concise > > drivers/staging/rtlwifi/base.c | 25 ++++++++----------------- > 1 file changed, 8 insertions(+), 17 deletions(-) > > diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c > index b88b0e8edd3d..fdd1ab1e38c5 100644 > --- a/drivers/staging/rtlwifi/base.c > +++ b/drivers/staging/rtlwifi/base.c > @@ -1273,23 +1273,14 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, > * and N rate will all be controlled by FW > * when tcb_desc->use_driver_rate = false > */ > - if (sta && sta->vht_cap.vht_supported) { > - tcb_desc->hw_rate = > - _rtl_get_vht_highest_n_rate(hw, sta); > - } else { > - if (sta && (sta->ht_cap.ht_supported)) { > - tcb_desc->hw_rate = > - _rtl_get_highest_n_rate(hw, sta); > - } else { > - if (rtlmac->mode == WIRELESS_MODE_B) { > - tcb_desc->hw_rate = > - rtlpriv->cfg->maps[RTL_RC_CCK_RATE11M]; > - } else { > - tcb_desc->hw_rate = > - rtlpriv->cfg->maps[RTL_RC_OFDM_RATE54M]; > - } > - } > - } > + tcb_desc->hw_rate = > + sta && sta->vht_cap.vht_supported ? > + rtl_get_vht_highest_n_rate(hw, sta) : > + sta && sta->ht_cap.ht_supported ? > + _rtl_get_highest_n_rate(hw, sta) : > + rtlmac->mode == WIRELESS_MODE_B ? > + rtlpriv->cfg->maps[RTL_RC_CCK_RATE11M] : > + rtlpriv->cfg->maps[RTL_RC_OFDM_RATE54M]; That's horrible to read, can you understand it? I hate ? : logic, please write code for people to read, not compilers. thanks, greg k-h