linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ajay Singh <ajay.kathat@microchip.com>
Cc: Claudiu Beznea <Claudiu.Beznea@microchip.com>,
	devel@driverdev.osuosl.org, venkateswara.kaja@microchip.com,
	gregkh@linuxfoundation.org, linux-wireless@vger.kernel.org,
	ganesh.krishna@microchip.com, adham.abozaeid@microchip.com,
	aditya.shankar@microchip.com
Subject: Re: [PATCH 20/24] staging: wilc1000: avoid line over 80 chars in tcp_process()
Date: Mon, 27 Aug 2018 15:00:50 +0300	[thread overview]
Message-ID: <20180827120050.mrzhtrstrg7or2to@mwanda> (raw)
In-Reply-To: <20180827105438.5443cdfa@ajaysk-VirtualBox>

On Mon, Aug 27, 2018 at 10:54:38AM +0530, Ajay Singh wrote:
> Hi Claudiu,
> 
> On Fri, 24 Aug 2018 12:31:28 +0300
> Claudiu Beznea <Claudiu.Beznea@microchip.com> wrote:
> 
> > On 23.08.2018 13:33, Ajay Singh wrote:
> > > On Thu, 23 Aug 2018 11:12:08 +0300
> > > Claudiu Beznea <Claudiu.Beznea@microchip.com> wrote:
> > >   
> > >> On 14.08.2018 09:50, Ajay Singh wrote:  
> > >>> Cleanup patch to avoid line over 80 chars issue reported by
> > >>> checkpatch.pl script.
> > >>>
> > >>> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> > >>> ---
> > >>>  drivers/staging/wilc1000/wilc_wlan.c | 7 ++++++-
> > >>>  1 file changed, 6 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/drivers/staging/wilc1000/wilc_wlan.c
> > >>> b/drivers/staging/wilc1000/wilc_wlan.c index 041c9dd..f0743d9
> > >>> 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c
> > >>> +++ b/drivers/staging/wilc1000/wilc_wlan.c
> > >>> @@ -137,6 +137,11 @@ static inline int add_tcp_pending_ack(struct
> > >>> wilc_vif *vif, u32 ack, return 0;
> > >>>  }
> > >>>  
> > >>> +static inline void clear_tcp_session_txq(struct wilc_vif *vif,
> > >>> int index) +{
> > >>> +	vif->ack_filter.pending_acks_info[index].txqe = NULL;
> > >>> +}
> > >>> +    
> > >>
> > >> This seems useless to me...  
> > > 
> > > Sorry, this point is not fully clear to me.
> > > 
> > > Did you mean setting of 'NULL' to 'pending_acks_info[index].txqe' is
> > > not required?
> > >   
> > 
> > No, having a new function that sets a variable just to avoid line
> > over 80 warning.
> 
> Okay got it.
> How about using a temp variable to hold the value of
> 'tqe->tcp_pending_ack_idx'. It can also help to overcome the
> checkpatch warning.

Just ignore the checkpatch warning...  Don't add a temporary variable
just to please checkpatch...  It's good to fix checkpatch warnings if
it makes the code cleaner, but I hate when people do:

	tmp = some_long_variable_name;
	some_other_long_variable = tmp;

The tmp variable is only used one time and a simple statement becomes
two statements and it breaks grep.

You could consider renaming some of the variables.  I think the "_info"
doesn't add anything, because obviously it's information.  Maybe
"tcp_pending_ack_index" could just become "->ack_idx".

			vif->ack_filter.pending_ack[tqe->ack_idx].txqe = NULL;

It's still very searchable.  If you grep for "ack_idx" then the pending
and TCP are right there so no information is lost.

