Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467264

Re: [PATCH] Staging: wlan-ng: improved code in p80211req.c file

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] Staging: wlan-ng: improved code in p80211req.c file
Date 2016-08-21 23:30 +0200
Message-ID <s8ItA-5Ge-21@gated-at.bofh.it> (permalink)
References <s8gnD-4JP-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Aug 20, 2016 at 06:20:00PM +0300, Claudiu Beznea wrote:
> This patch improves code from p80211req.c file by removing
> duplicate code, by keeping count of returning code of
> the called functions and also aesthetically.
> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
> ---
>  drivers/staging/wlan-ng/p80211req.c | 163 +++++++++++++++++++-----------------
>  1 file changed, 84 insertions(+), 79 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c
> index 4b84b56..900635e 100644
> --- a/drivers/staging/wlan-ng/p80211req.c
> +++ b/drivers/staging/wlan-ng/p80211req.c
> @@ -72,10 +72,12 @@
>  #include "p80211metastruct.h"
>  #include "p80211req.h"
>  
> -static void p80211req_handlemsg(wlandevice_t *wlandev, struct p80211msg *msg);
> -static void p80211req_mibset_mibget(wlandevice_t *wlandev,
> +static int p80211req_handlemsg(wlandevice_t *wlandev, struct p80211msg *msg);
> +static int p80211req_mibset_mibget(wlandevice_t *wlandev,
>  				   struct p80211msg_dot11req_mibget *mib_msg,
>  				   int isget);
> +static void p80211req_handle_action(struct wlandevice *wlandev, u32 *data,
> +				    int isget, u32 flag);
>  
>  /*----------------------------------------------------------------
>  * p80211req_dorequest
> @@ -96,6 +98,7 @@ static void p80211req_mibset_mibget(wlandevice_t *wlandev,
>  int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf)
>  {
>  	struct p80211msg *msg = (struct p80211msg *) msgbuf;
> +	int rc = 0;
>  
>  	/* Check to make sure the MSD is running */
>  	if (!((wlandev->msdstate == WLAN_MSD_HWPRESENT &&
> @@ -107,7 +110,7 @@ int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf)
>  
>  	/* Check Permissions */
>  	if (!capable(CAP_NET_ADMIN) &&
> -	(msg->msgcode != DIDmsg_dot11req_mibget)) {
> +	    (msg->msgcode != DIDmsg_dot11req_mibget)) {
>  		netdev_err(wlandev->netdev,

This is a fine change, but you are trying to do too many different
things in this patch.

Remember, only do one type of thing per patch please.

thanks,

greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] Staging: wlan-ng: improved code in p80211req.c file Claudiu Beznea <claudiu.beznea@gmail.com> - 2016-08-20 17:30 +0200
  Re: [PATCH] Staging: wlan-ng: improved code in p80211req.c file Greg KH <gregkh@linuxfoundation.org> - 2016-08-21 23:30 +0200

csiph-web