* [PATCH] sound: line6: sizeof (byte) is always 1, use that fact.
@ 2019-07-24 9:52 Pavel Machek
2019-07-24 13:05 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2019-07-24 9:52 UTC (permalink / raw)
To: perex, tiwai, gregkh, allison, tglx, alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]
sizeof (byte) is always 1, use that fact and make interesting code explicit.
Signed-off-by: Pavel Machek <pavel@denx.de>
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index ab2ec89..387c5c2 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -342,7 +342,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
if (address > 0xffff || datalen > 0xff)
return -EINVAL;
- len = kmalloc(sizeof(*len), GFP_KERNEL);
+ len = kmalloc(1, GFP_KERNEL);
if (!len)
return -ENOMEM;
@@ -418,7 +421,7 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
if (address > 0xffff || datalen > 0xffff)
return -EINVAL;
- status = kmalloc(sizeof(*status), GFP_KERNEL);
+ status = kmalloc(1, GFP_KERNEL);
if (!status)
return -ENOMEM;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sound: line6: sizeof (byte) is always 1, use that fact.
2019-07-24 9:52 [PATCH] sound: line6: sizeof (byte) is always 1, use that fact Pavel Machek
@ 2019-07-24 13:05 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2019-07-24 13:05 UTC (permalink / raw)
To: Pavel Machek; +Cc: alsa-devel, tglx, gregkh, allison, perex, linux-kernel
On Wed, 24 Jul 2019 11:52:54 +0200,
Pavel Machek wrote:
>
>
> sizeof (byte) is always 1, use that fact and make interesting code explicit.
>
> Signed-off-by: Pavel Machek <pavel@denx.de>
Applied, thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-24 13:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 9:52 [PATCH] sound: line6: sizeof (byte) is always 1, use that fact Pavel Machek
2019-07-24 13:05 ` Takashi Iwai
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).