linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jerome Pouiller <Jerome.Pouiller@silabs.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/7] staging: wfx: simplify memory allocation in wfx_update_filtering()
Date: Tue, 8 Oct 2019 14:59:27 +0300	[thread overview]
Message-ID: <20191008115927.GE25098@kadam> (raw)
In-Reply-To: <20191008094232.10014-2-Jerome.Pouiller@silabs.com>

These patches are good.  I just have a few nits to point out for future
reference.

On Tue, Oct 08, 2019 at 09:42:58AM +0000, Jerome Pouiller wrote:
>  static inline int hif_set_beacon_filter_table(struct wfx_vif *wvif,
> -					      struct hif_mib_bcn_filter_table *ft)
> +					      int tbl_len,
> +					      struct hif_ie_table_entry *tbl)
>  {
> -	size_t buf_len = struct_size(ft, ie_table, ft->num_of_info_elmts);
> +	int ret;
> +	struct hif_mib_bcn_filter_table *val;
> +	int buf_len = struct_size(val, ie_table, tbl_len);

This is fine for now, but since this is networking code, in the future
could you write your declarations in reverse Christmas tree order?

	long laskdfjasldfj asldfkj aslkdfj alskdfj askldfj;
	mid asdfasdflkajdflasjdf lkasjdf;
	short asdfasd;
	shortest i;

>  
> -	cpu_to_le32s(&ft->num_of_info_elmts);
> -	return hif_write_mib(wvif->wdev, wvif->id,
> -			     HIF_MIB_ID_BEACON_FILTER_TABLE, ft, buf_len);

[ snip ]

> diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
> index 2855d14a709c..12198b8f3685 100644
> --- a/drivers/staging/wfx/sta.c
> +++ b/drivers/staging/wfx/sta.c
> @@ -217,14 +217,13 @@ void wfx_update_filtering(struct wfx_vif *wvif)
>  	bool filter_bssid = wvif->filter_bssid;
>  	bool fwd_probe_req = wvif->fwd_probe_req;
>  	struct hif_mib_bcn_filter_enable bf_ctrl;
> -	struct hif_mib_bcn_filter_table *bf_tbl;
> -	struct hif_ie_table_entry ie_tbl[] = {
> +	struct hif_ie_table_entry filter_ies[] = {
>  		{
>  			.ie_id        = WLAN_EID_VENDOR_SPECIFIC,
>  			.has_changed  = 1,
>  			.no_longer    = 1,
>  			.has_appeared = 1,
> -			.oui         = { 0x50, 0x6F, 0x9A},
> +			.oui          = { 0x50, 0x6F, 0x9A },

Please don't do unrelated white space changes in their own patches.

>  		}, {
>  			.ie_id        = WLAN_EID_HT_OPERATION,
>  			.has_changed  = 1,

regards,
dan carpenter


  reply	other threads:[~2019-10-08 11:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08  9:42 [PATCH 0/7] Fix various compilation issues with wfx driver Jerome Pouiller
2019-10-08  9:42 ` [PATCH 1/7] staging: wfx: simplify memory allocation in wfx_update_filtering() Jerome Pouiller
2019-10-08 11:59   ` Dan Carpenter [this message]
2019-10-08  9:42 ` [PATCH 2/7] staging: wfx: remove misused call to cpu_to_le16() Jerome Pouiller
2019-10-08  9:42 ` [PATCH 3/7] staging: wfx: le16_to_cpus() takes a reference as parameter Jerome Pouiller
2019-10-08  9:43 ` [PATCH 4/7] staging: wfx: correctly cast data on big-endian targets Jerome Pouiller
2019-10-08 12:01   ` Dan Carpenter
2019-10-08  9:43 ` [PATCH 5/7] staging: wfx: fix copy_{to,from}_user() usage Jerome Pouiller
2019-10-08  9:43 ` [PATCH 7/7] staging: wfx: avoid namespace contamination Jerome Pouiller
2019-10-08  9:43 ` [PATCH 6/7] staging: wfx: drop calls to BUG_ON() Jerome Pouiller
2019-10-08 12:07   ` Dan Carpenter
2019-10-08 15:10 ` [PATCH 0/7] Fix various compilation issues with wfx driver Greg Kroah-Hartman
2019-10-09 15:13   ` Jerome Pouiller
2019-10-09 18:58     ` Dan Carpenter

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=20191008115927.GE25098@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Jerome.Pouiller@silabs.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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).