From patchwork Mon Nov 27 18:53:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 119781 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp2105758edl; Mon, 27 Nov 2017 10:59:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMacSrH3l1/F7AIe9d+W4dad9dvhplJH3kTHPI2A5fsIEovikmjPOGI4Tsum4VE9MWnfQYio X-Received: by 10.28.6.6 with SMTP id 6mr13454031wmg.114.1511809197695; Mon, 27 Nov 2017 10:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511809197; cv=none; d=google.com; s=arc-20160816; b=XEwJUYPcuUTnF1oUWuP0NIIk0/sUOVPaGERunEwx3Gcs9VfJDoQV/Vat1nQs2miy5i QWNGCQvKex5a9yVjGY6WIPts2YzpWyvQb9fipGDJcIo1wqvLjTR0yc3SzX2EhToQpxYt 81w0tGMMj2zb5MFO73iKp+Vs8s8DdfGe5jy9yjxma9PT7fsfJSwKHy0cGhrQwfT494MV rEd+/ZuIG9ajYPoDyfdZersFmjMPKPJ3e8qkqKFX3CwtLxw+sV6tmuTqOv+tYqGU82Vk qVJgbfRJRVgWwun93Re/xwt0YWkpQMahDlrO9hCfQ9jOcgoR+oRFgRVI8KpfPleIKmlV wV2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=DvofAzjpP/RBvmErn4w2ysGcEhJFoyv5YiO+EqB7Kmk=; b=XewXsDP5qo7+qvmcthjhaCfhk0h5OO2aqdY9xYehwIeLxnyt8hXZum5/RSJ8R5G9Nm 4UmDKPF+8C9+ABbHyMBvW0/h/t1W1/LDKzrHehELR7o899qLZejsTP7edNFkhV0SFLTq x69fMrHzDIdfsMgr7zYYY5ZhAFdE/eLf1r2cy2tFK0OYtha66RF4RvAFbwAmVF/QHKDS m5XXavJINUalImgTvlV4bLBbRjWUqHIFkChnuFKpJGMN+Aijcxr3PTK5ds1G2YpOtctC BTjRkCsaUKXFM//JH6GAgBYK/GwnU80KiyWpHPVSJy3btYwP+6iqX0gNXEAEhLwLJ2lP xfYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=f+u0pP3z; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id i78si11602435wmf.178.2017.11.27.10.59.57; Mon, 27 Nov 2017 10:59:57 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=f+u0pP3z; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D3B7E26774C; Mon, 27 Nov 2017 19:55:32 +0100 (CET) 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 6BCCC26774A; Mon, 27 Nov 2017 19:55:31 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id A0BDC26767A for ; Mon, 27 Nov 2017 19:53:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=ZIQX1xFLV7gQNvcSGh+iG62iq7UBVpvrtEG42OhNROw=; b=f+u0pP3zEYRV IS9C4+UpM72vxsAH0P6XrdU6RpxvpGb43KjzkMavL869GrZ/RMJQKfYTUiUOumyPuFoMfC0C4kaBe dYlFPzDZOoJT0ESFNFzATf5JXvu+jjFJF7uz64vqB16rV7Mnevm66Gfqyb5Ckdcs+aDpj4rdrE2or 5slLs=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eJOXG-00074D-Vd; Mon, 27 Nov 2017 18:53:43 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eJOXG-0007NP-J5; Mon, 27 Nov 2017 18:53:42 +0000 From: Mark Brown To: Markus Elfring In-Reply-To: <8c36fc94-1f7d-5d22-7d3a-f2f6117199aa@users.sourceforge.net> Message-Id: Date: Mon, 27 Nov 2017 18:53:42 +0000 Cc: Brian Austin , alsa-devel@alsa-project.org, LKML , Takashi Iwai , kernel-janitors@vger.kernel.org, Liam Girdwood , Paul Handrigan , Mark Brown Subject: [alsa-devel] Applied "ASoC: cs42l56: Improve two size determinations in cs42l56_i2c_probe()" to the asoc tree 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: cs42l56: Improve two size determinations in cs42l56_i2c_probe() has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From e8d8b98c0a6edab5d6cc0292e1ed603d8d4ff5b6 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 23 Nov 2017 09:33:15 +0100 Subject: [PATCH] ASoC: cs42l56: Improve two size determinations in cs42l56_i2c_probe() Replace the specification of two data structures 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. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Mark Brown --- sound/soc/codecs/cs42l56.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.15.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c index 13ee46217d78..fd7b8d32c2b2 100644 --- a/sound/soc/codecs/cs42l56.c +++ b/sound/soc/codecs/cs42l56.c @@ -1190,9 +1190,7 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client, unsigned int alpha_rev, metal_rev; unsigned int reg; - cs42l56 = devm_kzalloc(&i2c_client->dev, - sizeof(struct cs42l56_private), - GFP_KERNEL); + cs42l56 = devm_kzalloc(&i2c_client->dev, sizeof(*cs42l56), GFP_KERNEL); if (cs42l56 == NULL) return -ENOMEM; cs42l56->dev = &i2c_client->dev; @@ -1207,8 +1205,7 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client, if (pdata) { cs42l56->pdata = *pdata; } else { - pdata = devm_kzalloc(&i2c_client->dev, - sizeof(struct cs42l56_platform_data), + pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) return -ENOMEM;