2017-09-29 18:54:00

by Shreeya Patel

[permalink] [raw]
Subject: [PATCH] Staging: rtl8723bs: Remove unnecessary comments.

The comments regarding memset are not needed in the
files which have been modified since the necessary changes
are already there in the files.

Signed-off-by: Shreeya Patel <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 3 ---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 3 ---
drivers/staging/rtl8723bs/core/rtw_recv.c | 3 ---
drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 ---
4 files changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 6b77820..5b583f7 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -28,9 +28,6 @@ sint _rtw_init_mlme_priv(struct adapter *padapter)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
sint res = _SUCCESS;

- /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
- /* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */
-
pmlmepriv->nic_hdl = (u8 *)padapter;

pmlmepriv->pscanned = NULL;
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index b6d137f..ca35c1c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -474,9 +474,6 @@ int init_mlme_ext_priv(struct adapter *padapter)
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);

- /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
- /* memset((u8 *)pmlmeext, 0, sizeof(struct mlme_ext_priv)); */
-
pmlmeext->padapter = padapter;

/* fill_fwpriv(padapter, &(pmlmeext->fwpriv)); */
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 68a6303..9c08307 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -46,9 +46,6 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
union recv_frame *precvframe;
sint res = _SUCCESS;

- /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
- /* memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */
-
spin_lock_init(&precvpriv->lock);

_rtw_init_queue(&precvpriv->free_recv_queue);
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 022f654..8cd05f8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -51,9 +51,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
struct xmit_frame *pxframe;
sint res = _SUCCESS;

- /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
- /* memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */
-
spin_lock_init(&pxmitpriv->lock);
spin_lock_init(&pxmitpriv->lock_sctx);
sema_init(&pxmitpriv->xmit_sema, 0);
--
2.7.4


2017-09-29 21:10:45

by Julia Lawall

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl8723bs: Remove unnecessary comments.



On Sat, 30 Sep 2017, Shreeya Patel wrote:

> The comments regarding memset are not needed in the
> files which have been modified since the necessary changes
> are already there in the files.

The comments don't look very useful, but I don't understand "since the
necessary changes are alread there in the files"

julia


>
> Signed-off-by: Shreeya Patel <[email protected]>
> ---
> drivers/staging/rtl8723bs/core/rtw_mlme.c | 3 ---
> drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 3 ---
> drivers/staging/rtl8723bs/core/rtw_recv.c | 3 ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 ---
> 4 files changed, 12 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index 6b77820..5b583f7 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -28,9 +28,6 @@ sint _rtw_init_mlme_priv(struct adapter *padapter)
> struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
> sint res = _SUCCESS;
>
> - /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
> - /* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */
> -
> pmlmepriv->nic_hdl = (u8 *)padapter;
>
> pmlmepriv->pscanned = NULL;
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> index b6d137f..ca35c1c 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> @@ -474,9 +474,6 @@ int init_mlme_ext_priv(struct adapter *padapter)
> struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
> struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
>
> - /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
> - /* memset((u8 *)pmlmeext, 0, sizeof(struct mlme_ext_priv)); */
> -
> pmlmeext->padapter = padapter;
>
> /* fill_fwpriv(padapter, &(pmlmeext->fwpriv)); */
> diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
> index 68a6303..9c08307 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> @@ -46,9 +46,6 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
> union recv_frame *precvframe;
> sint res = _SUCCESS;
>
> - /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
> - /* memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */
> -
> spin_lock_init(&precvpriv->lock);
>
> _rtw_init_queue(&precvpriv->free_recv_queue);
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 022f654..8cd05f8 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -51,9 +51,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
> struct xmit_frame *pxframe;
> sint res = _SUCCESS;
>
> - /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
> - /* memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */
> -
> spin_lock_init(&pxmitpriv->lock);
> spin_lock_init(&pxmitpriv->lock_sctx);
> sema_init(&pxmitpriv->xmit_sema, 0);
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1506711232-19670-1-git-send-email-shreeya.patel23498%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

2017-09-29 21:35:22

by Shreeya Patel

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl8723bs: Remove unnecessary comments.

On Fri, 2017-09-29 at 23:10 +0200, Julia Lawall wrote:
>
> On Sat, 30 Sep 2017, Shreeya Patel wrote:
>
> >
> > The comments regarding memset are not needed in the
> > files which have been modified since the necessary changes
> > are already there in the files.
> The comments don't look very useful, but I don't understand "since
> the
> necessary changes are alread there in the files"
>
> julia


