* [PATCH 3/6] staging: vt6656: main_usb: Replace data type declaration with variable of same type @ 2016-09-14 22:16 Namrata A Shettar 2016-09-15 5:19 ` [Outreachy kernel] " Julia Lawall 0 siblings, 1 reply; 4+ messages in thread From: Namrata A Shettar @ 2016-09-14 22:16 UTC (permalink / raw) To: Greg Kroah-Hartman, Malcolm Priestley, Alison Schofield, maomao xu, Othmar Pasteka, Parth Sane, Wolfram Sang, outreachy-kernel [-- Attachment #1: Type: text/plain, Size: 1492 bytes --] 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); 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 [-- Attachment #2: Type: text/html, Size: 2019 bytes --] ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH 3/6] staging: vt6656: main_usb: Replace data type declaration with variable of same type 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 [not found] ` <20160915180849.GA6416@namrata-HP-Pavilion-g6-Notebook-PC> 0 siblings, 1 reply; 4+ messages in thread From: Julia Lawall @ 2016-09-15 5:19 UTC (permalink / raw) To: Namrata A Shettar Cc: Greg Kroah-Hartman, Malcolm Priestley, Alison Schofield, maomao xu, Othmar Pasteka, Parth Sane, Wolfram Sang, outreachy-kernel [-- 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. > > ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20160915180849.GA6416@namrata-HP-Pavilion-g6-Notebook-PC>]
* Re: [Outreachy kernel] [PATCH 3/6] staging: vt6656: main_usb: Replace data type declaration with variable of same type [not found] ` <20160915180849.GA6416@namrata-HP-Pavilion-g6-Notebook-PC> @ 2016-09-15 18:10 ` Namrata A Shettar 2016-09-15 19:24 ` Julia Lawall 0 siblings, 1 reply; 4+ messages in thread From: Namrata A Shettar @ 2016-09-15 18:10 UTC (permalink / raw) To: outreachy-kernel, Julia Lawall [-- Attachment #1: Type: text/plain, Size: 2220 bytes --] On Thu, Sep 15, 2016 at 07:19:23AM +0200, Julia Lawall wrote: > > > 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(-) > > > > 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 > Will that change come in the same patch? or should I create a new patch for the same? Thanks, Namrata On Thu, Sep 15, 2016 at 11:38 PM, Namrata A Shettar < namrataashettar@gmail.com> wrote: > On Thu, Sep 15, 2016 at 07:19:23AM +0200, Julia Lawall wrote: > > > > > > 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(-) > > > > > > 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 > > > > Will that change come in the same patch? or should I create a new patch > for the same? > > Thanks, > Namrata > [-- Attachment #2: Type: text/html, Size: 3575 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH 3/6] staging: vt6656: main_usb: Replace data type declaration with variable of same type 2016-09-15 18:10 ` Namrata A Shettar @ 2016-09-15 19:24 ` Julia Lawall 0 siblings, 0 replies; 4+ messages in thread From: Julia Lawall @ 2016-09-15 19:24 UTC (permalink / raw) To: Namrata A Shettar; +Cc: outreachy-kernel [-- Attachment #1: Type: TEXT/PLAIN, Size: 3494 bytes --] On Thu, 15 Sep 2016, Namrata A Shettar wrote: > On Thu, Sep 15, 2016 at 07:19:23AM +0200, Julia Lawall wrote: > > > > > > 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(-) > > > > > > 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 > > > > Will that change come in the same patch? or should I create a new patch > for the same? I think you could put the whole thing in one patch. The need to move the GFP_KERNEL comes because you changed the sizeof argument. julia > > Thanks, > Namrata > > On Thu, Sep 15, 2016 at 11:38 PM, Namrata A Shettar > <namrataashettar@gmail.com> wrote: > On Thu, Sep 15, 2016 at 07:19:23AM +0200, Julia Lawall wrote: > > > > > > 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(-) > > > > > > 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 > > > > Will that change come in the same patch? or should I create a > new patch > for the same? > > Thanks, > Namrata > > > -- > 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/CAFrQyDFZ92oTmzrW1k62uyj > RowFKbkhmX6jzzcX334kJCzjbuA%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-15 19:24 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 ` [Outreachy kernel] " Julia Lawall [not found] ` <20160915180849.GA6416@namrata-HP-Pavilion-g6-Notebook-PC> 2016-09-15 18:10 ` Namrata A Shettar 2016-09-15 19:24 ` Julia Lawall
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.