All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 3/6] staging: vt6656: main_usb: Replace type declaration with *pointer of same type
@ 2016-09-15 20:27 Namrata A Shettar
  0 siblings, 0 replies; only message in thread
From: Namrata A Shettar @ 2016-09-15 20:27 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: 1501 bytes --]

Fix checkpatch issue:
-Replace data type declaration with same type pointer inside sizeof() as
their size is the same.

Replace type declarations with pointer of same type to resolve
checkpatch issue.Replacement can be done inside sizeof() as they are of
same size.

Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
---
 drivers/staging/vt6656/main_usb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c
b/drivers/staging/vt6656/main_usb.c
index 37f9da0..5f220ee 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -429,8 +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),
-                                          GFP_KERNEL);
+               tx_context = kmalloc(sizeof(*tx_context),GFP_KERNEL);
                if (!tx_context)
                        goto free_tx;

@@ -447,7 +446,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: 2277 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-15 20:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 20:27 [PATCH v2 3/6] staging: vt6656: main_usb: Replace type declaration with *pointer of same type Namrata A Shettar

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.