diff mbox series

sound: line6: sizeof (byte) is always 1, use that fact.

Message ID 20190724095254.GA6727@amd (mailing list archive)
State New, archived
Headers show
Series sound: line6: sizeof (byte) is always 1, use that fact. | expand

Commit Message

Pavel Machek July 24, 2019, 9:52 a.m. UTC
sizeof (byte) is always 1, use that fact and make interesting code explicit.

Signed-off-by: Pavel Machek <pavel@denx.de>

Comments

Takashi Iwai July 24, 2019, 1:05 p.m. UTC | #1
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
diff mbox series

Patch

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;