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=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 B95B7C3A5A2 for ; Tue, 10 Sep 2019 12:08:20 +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 B311C208E4 for ; Tue, 10 Sep 2019 12:08:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="NgWVBrXg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B311C208E4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 6394F165E; Tue, 10 Sep 2019 14:07:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6394F165E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1568117297; bh=+WflU0AEyeVwJRyP1WI1C+rOO7ZlDs2vbOQ8yCo0u+s=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NgWVBrXg1/7pWkZ5bULJvAvHr5DpJ52zfzW6gfE93HDCimtDzHsFZSXDRtly2N6fa FmcCwRAk37exAKG1wBoj16KQETaLNFC/2ddXzc4FbuHOI27SP1kWApp7n1pYy2aoPs 0AtVhXB0EzUpahqc9uKopCUlAfm4mxJsTagWTpx0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EAB28F80321; Tue, 10 Sep 2019 14:07:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C5F2EF80368; Tue, 10 Sep 2019 14:07:25 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 66EEDF800E9 for ; Tue, 10 Sep 2019 14:07:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 66EEDF800E9 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 02110AC2E; Tue, 10 Sep 2019 12:07:21 +0000 (UTC) Date: Tue, 10 Sep 2019 14:07:21 +0200 Message-ID: From: Takashi Iwai To: Peter Ujfalusi In-Reply-To: <20190906055524.7393-1-peter.ujfalusi@ti.com> References: <20190906055524.7393-1-peter.ujfalusi@ti.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com, arthur.she@linaro.org Subject: Re: [alsa-devel] [PATCH] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, 06 Sep 2019 07:55:24 +0200, Peter Ujfalusi wrote: > > Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for > other purposes. > > Currently it is left empty with the dmaengine-pcm, in this case copy the > pcm->id string as pcm->name. > > For example IGT is using this to find the HDMI PCM for testing audio on it. > > Signed-off-by: Peter Ujfalusi > Reported-by: Arthur She > --- > Hi, > > this was actually reported for 4.14 kernel with omap-pcm (replaced by sdma-pcm > in v4.18), since then we only use the generic dmaengine PCM but the same issue > applies today. > > Regards, > Peter > > sound/soc/soc-generic-dmaengine-pcm.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c > index 748f5f641002..d93db2c2b527 100644 > --- a/sound/soc/soc-generic-dmaengine-pcm.c > +++ b/sound/soc/soc-generic-dmaengine-pcm.c > @@ -306,6 +306,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) > > if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) > pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; > + > + if (rtd->pcm->streams[i].pcm->name[0] == '\0') { > + strncpy(rtd->pcm->streams[i].pcm->name, > + rtd->pcm->streams[i].pcm->id, > + sizeof(rtd->pcm->streams[i].pcm->name)); > + } Any reason to use strncpy() instead of strscpy()? After merging Mark's branch, I got a compile warning like: sound/soc/soc-generic-dmaengine-pcm.c:311:4: warning: 'strncpy' accessing 80 bytes at offsets 88 and 24 may overlap up to 0 bytes at offset [9223372036854775807, -9223372036854775808] [-Wrestrict] Takashi > > return 0; > -- > Peter > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel > _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel