linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Aditya Shankar <aditya.shankar@microchip.com>
Cc: arend.vanspriel@broadcom.com, linux-wireless@vger.kernel.org,
	devel@driverdev.osuosl.org, ganesh.krishna@microchip.com
Subject: Re: [PATCH v3] staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler
Date: Tue, 18 Apr 2017 13:50:55 +0200	[thread overview]
Message-ID: <20170418115055.GA17911@kroah.com> (raw)
In-Reply-To: <1491928903-2866-1-git-send-email-aditya.shankar@microchip.com>

On Tue, Apr 11, 2017 at 10:11:43PM +0530, Aditya Shankar wrote:
> Change the config packet format used in handle_set_wfi_drv_handler()
> to align the host driver with the new format used in the wilc firmware.
> 
> The change updates the format in which the host driver provides the
> firmware with the drv_handler index and also uses two new
> fields viz. "mode" and 'name" in the config packet along with this index
> to directly provide details about the interface and its mode to the
> firmware instead of having multiple if-else statements in the host driver
> to decide which interface to configure.
> 
> Signed-off-by: Aditya Shankar <aditya.shankar@microchip.com>
> Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
> ---
> Change in v2: Fix build warning
> Change in v3: Address review comments from v2
> ---
>  drivers/staging/wilc1000/host_interface.c         | 48 ++++++++++++++++++-----
>  drivers/staging/wilc1000/host_interface.h         |  9 ++++-
>  drivers/staging/wilc1000/linux_wlan.c             | 37 +++++------------
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  2 +-
>  drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  1 +
>  drivers/staging/wilc1000/wilc_wlan_if.h           |  2 +-
>  6 files changed, 59 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index c3a8af0..7352488 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -334,14 +334,39 @@ static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
>  {
>  	int ret = 0;
>  	struct wid wid;
> +	u8 *currbyte, *buffer;
> +	struct host_if_drv *hif_drv = NULL;
> +
> +	if (!vif->hif_drv)
> +		return;
> +
> +	if (!hif_drv_handler)
> +		return;
> +
> +	hif_drv	= vif->hif_drv;
> +	buffer = kzalloc(DRV_HANDLER_SIZE, GFP_ATOMIC);
> +
> +	if (!buffer)
> +		return;

Test on the line right after allocation.

And there is no way to return an error from this function?  That seems
bad.

And why do you need GFP_ATOMIC?

And finally, where do you free this buffer?

> @@ -3449,8 +3477,10 @@ void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length)
>  
>  	id = ((buffer[length - 4]) | (buffer[length - 3] << 8) | (buffer[length - 2] << 16) | (buffer[length - 1] << 24));
>  	vif = wilc_get_vif_from_idx(wilc, id);
> +
>  	if (!vif)
>  		return;
> +
>  	hif_drv = vif->hif_drv;
>  
>  	if (!hif_drv || hif_drv == terminated_handle)	{

Unneeded whitespace changes.  Don't do that in a patch that does other
things.

thanks,

greg k-h

      parent reply	other threads:[~2017-04-18 11:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 16:41 [PATCH v3] staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler Aditya Shankar
2017-04-11 17:35 ` Greg KH
2017-04-13  2:44   ` Aditya Shankar
2017-04-18 11:51     ` Greg KH
2017-04-18 11:50 ` Greg KH [this message]

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=20170418115055.GA17911@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=aditya.shankar@microchip.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=ganesh.krishna@microchip.com \
    --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).