From patchwork Wed Jan 8 03:05:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13930086 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010015.outbound.protection.outlook.com [52.101.229.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AA80259490 for ; Wed, 8 Jan 2025 03:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736305558; cv=fail; b=JZbvsWdi4AcHzzVsmm4yTIbESYW7vltMJfnP2iiRBS/rRE58CJKzWCW0x6qAI6wG1D3ZSPyBeuCeCBDTSJ1vvS6i+iqAvHO0vR8eNnAIjVVROhe4xsMvI4xVDtiTbIVw9Wf2UVN1M4/OXUX5aK1/ArOk14Kpq18fuK+I5wBiChc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736305558; c=relaxed/simple; bh=Xlx8gJSh9jeikJbGPC4OVgPn04x/GbDgkhvDLgX1BNw=; h=Message-ID:From:Subject:To:Cc:Content-Type:Date:MIME-Version; b=F03k6fwXxzdLbQC1bRsDV4IJDzmnF98cMSuHsG8dIVX9nUYbJU55blHfxL5V0CNRj7QlyDDbRth0B0RGswj+DEMxYFblDVlfO0RMwXBoi5z+ChTFIcDBatHeX6ipScGOxNlA2so1PU9VRwi0CeUZEFLly59uCeLt+fBOYMFypj0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=I2mEbLXl; arc=fail smtp.client-ip=52.101.229.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="I2mEbLXl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gPC/RLlIa5uOkguIM5VnTpgJK8wIA0T8Lw5CdAkTmBTrBV6sdKK6nTjBkTAVq/p9nXjfql3O+r4H0AgVDoaGI+ScDrawBzmXbu3HwkIL0Sn/uPIrlcVIdckF7WedXt3g/MNx+fwXUld8+GJHlUxZyXOuYTmy5jubvDaXurKWYJdacW9uEIt0Rgo7UHT3eJv0TepGvNuPXkHvH9EpbBmGgCf7DPAAe9qHaAlEPsgMagDUN9Q9fOmCRSUcwkGZ4Om++JRByK/k+JkaFyHFFIxMdscl1OHo6VAZwKH2trpqC2TR2O3KHfXuU97KVeKVRz6MkBn2E2KFKutc8iXiMwZ1HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bS+3cLwRzcNYLf6cNgw7/UT0VFxvQB1VPSO39j7tibg=; b=bX5uG6JCpFqlEqFq9IRKBS322msuzLuhZ+u9HYL+VcK9DOxoTuQAJwk928SjWHnzNMxWx/RP/Y49pi+3qOWomr4RqkAf+2NxVOtIBlQvwy3o7NyGSjb4yK72R2fuYhUm5U8iLPjfMQuLzmjPfi4rVR9RqI1peF6VsX2i1yiShd45D+pd4nDPUdAi37Xu78RLYcGI9l6CnuhUnFPUv91VKiIRqary3QcfHs8bXwY9aHjQh76T1l/j3ujHGtT39vqWKEQfzabPiR4wXg5/Q4mOzDCRRL3OtOXc5W1SYoqA31kLDd1kUX7rvkwOlanrELyPtB2DyWSPQeXTT6PKRa+4Kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bS+3cLwRzcNYLf6cNgw7/UT0VFxvQB1VPSO39j7tibg=; b=I2mEbLXlgMluSOaQqSxbK+pNHBCVOQ4dsP9gdhyjGZLp/0bzEhdQQ78v9tLP3nKcrLslg1D4alJZj84LG+QAA5xKwjGr9hiQZM62wLqqWc1d7/Q6eboPRjZLBWNjHEIRRO6ht29a0dYGSU49/R1U9QBghTLk7OEZs4DKHJDH+sQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TY3PR01MB10906.jpnprd01.prod.outlook.com (2603:1096:400:3af::14) by OS7PR01MB11882.jpnprd01.prod.outlook.com (2603:1096:604:23a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Wed, 8 Jan 2025 03:05:52 +0000 Received: from TY3PR01MB10906.jpnprd01.prod.outlook.com ([fe80::592:9b7b:ef57:2dd8]) by TY3PR01MB10906.jpnprd01.prod.outlook.com ([fe80::592:9b7b:ef57:2dd8%5]) with mapi id 15.20.8314.018; Wed, 8 Jan 2025 03:05:52 +0000 Message-ID: <87msg2knsg.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2] ASoC: soc-card: remove card check User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: linux-sound@vger.kernel.org Date: Wed, 8 Jan 2025 03:05:52 +0000 X-ClientProxiedBy: TYAPR04CA0023.apcprd04.prod.outlook.com (2603:1096:404:15::35) To TY3PR01MB10906.jpnprd01.prod.outlook.com (2603:1096:400:3af::14) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3PR01MB10906:EE_|OS7PR01MB11882:EE_ X-MS-Office365-Filtering-Correlation-Id: b0e7dbe7-af51-451d-c637-08dd2f915c40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: eTutSgoIvWewJwlIccg8Pg1dDJE+6xeXBX8Juv+BPFjdKdQJ0N9sTS3/nU1XllrJZ7YVvf5Z11kb0YAd05Y+PbRU6ug7xzqhyTMG3dKm1tkbhNRBrKsTccusD+XwW7h4a1HwZKiGEf88WktcrBN+Z1bi8oyIMzaF5oBAA6NHN9oOvz1juLG5yseuO2+HneWbIYPwbe/KwgIlmb7Qufr6po+d61zCOpoYPLhE2r5JFwpBYdBLeMPYrzCSdVUGw/km/DAAE08PPoUyqXmc+fgSBEXBHSI/SEaA1exj3OAMQ+SiOABcPLAzbyH9pdJKowV3WKyEB0ha1exvshvWXA2QxC48aiYdg5zpPj34Cfd3ufYG8L9nXiFEmCA+wtICtcCxM9EJA1CHOh4HIzsTypPNieFWrXQQHXOXeDVXXeetXIRT54y7sxdRd0qLThjc8LdMUdrrPQStgHHE+TZA4TDdyIGSXXOh9MRto7LFgtXbRLXSPTslV9wokIzBUJ98AyI36JREOu6uNk9QJROCeda2HPBRYRhykO/zZaTr/SFMh3wyIZUAv/a+gQTvyZcuQ0P3Kccq+/X+cl1Q/Hzth4KRwAxjc54mZMp//TZ82MSi+LP/HdkUcAQ0tsfQKGuau/sxrUI1VMwTX+OlDV3c6ovEQzGEpfpTQd+mIdzI8katr6rtvMab0+Qn15kefdYl1AIoJKqdzX9VM34JEcWawO4ItDnK4+pP3LYrTsVXiFHfLvCgIgsQQOZwU4lqrfrlNjcw22l+DtzM8ICOqUE3kpMjqaugcMcjf5hspk2sAha9SH6Smns7/bgimGHPY9Ql+B7DEdfK4yN5aXVPvy39Y+8Ts+rVJD3A9onB2KdFb5lhK8Ic6pJ97zgc27+6qYgagXjvHGNIzYrBt7emEXaGswPNEr+XSbnm36dw/s3BHf12BCPolE2tuPW/vNxBx0TR5MFxaHdiIpkqjogVQox/xbG611weVTr0wXg69SMG6zEHnk1j4XHfW03otCJhr1zPRBr9uG2ukYliswq2f7eD7UYO9iO7aanpMuKuo5eFHKmOaawLIDpWpWBL8i/IIx6AgXREiYDwf6xaVJfXGRIYs8qHxuCI+ku5BOW8aGxoSFOG8Egbldk0UUJUSgZfrFSVbjHzc9wXRxYO+QvhXcv8NWwnurRgCYo93CMjeR24mtZ1AaJ8E6lENbuJ/eGbuZstM/3GLjhXeROeFZtj/Uw00DXV42L3is3jnwS+EfGe1tQMrtjTNcHGYR7k+gKxd6U18v3P//SMFrl9140nbuHvWIP1Nzl3YJV0mPqwQrWS4YjXAXFZL9O0XJKnTH4OagPMwvK1DGr/0wysG524Fznl1YnpzgDuTXGG/npaEiIkODZBAdQJih01KqY/ATRIMGPDZb9cCIfL+d31x+9n+3TO22wTTNAMERtdejkDZu3k6BVLEBbtMGtVCr8Kgk5ET5PkrtUN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY3PR01MB10906.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: X12edGLe+QhL6PxWyEKCi1G7UxNNGTo91r/GYeOYu5yvLXX15qV+ikvOp+bHvHslTpW78MF7yEKRBtR/+ne6HoFeeHXmWB9pDqANzt9ftZikgaTQjqHlKdsssB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+nhsfvAIsR2g5T7+OopGCs5LFXz9XVlpQi+xDmYYzh0hRwmDD8Ygu33ttWGF7vLV6TKpM6niGUI3Fz3HwmE5IednsUWuhJfmD9x0smvodIrDvWeFWeYOTgMZFiu6W66H2BpA6hSi29IMfpxD59lxHZ6RmPtXaTl0f5BDFlaHcW4qcABRBmBC2rk9gw1214qyi2JYzKdetBT1h5uYGXcjrfqdueaLWCOaSt6aAtYtBQ6WrByrdhypbc1pV0kXw/edtMQqzyEFriwpgFWeitHodFQnkrrKaFPQmNeGAHuWvvak0S7Ypka4yobbbLzlkafg296APVDvNTICWOREWIw1oZy2hoYmkuWV3dhvDdwSyj8Q0KM2M+cM/yISxXnLQy+kNXyYVJUwY+RHM6Vqp8TwNYu7/lbfc/LeA5YGr8BiGFERHY54/M3/z+3eWE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0e7dbe7-af51-451d-c637-08dd2f915c40 X-MS-Exchange-CrossTenant-AuthSource: TY3PR01MB10906.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2025 03:05:52.1969 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VzXugMO2OeBNzBCq2iIZlPQ4i0QT7cWEBniiMIxtmpKvmYfInNWKzNXGn5aYnUkajbVLqIezszZiR6fJ97/ojiV8O3Hkr+086J0fSMiAcIhpERGhNcIXLlW47BgJzJ20 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB11882 only snd_soc_card_set_bias_level() and snd_soc_card_set_bias_level_post() are checking "card" in the function, like below int snd_soc_card_set_bias_level(...) { ... => if (card && card->xxx) ret = card->xxxx(...); ... } But it should already have been an error if "card" was NULL. remove "card" NULL check here. Otherwise it will get waring on smatch without this patch. This is prepare for error check cleanup. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - rebase to latest asoc/for-6.14 sound/soc/soc-card.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c index 8e9546fe74281..e6eb71b3010a8 100644 --- a/sound/soc/soc-card.c +++ b/sound/soc/soc-card.c @@ -219,7 +219,7 @@ int snd_soc_card_set_bias_level(struct snd_soc_card *card, { int ret = 0; - if (card && card->set_bias_level) + if (card->set_bias_level) ret = card->set_bias_level(card, dapm, level); return soc_card_ret(card, ret); @@ -231,7 +231,7 @@ int snd_soc_card_set_bias_level_post(struct snd_soc_card *card, { int ret = 0; - if (card && card->set_bias_level_post) + if (card->set_bias_level_post) ret = card->set_bias_level_post(card, dapm, level); return soc_card_ret(card, ret);