Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2398645ybt; Sun, 28 Jun 2020 18:38:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymlU0yk//RLzPPD/DpZ9Ql167AWe6r/L5N4VcZZnuI+ydMcBHNcYs/J+K1XHONAgJiuz4E X-Received: by 2002:a17:906:26c7:: with SMTP id u7mr10102634ejc.13.1593394734192; Sun, 28 Jun 2020 18:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593394734; cv=none; d=google.com; s=arc-20160816; b=NzrpY8FdBpoo3TR/GLZUYUTyetUR4D8+fWTclUWPbvtpmFBAsZfhIfMUYCnVVw0itF 878Fh+ZjfjBcpOwqCNoBYi6gSLnfNoS1PfUkj1ovtORx56X+DMLWa/dnNw9hmZfZ5lxv f1cF3c9URTxMYZ042u4au0vcLkDC7qJVmTslcLP0QQW6OZ7d35KoAzgLcZpU4+808E4/ HPatfFGqiNm+u68JbB5NyFllyN4ldcvMiG7U0Zicl7s7HX+rnHSHt4Hin+6QXFiGvWy0 ZCHHf1OABSvXXcNXXiCA74hw4juZGm1stB3TVdJhPK765MmLOtJtp9QVdPf9kpAe5Uh2 tMBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=I2qjVOwTM8PgIOBWW4mm+gHqZxWHXyycnPTHkb9zwTg=; b=Pe6mnfNnnzSaQRRrj00rRT1nXSqEX43JVLucN1lpJ6DqNmEJBMjJ8A11iIL5zt7uHB 0TwlrfIuyFgr3Re8pNMH54YbhE4GBVrpiLgCyFREYZCGf5oKCv0n6195BJCylJVkAyM+ Y/g9mPLZHreR1JrchHxjDKDROQD2dEOi2QGxh5t4YPHWTIosrKBLpak4o9LrnL6rD3fm 6B1eyNqQsVz3nV382WubIWDeE8QsoVg9xvIgV3Fk6BBwR1epy5T+UDwhW+jviQFwCRi5 L6ZI/BjEXMlSPzak+cSiSwSw4hMcbFJp0lH7XEo8Z5bgZkjwoIz12mzvGbDUWrKdUglt UBpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg19si7148298ejb.138.2020.06.28.18.38.30; Sun, 28 Jun 2020 18:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbgF2BiP (ORCPT + 99 others); Sun, 28 Jun 2020 21:38:15 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:62334 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726465AbgF2BiP (ORCPT ); Sun, 28 Jun 2020 21:38:15 -0400 Date: 29 Jun 2020 10:38:13 +0900 X-IronPort-AV: E=Sophos;i="5.75,293,1589209200"; d="scan'208";a="50575129" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 29 Jun 2020 10:38:13 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id C67B64148028; Mon, 29 Jun 2020 10:38:13 +0900 (JST) Message-ID: <87366e1wkb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Sameer Pujar Cc: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v4 15/23] ASoC: soc-core: Identify 'no_pcm' DAI links for DPCM In-Reply-To: <1593233625-14961-16-git-send-email-spujar@nvidia.com> References: <1593233625-14961-1-git-send-email-spujar@nvidia.com> <1593233625-14961-16-git-send-email-spujar@nvidia.com> User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sameer > PCM devices are created for dai links with 'no-pcm' flag as '0'. > Such DAI links have CPU component which implement pcm_construct() > and pcm_destruct() callbacks. Based on this, current patch exposes > a helper function to identify such components and populate 'no_pcm' > flag for DPCM DAI link. (snip) > +bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc) > +{ > + struct snd_soc_component *component; > + struct snd_soc_dai *dai; > + > + for_each_component(component) { > + if (!component->driver) > + continue; > + > + for_each_component_dais(component, dai) { > + if (!dai->name || !dlc->dai_name) > + continue; > + > + if (strcmp(dai->name, dlc->dai_name)) > + continue; We can/should NULL poinster check for "dlc->dai_name" on top of this function instead of inside loop ? And then, we can remove "dai->name" check because next strcmp() automatically fail if dai->name was NULL. Thank you for your help !! Best regards --- Kuninori Morimoto