The comments are put to notify that memset() is not required because
vzalloc is used. But we don't need this comment as patches for this
driver has already been applied to remove memset() code. Also I have
checked the whole file, but there isn't any place where memset() needs
to be removed.

 
>
>
> >
> >
> > Signed-off-by: Shreeya Patel <[email protected]>
> > ---
> >  drivers/staging/rtl8723bs/core/rtw_mlme.c     | 3 ---
> >  drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 3 ---
> >  drivers/staging/rtl8723bs/core/rtw_recv.c     | 3 ---
> >  drivers/staging/rtl8723bs/core/rtw_xmit.c     | 3 ---
> >  4 files changed, 12 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > index 6b77820..5b583f7 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > @@ -28,9 +28,6 @@ sint _rtw_init_mlme_priv(struct adapter
> > *padapter)
> >   struct mlme_priv  *pmlmepriv = &padapter->mlmepriv;
> >   sint res = _SUCCESS;
> >
> > - /*  We don't need to memset padapter->XXX to zero, because
> > adapter is allocated by vzalloc(). */
> > - /* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv));
> > */
> > -
> >   pmlmepriv->nic_hdl = (u8 *)padapter;
> >
> >   pmlmepriv->pscanned = NULL;
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > index b6d137f..ca35c1c 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > @@ -474,9 +474,6 @@ int init_mlme_ext_priv(struct adapter
> > *padapter)
> >   struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
> >   struct mlme_ext_info *pmlmeinfo = &(pmlmeext-
> > >mlmext_info);
> >
> > - /*  We don't need to memset padapter->XXX to zero, because
> > adapter is allocated by vzalloc(). */
> > - /* memset((u8 *)pmlmeext, 0, sizeof(struct
> > mlme_ext_priv)); */
> > -
> >   pmlmeext->padapter = padapter;
> >
> >   /* fill_fwpriv(padapter, &(pmlmeext->fwpriv)); */
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c
> > b/drivers/staging/rtl8723bs/core/rtw_recv.c
> > index 68a6303..9c08307 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> > @@ -46,9 +46,6 @@ sint _rtw_init_recv_priv(struct recv_priv
> > *precvpriv, struct adapter *padapter)
> >   union recv_frame *precvframe;
> >   sint res = _SUCCESS;
> >
> > - /*  We don't need to memset padapter->XXX to zero, because
> > adapter is allocated by vzalloc(). */
> > - /* memset((unsigned char *)precvpriv, 0, sizeof
> > (struct  recv_priv)); */
> > -
> >   spin_lock_init(&precvpriv->lock);
> >
> >   _rtw_init_queue(&precvpriv->free_recv_queue);
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > index 022f654..8cd05f8 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > @@ -51,9 +51,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv
> > *pxmitpriv, struct adapter *padapter)
> >   struct xmit_frame *pxframe;
> >   sint res = _SUCCESS;
> >
> > - /*  We don't need to memset padapter->XXX to zero, because
> > adapter is allocated by vzalloc(). */
> > - /* memset((unsigned char *)pxmitpriv, 0, sizeof(struct
> > xmit_priv)); */
> > -
> >   spin_lock_init(&pxmitpriv->lock);
> >   spin_lock_init(&pxmitpriv->lock_sctx);
> >   sema_init(&pxmitpriv->xmit_sema, 0);
> > --
> > 2.7.4
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to [email protected].
> > To post to this group, send email to outreachy-kernel@googlegroups.
> > com.
> > To view this discussion on the web visit https://groups.google.com/
> > d/msgid/outreachy-kernel/1506711232-19670-1-git-send-email-
> > shreeya.patel23498%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >

2017-09-30 05:21:49

by Julia Lawall

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl8723bs: Remove unnecessary comments.



On Sat, 30 Sep 2017, Shreeya Patel wrote:

> On Fri, 2017-09-29 at 23:10 +0200, Julia Lawall wrote:
> >
> > On Sat, 30 Sep 2017, Shreeya Patel wrote:
> >
> > >
> > > The comments regarding memset are not needed in the
> > > files which have been modified since the necessary changes
> > > are already there in the files.
> > The comments don't look very useful, but I don't understand "since
> > the
> > necessary changes are alread there in the files"
> >
> > julia
>
>
> The comments are put to notify that memset() is not required because
> vzalloc is used. But we don't need this comment as patches for this
> driver has already been applied to remove memset() code. Also I have
> checked the whole file, but there isn't any place where memset() needs
> to be removed.

