From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relmlor1.renesas.com ([210.160.252.171]:64019 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932322AbcGDJAD (ORCPT ); Mon, 4 Jul 2016 05:00:03 -0400 Message-ID: <87lh1hzsww.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , Subject: Re: [PATCH 07/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() In-Reply-To: <20160704085003.GS6247@sirena.org.uk> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> <8760tusj2q.wl%kuninori.morimoto.gx@renesas.com> <20160629181555.GJ6247@sirena.org.uk> <874m8bbdei.wl%kuninori.morimoto.gx@renesas.com> <20160701095249.GJ6247@sirena.org.uk> <874m861dzi.wl%kuninori.morimoto.gx@renesas.com> <871t3a1crg.wl%kuninori.morimoto.gx@renesas.com> <20160704085003.GS6247@sirena.org.uk> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Date: Mon, 4 Jul 2016 08:59:53 +0000 Sender: linux-renesas-soc-owner@vger.kernel.org List-ID: Hi Mark Thank you for your feedback > > This function tries to get card name from snd_soc_of_parse_card_name(). > > and it tries to set card->name from dai_link if card still doesn't have name. > > So, above is optional 2nd try. > > Or, do you mean this if (!card->name) can goes to simple-card, instead of utils ? > > I have no objection about it , but it can be double handling ? > > Because other simple family have same situation. > > If we try to dereference card->dai_link without checking to see if it's > set then we'll crash. Ahh, do you mean we need like this ? if (!card->name && card->dai_link) card->name = card->dai_link->name; From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: Re: [PATCH 07/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() Date: Mon, 4 Jul 2016 08:59:53 +0000 Message-ID: <87lh1hzsww.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> <8760tusj2q.wl%kuninori.morimoto.gx@renesas.com> <20160629181555.GJ6247@sirena.org.uk> <874m8bbdei.wl%kuninori.morimoto.gx@renesas.com> <20160701095249.GJ6247@sirena.org.uk> <874m861dzi.wl%kuninori.morimoto.gx@renesas.com> <871t3a1crg.wl%kuninori.morimoto.gx@renesas.com> <20160704085003.GS6247@sirena.org.uk> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from relmlie4.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa0.perex.cz (Postfix) with ESMTP id 9FEB1265AD8 for ; Mon, 4 Jul 2016 11:00:01 +0200 (CEST) In-Reply-To: <20160704085003.GS6247@sirena.org.uk> 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 To: Mark Brown Cc: linux-renesas-soc@vger.kernel.org, Linux-ALSA , Simon , Liam Girdwood List-Id: alsa-devel@alsa-project.org Hi Mark Thank you for your feedback > > This function tries to get card name from snd_soc_of_parse_card_name(). > > and it tries to set card->name from dai_link if card still doesn't have name. > > So, above is optional 2nd try. > > Or, do you mean this if (!card->name) can goes to simple-card, instead of utils ? > > I have no objection about it , but it can be double handling ? > > Because other simple family have same situation. > > If we try to dereference card->dai_link without checking to see if it's > set then we'll crash. Ahh, do you mean we need like this ? if (!card->name && card->dai_link) card->name = card->dai_link->name;