regards,
dan carpenter

  reply	other threads:[~2018-08-27 15:47 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14  6:49 [PATCH 00/24] staging: wilc1000: avoid use of static and global variable Ajay Singh
2018-08-14  6:49 ` [PATCH 01/24] staging: wilc1000: move 'wilc_enable_ps' global variable into 'wilc' struct Ajay Singh
2018-08-14  6:49 ` [PATCH 02/24] staging: wilc1000: move 'aging_timer' static variable to wilc_priv struct Ajay Singh
2018-08-14  6:49 ` [PATCH 03/24] staging: wilc1000: fix to use correct index to free scanned info in clear_shadow_scan() Ajay Singh
2018-08-14  6:49 ` [PATCH 04/24] staging: wilc1000: remove unnecessary NULL check " Ajay Singh
2018-08-14  6:49 ` [PATCH 05/24] staging: wilc1000: moved last_scanned_shadow & last_scanned_cnt to wilc_priv struct Ajay Singh
2018-08-14  6:49 ` [PATCH 06/24] staging: wilc1000: move during_ip_timer & wilc_optaining_ip to 'wilc_vif' struct Ajay Singh
2018-08-23  8:09   ` Claudiu Beznea
2018-08-23  9:43     ` Ajay Singh
2018-08-24  8:47       ` Claudiu Beznea
2018-08-14  6:49 ` [PATCH 07/24] staging: wilc1000: remove unused variable 'op_ifcs' Ajay Singh
2018-08-14  6:50 ` [PATCH 08/24] staging: wilc1000: avoid use of extra 'if' condition in wilc_init() Ajay Singh
2018-08-14  6:50 ` [PATCH 09/24] staging: wilc1000: move static variable clients_count to 'wilc' structure Ajay Singh
2018-08-23  8:09   ` Claudiu Beznea
2018-08-25  0:13     ` Adham Abozaeid
2018-08-14  6:50 ` [PATCH 10/24] staging: wilc1000: move wilc_multicast_mac_addr_list to 'wilc_vif' struct Ajay Singh
2018-08-23  8:10   ` Claudiu Beznea
2018-08-23 10:00     ` Ajay Singh
2018-08-24  8:47       ` Claudiu Beznea
2018-08-25  0:32         ` Adham Abozaeid
2018-08-27  5:40           ` Ajay Singh
2018-08-14  6:50 ` [PATCH 11/24] staging: wilc1000: move hif specific static variables to 'wilc' structure Ajay Singh
2018-08-23  8:11   ` Claudiu Beznea
2018-08-23 10:09     ` Ajay Singh
2018-08-24  8:47       ` Claudiu Beznea
2018-08-14  6:50 ` [PATCH 12/24] staging: wilc1000: move static variable 'terminated_handle' to wilc_vif struct Ajay Singh
2018-08-23  8:11   ` Claudiu Beznea
2018-08-23 14:36     ` Ajay Singh
2018-08-24  8:46       ` Claudiu Beznea
2018-08-27  5:27         ` Ajay Singh
2018-08-14  6:50 ` [PATCH 13/24] staging: wilc1000: move 'periodic_rssi' as part of 'wilc_vif' struct Ajay Singh
2018-08-14  6:50 ` [PATCH 14/24] staging: wilc1000: rename 'dummy_statistics' variable to 'periodic_stat' Ajay Singh
2018-08-14  6:50 ` [PATCH 15/24] staging: wilc1000: move 'rcv_assoc_resp' as part of hif_drv Ajay Singh
2018-08-14  6:50 ` [PATCH 16/24] staging: wilc1000: refactor tcp_process() to avoid extra leading tabs Ajay Singh
2018-08-14  6:50 ` [PATCH 17/24] staging: wilc1000: use lowercase for get_BSSID() and HIL variable Ajay Singh
2018-08-14  6:50 ` [PATCH 18/24] staging: wilc1000: move tcp_ack_filter algo related variables to 'wilc_vif' struct Ajay Singh
2018-08-14  6:50 ` [PATCH 19/24] staging: wilc1000: avoid line over 80 chars in wilc_wlan_txq_filter_dup_tcp_ack() Ajay Singh
2018-08-23  8:11   ` Claudiu Beznea
2018-08-23 12:18     ` Ajay Singh
2018-08-14  6:50 ` [PATCH 20/24] staging: wilc1000: avoid line over 80 chars in tcp_process() Ajay Singh
2018-08-23  8:12   ` Claudiu Beznea
2018-08-23 10:33     ` Ajay Singh
2018-08-24  9:31       ` Claudiu Beznea
2018-08-27  5:24         ` Ajay Singh
2018-08-27 12:00           ` Dan Carpenter [this message]
2018-08-28  4:29             ` Ajay Singh
2018-08-14  6:50 ` [PATCH 21/24] staging: wilc1000: remove unused code to set and get IP address Ajay Singh
2018-08-14  6:50 ` [PATCH 22/24] staging: wilc1000: move 'chip_ps_state' static variable as part of 'wilc' struct Ajay Singh
2018-08-14  6:50 ` [PATCH 23/24] staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' struct Ajay Singh
2018-08-23  8:12   ` Claudiu Beznea
2018-08-23 10:55   ` Greg KH
2018-08-23 11:27     ` Ajay Singh
2018-08-23 12:37       ` Dan Carpenter
2018-08-23 13:06         ` Ajay Singh
2018-08-14  6:50 ` [PATCH 24/24] staging: wilc1000: remove unnecessary static variable 'p2p_listen_state' Ajay Singh
2018-08-23  8:13   ` Claudiu Beznea
2018-08-23 12:07     ` Ajay Singh
2018-08-23  8:09 ` [PATCH 00/24] staging: wilc1000: avoid use of static and global variable Claudiu Beznea
2018-08-23  9:35   ` Ajay Singh
2018-08-27 17:10 ` Greg KH
2018-08-28  4:35   ` Ajay Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180827120050.mrzhtrstrg7or2to@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=adham.abozaeid@microchip.com \
    --cc=aditya.shankar@microchip.com \
    --cc=ajay.kathat@microchip.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=ganesh.krishna@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=venkateswara.kaja@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).