Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1726252
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 5/6] [media] atmel-isi: Improve three size determinations |
| Date | 2017-09-04 22:20 +0200 |
| Message-ID | <um60F-1AM-7@gated-at.bofh.it> (permalink) |
| References | <um5R0-1xP-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 4 Sep 2017 21:27:45 +0200 Replace the specification of data types by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/media/platform/atmel/atmel-isi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index 154e9c39b64f..ac40defce1e7 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -1036,13 +1036,13 @@ static int isi_formats_init(struct atmel_isi *isi) isi->num_user_formats = num_fmts; isi->user_formats = devm_kcalloc(isi->dev, - num_fmts, sizeof(struct isi_format *), + num_fmts, sizeof(*isi->user_formats), GFP_KERNEL); if (!isi->user_formats) return -ENOMEM; memcpy(isi->user_formats, isi_fmts, - num_fmts * sizeof(struct isi_format *)); + num_fmts * sizeof(*isi->user_formats)); isi->current_fmt = isi->user_formats[0]; return 0; @@ -1173,5 +1173,5 @@ static int atmel_isi_probe(struct platform_device *pdev) struct resource *regs; int ret, i; - isi = devm_kzalloc(&pdev->dev, sizeof(struct atmel_isi), GFP_KERNEL); + isi = devm_kzalloc(&pdev->dev, sizeof(*isi), GFP_KERNEL); if (!isi) -- 2.14.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] [media] Atmel: Adjustments for seven function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-04 22:10 +0200
[PATCH 1/6] [media] atmel-isc: Delete an error message for a failed memory allocation in isc_formats_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-04 22:10 +0200
[PATCH 3/6] [media] atmel-isc: Adjust three checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-04 22:10 +0200
[PATCH 4/6] [media] atmel-isi: Delete an error message for a failed memory allocation in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-04 22:20 +0200
[PATCH 5/6] [media] atmel-isi: Improve three size determinations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-04 22:20 +0200
[PATCH 6/6] [media] atmel-isi: Adjust a null pointer check in three functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-04 22:20 +0200
Re: [PATCH 0/6] [media] Atmel: Adjustments for seven function implementations "Yang, Wenyou" <Wenyou.Yang@Microchip.com> - 2017-09-06 03:00 +0200
Re: [PATCH 0/6] [media] Atmel: Adjustments for seven function implementations Ludovic Desroches <ludovic.desroches@microchip.com> - 2017-09-06 08:10 +0200
csiph-web