From patchwork Wed Sep 6 10:24:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9940277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55DE86035F for ; Wed, 6 Sep 2017 10:25:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 403E128B6D for ; Wed, 6 Sep 2017 10:25:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3307828B7D; Wed, 6 Sep 2017 10:25:01 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83C0728B6D for ; Wed, 6 Sep 2017 10:25:00 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5EAEF2673D4; Wed, 6 Sep 2017 12:24:59 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B5DED2673D6; Wed, 6 Sep 2017 12:24:58 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.15.4]) by alsa0.perex.cz (Postfix) with ESMTP id 32763266E02 for ; Wed, 6 Sep 2017 12:24:57 +0200 (CEST) Received: from [192.168.1.2] ([77.182.162.119]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MCZP8-1dgE7B0ilG-009RPW; Wed, 06 Sep 2017 12:24:23 +0200 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Clemens Ladisch , Jaroslav Kysela , Takashi Iwai References: <85f95150-9cec-7a53-7692-837ba543e1ec@users.sourceforge.net> Message-ID: <3092a93b-9991-eca8-bc77-5c973355477e@users.sourceforge.net> Date: Wed, 6 Sep 2017 12:24:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <85f95150-9cec-7a53-7692-837ba543e1ec@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:x7/x/O7Og2RnK2oM7oJsPI+oS9tbkl/LqAXYgtj10zSkgdlA8PC z1g//J78/lgbWbmREGH1RC5uDLzvUucR2Bubtr+my1p26sVdnqD3hRJk9jRPtYcWQ8+bq4b o5Kl/kl27aRBL1D0RiFeH6E6zsjm5K0iI3ASLZL2E5HBBjNkxMsPvfkrSexSzAxmQot7LSZ bSTUbKMN4nqcWja0Pjn5A== X-UI-Out-Filterresults: notjunk:1; V01:K0:FMF6lQJnpC8=:bEUuXanAvU3mHS9LKj+mPu qB7wx5tYlME8fOIMs386OnGdpXMkUrVHK97vss0ikBg2pyzZrjjEhjxKeuMR7/A5kUeDvhy8B FhYhaFizvPXpSEUXvvYTml4mWodhG407cp4GjevP4pTyrkFuHrOt1vcvtXRjpFA3dIUpSWRJ5 85JsntoNNEiTb3sXruiN6GulyXRt19k6pX0974f/eWETzZ6cNgMfWZzEHe5yxGqYm4iKBSsK+ BkjGvZookzlQLjTqU46A9xgQV+Y9dRN0N8LXwA9qXRnxqmAnaU4lydkok0DkZwFpts0V6rvk3 QWoLofA0WEe2VOvs2vasyb1r1umFFDB5jxqLHaIpEktvbTUil1bi9CGdZy19ltr7T9MuUEGyA DTNkkeR/GDPipBnZZGdyFgsBsspV7t4L6VqhIX2mB1UtOg5yEKNZNkr2d+6yvEe8/k2VBPa0M VHBBqVA7ptZVbbWOV9zijF80TOM/1SnSk3fjRharaAvtmhC15V+E44n//NDslXX5hOw9VrfBp TG/BN7sdjHeD19jiv3/DBwS5qr3hIwh9pH65umH8VFtoG/rlcMWrrNnaI6jTyIEDnzQ1AhsS6 QFoxiufTayq21nFgaRE7q76pjCuzJkZPoeWuDDedid4dV6lkGQb1NCjBf92bpwl4y6ceKg2Dm wIfKDs896zambRuQjJs8q+BGdyhTHIrQ7GC8xgR3Qd2o3MgZkKmU9f95y9D9eNb/HQjUJ8s6H 7JfEUnT4UOD/yaoKe7JcTlimG8L3D+hgXZceiwSl1N+jiswe7S8w2iXXhTahoESfzsVne31mN 1T/Dm5pXM3i6fssMiV7R2eC0SyQmiSK6+iczHGLJwyfoxwlV9U= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 3/3] ALSA: bebob: Improve a size determination in parse_stream_formation() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 6 Sep 2017 11:55:45 +0200 Replace the specification of a data structure by a pointer dereference 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 --- sound/firewire/bebob/bebob_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 211ff43207d6..a26863b82330 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -736,7 +736,7 @@ parse_stream_formation(u8 *buf, unsigned int len, return -ENOSYS; /* Avoid double count by different entries for the same rate. */ - memset(&formation[i], 0, sizeof(struct snd_bebob_stream_formation)); + memset(&formation[i], 0, sizeof(*formation)); for (e = 0; e < buf[4]; e++) { channels = buf[5 + e * 2];