From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 835BEC433DF for ; Tue, 25 Aug 2020 10:47:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D544A2068E for ; Tue, 25 Aug 2020 10:47:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hVPcUgNs"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="eghatQWd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D544A2068E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 3F6AC15F9; Tue, 25 Aug 2020 12:46:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3F6AC15F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1598352457; bh=7Vsxr614IS0CsT72F5/B+NG4ZLwqAOPM4Z3BRC9zgpQ=; h=Date:From:To:Subject:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=hVPcUgNsFRnA/2Xa8xREKdsiSKEXsiLSrS7xpnk/stdhQh1/eRVLsGxlr/vzn/SY4 t1fu2XvvDrpXaKg8k7AoZkomAR2yjpNOQ7sou7FKK2Nec2dTZOHRhNC+HoW62sYrh7 ZVydYP20RDEDRJUcZnAfHtD9nKA8qXHcC3Qxp0U4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AEB45F80245; Tue, 25 Aug 2020 12:46:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17DD6F8025A; Tue, 25 Aug 2020 12:46:45 +0200 (CEST) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BD5A3F80143 for ; Tue, 25 Aug 2020 12:46:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BD5A3F80143 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="eghatQWd" Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07PAjD40136601; Tue, 25 Aug 2020 10:46:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=XvFqJGnjaVhEvnjqbb7PvWLcd+LBfxppuO+39ZHs3is=; b=eghatQWdA9Fma9m9I0lZH+GKKCrUiRx0N9wgf9XqE9U7BmXK89LZQCZkkrU44HzrxZRr hbmyEPC8djWzwNrMjvFSFykz08azhcq3pWe/R3EZf+1Gu8YoHdjpPzkTJTI0y/g7HClB T9dHNqMbN/FFseYnkfi0pYo6ND94WKgzXbgfAPAx0Og6Am4eAFcSFpgcsT/SUGxmN1Xt trgX0VOF6mjUapyo0X2y8QCjU0oa2M1idx5OWxN5VxQn4EAHkHO3FauGC2JwCwy5uZiS gYVeq25xAF97jEPUrBZ9aX9TfmG1fG5peJR6Pu08btRziSEwyZWg8YMLR1cBWbmFDrne 9w== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 333w6tr975-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Aug 2020 10:46:38 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07PAilYF036945; Tue, 25 Aug 2020 10:46:37 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 333r9jqurt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Aug 2020 10:46:37 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 07PAkWSj013893; Tue, 25 Aug 2020 10:46:32 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Aug 2020 03:46:31 -0700 Date: Tue, 25 Aug 2020 13:46:23 +0300 From: Dan Carpenter To: Liam Girdwood Subject: [PATCH] ASoC: hdac_hdmi: tidy up a memset() Message-ID: <20200825104623.GA278587@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9723 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008250081 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9723 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 priorityscore=1501 clxscore=1011 mlxscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008250081 Cc: Guennadi Liakhovetski , alsa-devel@alsa-project.org, Kai Vehmanen , kernel-janitors@vger.kernel.org, Pierre-Louis Bossart , Takashi Iwai , Mark Brown , Amadeusz =?utf-8?B?U8WCYXdpxYRza2k=?= , Brent Lu 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" The ARRAY_SIZE() is the number of the elements but we want to use the number of bytes. Fortunately, in this case the value is the same so it doesn't affect runtime. Signed-off-by: Dan Carpenter --- sound/soc/codecs/hdac_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 869d1547ae5d..c61cce53f513 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1474,7 +1474,7 @@ static int hdac_hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol, struct hdac_hdmi_port *port; struct hdac_hdmi_eld *eld; - memset(ucontrol->value.bytes.data, 0, ARRAY_SIZE(ucontrol->value.bytes.data)); + memset(ucontrol->value.bytes.data, 0, sizeof(ucontrol->value.bytes.data)); pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); if (!pcm) { -- 2.28.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Tue, 25 Aug 2020 10:46:23 +0000 Subject: [PATCH] ASoC: hdac_hdmi: tidy up a memset() Message-Id: <20200825104623.GA278587@mwanda> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Liam Girdwood Cc: Guennadi Liakhovetski , alsa-devel@alsa-project.org, Kai Vehmanen , kernel-janitors@vger.kernel.org, Pierre-Louis Bossart , Takashi Iwai , Mark Brown , Amadeusz =?utf-8?B?U8WCYXdpxYRza2k=?= , Brent Lu The ARRAY_SIZE() is the number of the elements but we want to use the number of bytes. Fortunately, in this case the value is the same so it doesn't affect runtime. Signed-off-by: Dan Carpenter --- sound/soc/codecs/hdac_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 869d1547ae5d..c61cce53f513 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1474,7 +1474,7 @@ static int hdac_hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol, struct hdac_hdmi_port *port; struct hdac_hdmi_eld *eld; - memset(ucontrol->value.bytes.data, 0, ARRAY_SIZE(ucontrol->value.bytes.data)); + memset(ucontrol->value.bytes.data, 0, sizeof(ucontrol->value.bytes.data)); pcm = get_hdmi_pcm_from_id(hdmi, kcontrol->id.device); if (!pcm) { -- 2.28.0