public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: navin patidar <navin.patidar@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, Larry.Finger@lwfinger.net
Subject: Re: [PATCH 02/13] staging: rtl8188eu: Remove function rtw_alloc_etherdev()
Date: Tue, 8 Jul 2014 11:55:54 +0300	[thread overview]
Message-ID: <20140708085554.GH25880@mwanda> (raw)
In-Reply-To: <1404758413-12859-2-git-send-email-navin.patidar@gmail.com>

On Tue, Jul 08, 2014 at 12:10:02AM +0530, navin patidar wrote:
> rtw_alloc_etherdev() is used in rtw_init_netdev() but never gets called
> because old_padapter is never NULL.
> 
> Signed-off-by: navin patidar <navin.patidar@gmail.com>
> ---
>  drivers/staging/rtl8188eu/include/osdep_service.h |    1 -
>  drivers/staging/rtl8188eu/os_dep/os_intfs.c       |    4 +---
>  drivers/staging/rtl8188eu/os_dep/osdep_service.c  |   23 ---------------------
>  3 files changed, 1 insertion(+), 27 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h
> index 95131fe..a52dcd5 100644
> --- a/drivers/staging/rtl8188eu/include/osdep_service.h
> +++ b/drivers/staging/rtl8188eu/include/osdep_service.h
> @@ -164,7 +164,6 @@ struct rtw_netdev_priv_indicator {
>  };
>  struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv,
>  						    void *old_priv);
> -struct net_device *rtw_alloc_etherdev(int sizeof_priv);
>  
>  #define rtw_netdev_priv(netdev)					\
>  	(((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv)
> diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> index b0c38a4..c7a44ab 100644
> --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
> @@ -707,14 +707,12 @@ static const struct device_type wlan_type = {
>  struct net_device *rtw_init_netdev(struct adapter *old_padapter)
>  {
>  	struct adapter *padapter;
> -	struct net_device *pnetdev;
> +	struct net_device *pnetdev = NULL;
>  
>  	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+init_net_dev\n"));
>  
>  	if (old_padapter != NULL)
>  		pnetdev = rtw_alloc_etherdev_with_old_priv(sizeof(struct adapter), (void *)old_padapter);

Next time just remove the pointless NULL check as well.  It still falls
under the one thing per patch rule because it's closely related.  It
makes the code more clear and it even makes the patch easier to review.

> -	else
> -		pnetdev = rtw_alloc_etherdev(sizeof(struct adapter));
>  

regards,
dan carpenter


  reply	other threads:[~2014-07-08  8:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 18:40 [PATCH 01/13] staging: rtl8188eu: Remove unused function rtw_change_ifname() navin patidar
2014-07-07 18:40 ` [PATCH 02/13] staging: rtl8188eu: Remove function rtw_alloc_etherdev() navin patidar
2014-07-08  8:55   ` Dan Carpenter [this message]
2014-07-07 18:40 ` [PATCH 03/13] staging: rtl8188eu: Remove unused function efuse_GetCurrentSize() navin patidar
2014-07-07 18:40 ` [PATCH 04/13] staging: rtl8188eu: Remove unused function efuse_GetMaxSize() navin patidar
2014-07-07 18:40 ` [PATCH 05/13] staging: rtl8188eu: rtw_efuse.c : Remove unused functions navin patidar
2014-07-07 18:40 ` [PATCH 06/13] staging: rtl8188eu: Remove unused functions rtw_efuse_map_[read,write]() navin patidar
2014-07-07 18:40 ` [PATCH 07/13] staging: rtl8188eu: Remove unused function HalDetectPwrDownMode88E() navin patidar
2014-07-07 18:40 ` [PATCH 08/13] staging: rtl8188eu: rtw_efuse.c: Remove unused functions navin patidar
2014-07-07 18:40 ` [PATCH 09/13] staging: rtl8188eu: use jiffies_to_msecs() instead of rtw_systime_to_ms() navin patidar
2014-07-07 18:40 ` [PATCH 10/13] staging: rtl8188eu: Use msecs_to_jiffies() instead of rtw_ms_to_systime() navin patidar
2014-07-07 18:40 ` [PATCH 11/13] staging: rtl8188eu: Remove unused function rtw_cbuf_alloc() navin patidar
2014-07-07 18:40 ` [PATCH 12/13] staging: rtl8188eu: Remove unused functions rtw_cbuf_[full, empty, push, pop]() navin patidar
2014-07-07 18:40 ` [PATCH 13/13] staging: rtl8188eu: osdep_service.h: Remove unused struct rtw_cbuf navin patidar

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=20140708085554.GH25880@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=navin.patidar@gmail.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