All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Shivani Bhardwaj <shivanib134@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl8712: rtl8712_xmit: Remove unnecessary cast
Date: Wed, 14 Oct 2015 14:44:15 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1510141443020.2421@hadrien> (raw)
In-Reply-To: <20151014122915.GA11874@ubuntu>



On Wed, 14 Oct 2015, Shivani Bhardwaj wrote:

> Explicit typecasting of variables is not required and should be removed.
> Semantic patch used:
> @@
> type T;
> T e;
> identifier x;
> @@
>
> * T x = (T)e;
>
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
>  drivers/staging/rtl8712/rtl8712_xmit.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c
> index 86206d3..9e50bbf 100644
> --- a/drivers/staging/rtl8712/rtl8712_xmit.c
> +++ b/drivers/staging/rtl8712/rtl8712_xmit.c
> @@ -96,7 +96,7 @@ static u32 get_ff_hwaddr(struct xmit_frame *pxmitframe)
>  	u32 addr = 0;
>  	struct pkt_attrib *pattrib = &pxmitframe->attrib;
>  	struct _adapter *padapter = pxmitframe->padapter;
> -	struct dvobj_priv *pdvobj = (struct dvobj_priv *)&padapter->dvobjpriv;
> +	struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
>
>  	if (pxmitframe->frame_tag == TXAGG_FRAMETAG)
>  		addr = RTL8712_DMA_H2CCMD;
> @@ -237,7 +237,7 @@ void r8712_do_queue_select(struct _adapter *padapter,
>  			   struct pkt_attrib *pattrib)
>  {
>  	unsigned int qsel = 0;
> -	struct dvobj_priv *pdvobj = (struct dvobj_priv *)&padapter->dvobjpriv;
> +	struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
>
>  	if (pdvobj->nr_endpoint == 6)
>  		qsel = (unsigned int) pattrib->priority;
> @@ -374,8 +374,8 @@ u8 r8712_dump_aggr_xframe(struct xmit_buf *pxmitbuf,
>  			struct xmit_frame *pxmitframe)
>  {
>  	struct _adapter *padapter = pxmitframe->padapter;
> -	struct dvobj_priv *pdvobj = (struct dvobj_priv *) &padapter->dvobjpriv;
> -	struct tx_desc *ptxdesc = (struct tx_desc *)pxmitbuf->pbuf;
> +	struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
> +	struct tx_desc *ptxdesc   = pxmitbuf->pbuf;

It looks like you have added some space before the =.  I don't think that
is needed.  It wasn't lined up with the previous declaration before, and
it's not lined up with the = on the next line either.

julia

>  	struct cmd_hdr *pcmd_hdr = (struct cmd_hdr *)
>  		(pxmitbuf->pbuf + TXDESC_SIZE);
>  	u16 total_length = (u16) (ptxdesc->txdw0 & 0xffff);
> @@ -419,10 +419,10 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz)
>  	struct qos_priv *pqospriv = &pmlmepriv->qospriv;
>  	struct security_priv *psecuritypriv = &padapter->securitypriv;
>  	struct pkt_attrib *pattrib = &pxmitframe->attrib;
> -	struct tx_desc *ptxdesc = (struct tx_desc *)pmem;
> -	struct dvobj_priv *pdvobj = (struct dvobj_priv *)&padapter->dvobjpriv;
> +	struct tx_desc *ptxdesc    = (struct tx_desc *)pmem;
> +	struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
>  #ifdef CONFIG_R8712_TX_AGGR
> -	struct cmd_priv *pcmdpriv = (struct cmd_priv *)&padapter->cmdpriv;
> +	struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
>  #endif
>  	u8 blnSetTxDescOffset;
>  	sint bmcst = IS_MCAST(pattrib->ra);
> --
> 2.1.0
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> 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/20151014122915.GA11874%40ubuntu.
> For more options, visit https://groups.google.com/d/optout.
>


  reply	other threads:[~2015-10-14 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 12:29 [PATCH] Staging: rtl8712: rtl8712_xmit: Remove unnecessary cast Shivani Bhardwaj
2015-10-14 12:44 ` Julia Lawall [this message]
2015-10-14 13:26   ` [Outreachy kernel] " Shivani Bhardwaj

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=alpine.DEB.2.10.1510141443020.2421@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=shivanib134@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.