linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Geliang Tang <geliangtang@163.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] staging: rtl8723au: use list_for_each_entry*()
Date: Mon, 15 Feb 2016 10:32:31 -0500	[thread overview]
Message-ID: <wrfj4mdaxa40.fsf@redhat.com> (raw)
In-Reply-To: <74d9cc12c94c351d2961d20a8d9f8a2dcdaed4b9.1454815347.git.geliangtang@163.com> (Geliang Tang's message of "Sun, 7 Feb 2016 11:29:58 +0800")

Geliang Tang <geliangtang@163.com> writes:
> Use list_for_each_entry*() instead of list_for_each*() to simplify
> the code.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> Changes in v3:
>  - split it into three patches.
> Changes in v2:
>  - drop the coding style fixing in v1.
> ---
>  drivers/staging/rtl8723au/core/rtw_ap.c           | 55 ++++++++-----------
>  drivers/staging/rtl8723au/core/rtw_mlme.c         | 26 ++++-----
>  drivers/staging/rtl8723au/core/rtw_mlme_ext.c     | 10 ++--
>  drivers/staging/rtl8723au/core/rtw_recv.c         | 22 ++++----
>  drivers/staging/rtl8723au/core/rtw_sta_mgt.c      | 25 ++++-----
>  drivers/staging/rtl8723au/core/rtw_xmit.c         | 64 ++++++++++-------------
>  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 14 +++--
>  drivers/staging/rtl8723au/os_dep/usb_ops_linux.c  |  9 ++--
>  8 files changed, 96 insertions(+), 129 deletions(-)

This one is mostly OK, however when you do multi patch sets, always
include a cover letter describing the overall changes of the set.

A few nit picks:

> diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c
> index 404b618..18b7d03 100644
> --- a/drivers/staging/rtl8723au/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723au/core/rtw_recv.c
> @@ -88,13 +88,13 @@ int _rtw_init_recv_priv23a(struct recv_priv *precvpriv,
>  void _rtw_free_recv_priv23a (struct recv_priv *precvpriv)
>  {
>  	struct rtw_adapter *padapter = precvpriv->adapter;
> -	struct recv_frame *precvframe;
> -	struct list_head *plist, *ptmp;
> +	struct recv_frame *precvframe, *ptmp;
>  
>  	rtw_free_uc_swdec_pending_queue23a(padapter);
>  
> -	list_for_each_safe(plist, ptmp, &precvpriv->free_recv_queue.queue) {
> -		precvframe = container_of(plist, struct recv_frame, list);
> +	list_for_each_entry_safe(precvframe, ptmp,
> +				 &precvpriv->free_recv_queue.queue,
> +				 list) {
>  		list_del_init(&precvframe->list);
>  		kfree(precvframe);
>  	}

Too aggressive line breaking, the 'list' fits within 80 characters on
the line above.

> @@ -195,16 +195,15 @@ using spinlock to protect
>  
>  static void rtw_free_recvframe23a_queue(struct rtw_queue *pframequeue)
>  {
> -	struct recv_frame *hdr;
> -	struct list_head *plist, *phead, *ptmp;
> +	struct recv_frame *hdr, *ptmp;
> +	struct list_head *phead;
>  
>  	spin_lock(&pframequeue->lock);
>  
>  	phead = get_list_head(pframequeue);
>  	plist = phead->next;
>  
> -	list_for_each_safe(plist, ptmp, phead) {
> -		hdr = container_of(plist, struct recv_frame, list);
> +	list_for_each_entry_safe(hdr, ptmp, phead, list) {
>  		rtw_free_recvframe23a(hdr);
>  	}
>  

You could remove the brackets here, since you are fixing that specific
line. I am fine with this as is, some of the checkpatch police force
might bite over it.

On overall this patch is a lot better than the first version.

All set and done, I am thinking of removing this driver once Kalle pulls
in my currently posted set of changes for rtl8xxxu, plus the next one I
have lined up. I seems to me rtl8xxxu can replace rtl8723au at this
point.

I will probably mark rtl8723au deprecated after 4.6 comes out, and
remove the driver around 4.7.

Cheers,
Jes

  parent reply	other threads:[~2016-02-15 15:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-31 15:47 [PATCH] staging: rtl8723au: use list_for_each_entry*() Geliang Tang
2016-01-31 17:49 ` Jes Sorensen
2016-02-01 14:10   ` [PATCH v2] " Geliang Tang
2016-02-02 20:30     ` Jes Sorensen
2016-02-07  3:29       ` [PATCH v3 1/3] " Geliang Tang
2016-02-07  3:29         ` [PATCH v3 2/3] staging: rtl8723au: core: rtw_recv: remove useless codes Geliang Tang
2016-02-07  3:30           ` [PATCH v3 3/3] staging: rtl8723au: whitespace and blank line cleaning Geliang Tang
2016-02-07 22:17             ` Julian Calaby
2016-02-15 15:43               ` Jes Sorensen
2016-02-15 15:33           ` [PATCH v3 2/3] staging: rtl8723au: core: rtw_recv: remove useless codes Jes Sorensen
2016-02-15 15:32         ` Jes Sorensen [this message]
2016-02-17 13:48           ` [PATCH v4 0/3] staging: rtl8723au: use list_for_each_entry*() and cleaning Geliang Tang
2016-02-17 13:48             ` [PATCH v4 1/3] staging: rtl8723au: use list_for_each_entry*() Geliang Tang
2016-02-17 13:48               ` [PATCH v4 2/3] staging: rtl8723au: core: rtw_recv: remove useless codes Geliang Tang
2016-02-17 13:48                 ` [PATCH v4 3/3] staging: rtl8723au: whitespace and blank line cleaning Geliang Tang
2016-02-17 15:16               ` [PATCH v4 1/3] staging: rtl8723au: use list_for_each_entry*() kbuild test robot
2016-02-17 17:28                 ` Jes Sorensen
2016-02-18 14:19                   ` [PATCH v5 0/3] staging: rtl8723au: use list_for_each_entry*() and cleaning Geliang Tang
2016-02-18 14:19                     ` [PATCH v5 1/3] staging: rtl8723au: use list_for_each_entry*() Geliang Tang
2016-02-18 14:19                       ` [PATCH v5 2/3] staging: rtl8723au: core: rtw_recv: remove useless codes Geliang Tang
2016-02-18 14:19                         ` [PATCH v5 3/3] staging: rtl8723au: whitespace and blank line cleaning Geliang Tang
2016-02-18 19:09                     ` [PATCH v5 0/3] staging: rtl8723au: use list_for_each_entry*() and cleaning Jes Sorensen

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=wrfj4mdaxa40.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=geliangtang@163.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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).