From patchwork Wed Jul 24 09:52:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 11056819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 40211138D for ; Wed, 24 Jul 2019 13:32:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E1AA28699 for ; Wed, 24 Jul 2019 13:32:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22A732871E; Wed, 24 Jul 2019 13:32:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A6E6228699 for ; Wed, 24 Jul 2019 13:32:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BB88C1A94; Wed, 24 Jul 2019 15:06:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BB88C1A94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563973642; bh=3pubYyT8cTcnK4Y5msSBi4K0l/s2mpTy7QqHXu3381o=; h=Date:From:To:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=lphq+YmVn5iAuL24WDe51FKQ8epF6/GPFr33Y6SOqZHMvO2daHvjb9Lq2MsEboAPJ 1248EAwOgdJsLGK1zAAkixx2mJbphzY+3qvZ69yf//6eW1EayVwLrv9B4hiCpwjkxy VxGaR6N57i/mD+9kTiGs5kJMzQ60A5o28LOCPDY8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7B441F80483; Wed, 24 Jul 2019 15:05:56 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9F0C8F803D1; Wed, 24 Jul 2019 11:52:59 +0200 (CEST) Received: from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz [195.113.26.193]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0B01EF800E8 for ; Wed, 24 Jul 2019 11:52:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0B01EF800E8 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id AADEF802C3; Wed, 24 Jul 2019 11:52:43 +0200 (CEST) Date: Wed, 24 Jul 2019 11:52:54 +0200 From: Pavel Machek To: perex@perex.cz, tiwai@suse.com, gregkh@linuxfoundation.org, allison@lohutok.net, tglx@linutronix.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Message-ID: <20190724095254.GA6727@amd> MIME-Version: 1.0 User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Wed, 24 Jul 2019 15:05:55 +0200 Subject: [alsa-devel] [PATCH] sound: line6: sizeof (byte) is always 1, use that fact. X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP sizeof (byte) is always 1, use that fact and make interesting code explicit. Signed-off-by: Pavel Machek 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;