From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: sre@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH 3/3] power: supply: charger-manager: Slighly simplify code
Date: Mon, 7 Aug 2017 00:37:57 +0200 [thread overview]
Message-ID: <4cf75823640aa667fc050e75b7a86a62aa2bdaa6.1502058761.git.christophe.jaillet@wanadoo.fr> (raw)
In-Reply-To: <cover.1502058761.git.christophe.jaillet@wanadoo.fr>
In-Reply-To: <cover.1502058761.git.christophe.jaillet@wanadoo.fr>
Use 'sizeof(*var)' instead of the equivalent 'sizeof(data structure type)'
because it is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/power/supply/charger-manager.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 83c08c8e2c32..6502fa7c2106 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1632,8 +1632,7 @@ static int charger_manager_probe(struct platform_device *pdev)
return -ENODEV;
}
- cm = devm_kzalloc(&pdev->dev,
- sizeof(struct charger_manager), GFP_KERNEL);
+ cm = devm_kzalloc(&pdev->dev, sizeof(*cm), GFP_KERNEL);
if (!cm)
return -ENOMEM;
--
2.11.0
next prev parent reply other threads:[~2017-08-06 22:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-06 22:37 [PATCH 0/3] power: supply: charger-manager: 1 fix and 2 minor clean-ups Christophe JAILLET
2017-08-06 22:37 ` [PATCH 1/3] power: supply: charger-manager: Fix a NULL pointer dereference in 'charger_manager_probe()' Christophe JAILLET
2017-08-06 22:37 ` [PATCH 2/3] power: supply: charger-manager: Fix a comment Christophe JAILLET
2017-08-06 22:37 ` Christophe JAILLET [this message]
2017-08-06 22:51 ` [PATCH] scsi: mpt3sas: Fix memory allocation failure test in 'mpt3sas_base_attach()' Christophe JAILLET
2017-08-07 8:25 ` walter harms
2017-08-07 8:45 ` Christophe JAILLET
2017-08-12 18:03 ` [PATCH 0/3] power: supply: charger-manager: 1 fix and 2 minor clean-ups Sebastian Reichel
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=4cf75823640aa667fc050e75b7a86a62aa2bdaa6.1502058761.git.christophe.jaillet@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
/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).