All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Namrata A Shettar <namrataashettar@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Malcolm Priestley <tvboxspy@gmail.com>,
	 Alison Schofield <amsfield22@gmail.com>,
	 maomao xu <albert008.xu@gmail.com>,
	Othmar Pasteka <pasteka@kabsi.at>,
	 Parth Sane <laerdevstudios@gmail.com>,
	 Wolfram Sang <wsa-dev@sang-engineering.com>,
	 outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: Re: [Outreachy kernel] [PATCH 3/6] staging: vt6656: main_usb: Replace data type declaration with variable of same type
Date: Thu, 15 Sep 2016 07:19:23 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1609150718460.6078@hadrien> (raw)
In-Reply-To: <CAFrQyDHhpXVeYyQGb=kwRp=4ToJw-9i6Y2KiwxVTb=21Wtxb9Q@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2442 bytes --]



On Thu, 15 Sep 2016, Namrata A Shettar wrote:

> This patch fixes checkpatch issue:
> -Replacing sizeof(struct vnt_usb_send_context) with sizeof(*tx_context)
> -Replacing sizeof(struct vnt_rcb) with sizeof(*priv->rcb[ii])
> The replacements are of the type they are replaced with hence size
> remains same.
>
> Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
> ---
>  drivers/staging/vt6656/main_usb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vt6656/main_usb.c
> b/drivers/staging/vt6656/main_usb.c
> index d79f07f..c03f023 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -429,7 +429,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
>         int ii;
>
>         for (ii = 0; ii < priv->num_tx_context; ii++) {
> -               tx_context = kmalloc(sizeof(struct vnt_usb_send_context),
> +               tx_context = kmalloc(sizeof(*tx_context),
>                                                                 GFP_KERNEL);

The GFP_KERNEL argument should not be left way out on the right like that.
Now it could be on the sam line as the kmalloc.

julia

>                 if (!tx_context)
>                         goto free_tx;
> @@ -447,7 +447,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
>         }
>
>         for (ii = 0; ii < priv->num_rcb; ii++) {
> -               priv->rcb[ii] = kzalloc(sizeof(struct vnt_rcb), GFP_KERNEL);
> +               priv->rcb[ii] = kzalloc(sizeof(*priv->rcb[ii]), GFP_KERNEL);
>                 if (!priv->rcb[ii]) {
>                         dev_err(&priv->usb->dev,
>                                         "failed to allocate rcb no %d\n",
> ii);
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/CAFrQyDHhpXVeYyQGb%3DkwR
> p%3D4ToJw-9i6Y2KiwxVTb%3D21Wtxb9Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

  reply	other threads:[~2016-09-15  5:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 22:16 [PATCH 3/6] staging: vt6656: main_usb: Replace data type declaration with variable of same type Namrata A Shettar
2016-09-15  5:19 ` Julia Lawall [this message]
     [not found]   ` <20160915180849.GA6416@namrata-HP-Pavilion-g6-Notebook-PC>
2016-09-15 18:10     ` [Outreachy kernel] " Namrata A Shettar
2016-09-15 19:24       ` Julia Lawall

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.1609150718460.6078@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=albert008.xu@gmail.com \
    --cc=amsfield22@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=laerdevstudios@gmail.com \
    --cc=namrataashettar@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=pasteka@kabsi.at \
    --cc=tvboxspy@gmail.com \
    --cc=wsa-dev@sang-engineering.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.