My interpretation was that the comments were there to explain why the call
to memset is in comments. But both could just go. There is another
commented call to memset in rtw_recv.c that doesn't have the preceding
justification. That could go too.

julia

>
> ?
> >
> >
> > >
> > >
> > > Signed-off-by: Shreeya Patel <[email protected]>
> > > ---
> > > ?drivers/staging/rtl8723bs/core/rtw_mlme.c?????| 3 ---
> > > ?drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 3 ---
> > > ?drivers/staging/rtl8723bs/core/rtw_recv.c?????| 3 ---
> > > ?drivers/staging/rtl8723bs/core/rtw_xmit.c?????| 3 ---
> > > ?4 files changed, 12 deletions(-)
> > >
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > > b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > > index 6b77820..5b583f7 100644
> > > --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > > @@ -28,9 +28,6 @@ sint _rtw_init_mlme_priv(struct adapter
> > > *padapter)
> > > ? struct mlme_priv? *pmlmepriv = &padapter->mlmepriv;
> > > ? sint res = _SUCCESS;
> > >
> > > - /*??We don't need to memset padapter->XXX to zero, because
> > > adapter is allocated by vzalloc(). */
> > > - /* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv));
> > > */
> > > -
> > > ? pmlmepriv->nic_hdl = (u8 *)padapter;
> > >
> > > ? pmlmepriv->pscanned = NULL;
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > > b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > > index b6d137f..ca35c1c 100644
> > > --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > > @@ -474,9 +474,6 @@ int init_mlme_ext_priv(struct adapter
> > > *padapter)
> > > ? struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
> > > ? struct mlme_ext_info *pmlmeinfo = &(pmlmeext-
> > > >mlmext_info);
> > >
> > > - /*??We don't need to memset padapter->XXX to zero, because
> > > adapter is allocated by vzalloc(). */
> > > - /* memset((u8 *)pmlmeext, 0, sizeof(struct
> > > mlme_ext_priv)); */
> > > -
> > > ? pmlmeext->padapter = padapter;
> > >
> > > ? /* fill_fwpriv(padapter, &(pmlmeext->fwpriv)); */
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c
> > > b/drivers/staging/rtl8723bs/core/rtw_recv.c
> > > index 68a6303..9c08307 100644
> > > --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> > > +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> > > @@ -46,9 +46,6 @@ sint _rtw_init_recv_priv(struct recv_priv
> > > *precvpriv, struct adapter *padapter)
> > > ? union recv_frame *precvframe;
> > > ? sint res = _SUCCESS;
> > >
> > > - /*??We don't need to memset padapter->XXX to zero, because
> > > adapter is allocated by vzalloc(). */
> > > - /* memset((unsigned char *)precvpriv, 0, sizeof
> > > (struct??recv_priv)); */
> > > -
> > > ? spin_lock_init(&precvpriv->lock);
> > >
> > > ? _rtw_init_queue(&precvpriv->free_recv_queue);
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > > b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > > index 022f654..8cd05f8 100644
> > > --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > > +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > > @@ -51,9 +51,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv
> > > *pxmitpriv, struct adapter *padapter)
> > > ? struct xmit_frame *pxframe;
> > > ? sint res = _SUCCESS;
> > >
> > > - /*??We don't need to memset padapter->XXX to zero, because
> > > adapter is allocated by vzalloc(). */
> > > - /* memset((unsigned char *)pxmitpriv, 0, sizeof(struct
> > > xmit_priv)); */
> > > -
> > > ? spin_lock_init(&pxmitpriv->lock);
> > > ? spin_lock_init(&pxmitpriv->lock_sctx);
> > > ? sema_init(&pxmitpriv->xmit_sema, 0);
> > > --
> > > 2.7.4
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it,
> > > send an email to [email protected].
> > > To post to this group, send email to outreachy-kernel@googlegroups.
> > > com.
> > > To view this discussion on the web visit https://groups.google.com/
> > > d/msgid/outreachy-kernel/1506711232-19670-1-git-send-email-
> > > shreeya.patel23498%40gmail.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1506720915.2117.10.camel%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>