linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-omap@vger.kernel.org, Lee Jones <lee.jones@linaro.org>,
	Tony Lindgren <tony@atomide.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/3] mfd/omap-usb-tll: Improve a size determination in usbtll_omap_probe()
Date: Mon, 15 Jan 2018 14:16:17 +0100	[thread overview]
Message-ID: <49a9d036-ab90-4342-90a8-db63e027017e@users.sourceforge.net> (raw)
In-Reply-To: <c048a681-70e4-ecdd-e0f8-48c8f1bb0ac4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 15 Jan 2018 13:43:53 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/mfd/omap-usb-tll.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index 7945efa0152e..c8b4ad40910a 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -220,8 +220,7 @@ static int usbtll_omap_probe(struct platform_device *pdev)
 	int					i, ver;
 
 	dev_dbg(dev, "starting TI HSUSB TLL Controller\n");
-
-	tll = devm_kzalloc(dev, sizeof(struct usbtll_omap), GFP_KERNEL);
+	tll = devm_kzalloc(dev, sizeof(*tll), GFP_KERNEL);
 	if (!tll)
 		return -ENOMEM;
 
-- 
2.15.1

  parent reply	other threads:[~2018-01-15 13:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 13:14 [PATCH 0/3] mfd/omap-usb-tll: Adjustments for usbtll_omap_probe() SF Markus Elfring
2018-01-15 13:15 ` [PATCH 1/3] mfd/omap-usb-tll: Delete two error messages for a failed memory allocation in usbtll_omap_probe() SF Markus Elfring
2018-01-15 13:41   ` Ladislav Michl
2018-01-15 15:34     ` Roger Quadros
2018-01-15 15:38     ` SF Markus Elfring
2018-01-15 16:05       ` Ladislav Michl
2018-01-15 16:21         ` [1/3] " SF Markus Elfring
2018-01-15 16:35           ` Ladislav Michl
2018-01-15 17:06             ` SF Markus Elfring
2018-01-15 17:41               ` Ladislav Michl
2018-01-15 18:12                 ` SF Markus Elfring
2018-01-15 18:30                   ` Ladislav Michl
2018-01-15 19:04                     ` mfd/omap-usb-tll: Allocate driver data at once " SF Markus Elfring
2018-01-15 19:23                       ` Ladislav Michl
2018-01-15 19:40                         ` SF Markus Elfring
2018-01-15 19:26                     ` SF Markus Elfring
2018-01-15 19:33                       ` Ladislav Michl
2018-01-15 13:16 ` SF Markus Elfring [this message]
2018-01-22 15:50   ` [PATCH 2/3] mfd/omap-usb-tll: Improve a size determination " Lee Jones
2018-01-15 13:17 ` [PATCH 3/3] mfd/omap-usb-tll: Return an error code only as a constant " SF Markus Elfring
2018-01-22 15:50   ` Lee Jones
2018-01-23 13:04     ` Lee Jones
2018-01-23 14:43       ` [3/3] " SF Markus Elfring
2018-01-23 15:04         ` Lee Jones
2018-01-23 17:13           ` Ladislav Michl
2018-01-24 15:16             ` Lee Jones

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=49a9d036-ab90-4342-90a8-db63e027017e@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).