From patchwork Wed Dec 18 02:43:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 13912947 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2044.outbound.protection.outlook.com [40.107.20.44]) (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 4A73F13A250; Wed, 18 Dec 2024 02:44:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734489883; cv=fail; b=ZE1XBBJJxBbcEyuGOnz6OvRSxjhkkRc3/415cjeHcuEtIP1rSjsflhbBNx4MnqIdFVZY615N0Sw79qMuBi+dXWBXVC/uwONRc8CZQa8qZa7rvAQPD+ALu8ApTuZVh7K2iFZ/Q5K44CEiKqcT0SfXkGJ6ANc9z0Mbi9ZgfLD5MZE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734489883; c=relaxed/simple; bh=OSfNK8yKFbZ11PYp3HdGr9f/fY/SjoXHGGKQ8jUN5Qg=; h=From:To:Subject:Date:Message-Id:Content-Type:MIME-Version; b=LOFVEpDIykTYQqnp8Bk5StAceGIq+GWJvwBbpbeQdC3GVJ4K50Z8q5eqbiX+yYYjp5dhvqOrcLTimiSVdyIVhGQPbMnuj1SPoJkHugf+ZPVlpqqt7QtYiyPVW+rl5VT9F9ktULnoxZrmYcVcgcRivmEqcsAuMmsRtmgxxs6YqMg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=k9oTKUS5; arc=fail smtp.client-ip=40.107.20.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="k9oTKUS5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XoHPupYJYJTDYckNJbC3eGpxE7TTHx9oep+JjY0rWjiRxqudnEbsLv0CjSuJ0z3KCE+YXcWjtP1zYarIYOcPoWbe/VYHHZbmlffeYxKCn1VGNoOvM9tGBCVAHXFcPugbfMIj83TjUSZVVQkX1ZgWDD1gXsHZQ3cUdpNA9OA+l59m02ExQB98VIMk/aXkapR5DYs5eov0rxmZVkgopYzRmFdamcsHJhrpLipzgOSB4yk+XOVR8fO+9K9jYxTrIMilZuiXvfcul56zRx5Pn6Um3rvGn1b22lhl0Mp2qkeu+l+6srRI0P4rMr3nvfxrjHLKc0mjotuffKIHoILasxXJZQ== 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=kMnpbSEpxeIc3RqtiFCoH/jgBhMeT81Lo9J02gfeaSc=; b=outjqS4EWCpaXmtxQCWIoWeiJ7H8wUbGmo2/C1fIOKKy0al+Z5RWpt+2a7j/XgroQ6tT7BWbEbDEwqYK0tFMfg921IUpaCoJgBqGEjyMHIBjhXj+4uZkubrJdwrQNJgnQs4Awa5GOz+9LZ/EeyqAx+qmGCYO8Lu1IDClh+Q1uRCgGeMH+nM1psuMi/zJ5b9KfA/EqZvLePq6Vw/mL1/LlEKuUC1zk/zLWWE2yPI/Qb1b9n7WZMz7U9zCnF1BFUrQvyCjrXOmdfcIiaVusEyeaMjvb9PE4wxq7MLt4PqIIhmGDDA4cynpmornIlI6cgXkEweWhGtoXYwpgpJqxnLmYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kMnpbSEpxeIc3RqtiFCoH/jgBhMeT81Lo9J02gfeaSc=; b=k9oTKUS583kh7x8yzxpLNcvSX7KWtlAdCFXNSj7Qz5peo3XoCPaO5szogiN24SBwC7zur+tVLLdta7K9cPkp/fKtg25jYS70APpTBZx8AaFPp8MLVU5LVYbrfGdYbX6jLAxOflmROYsRFUM7uVPt+tFDG5rL+DnUVnPXe2vpnYz21rEq823dLrSIX+v958Z6mfu36GOJFM1/JPdaVQJWLk7X37IqE1LAGjlBjc6gVXMSqQMedcJkBOHtsIfif/bR1JcboQ0BGFLkaDrDSsYFRxzgNXkgAorS+aB2OAQ6Ntsr/7uhj3kGJhbbhRJWyajnN/PBpsRMUzhV1tZyFB/VsQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20) by DU2PR04MB9132.eurprd04.prod.outlook.com (2603:10a6:10:2f7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Wed, 18 Dec 2024 02:44:38 +0000 Received: from AM0PR04MB7044.eurprd04.prod.outlook.com ([fe80::7be0:296:768c:e891]) by AM0PR04MB7044.eurprd04.prod.outlook.com ([fe80::7be0:296:768c:e891%6]) with mapi id 15.20.8251.015; Wed, 18 Dec 2024 02:44:38 +0000 From: Shengjiu Wang To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_asrc_m2m: force cast for snd_pcm_format_t type Date: Wed, 18 Dec 2024 10:43:58 +0800 Message-Id: <20241218024358.3022635-1-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.37.1 X-ClientProxiedBy: SI1PR02CA0009.apcprd02.prod.outlook.com (2603:1096:4:1f7::10) To AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20) 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: AM0PR04MB7044:EE_|DU2PR04MB9132:EE_ X-MS-Office365-Filtering-Correlation-Id: 83f1c234-4376-481f-b3e3-08dd1f0dea2b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|52116014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: xagtnGxy1C+gi4zaTWD2KOxivFAb8PRsJAXFXx0fHNNpzrG8HaR6Sod62ojWET9OwoE0JwHT/g48t+oC35MDpfVHf3kjGT8+mW/ZzJDJLXUS+crwYKUS6QCJZ/iVxKWa86tXjpJwEmhDeSRy5BL5QIOW+r+wNrr/pOv2+XVlmQczZ9tEhAygLJea/cYa/dPbpiXnF5PInf4aL/ngEEoYB7RihFm+LPU/a66CicO8oksnwyRbCMJLjhtYiGjVhasQA6+a2q8tumbv26vRu5GShpbhYPfxoDF5UnvYluYMh/n2NZjTroPTq+47Sc/agyUIng4AXTKLkgcY9wUfjXLSlJXKmF9cJz8oakqyJ1XSoMP+gJnz/fDhc2IPHdD5EP6hWq0a2keA7G4RXiEyZudlVEJmlX1CME4poxXNWXtFR3ZFH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am-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB7044.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(52116014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b7CdVT/Cgrq7SLfsj4L+6G7G3oXryn+pRTx7AtQGcNn8eur8/8ZqKdXnCywLGiyLSr3r0U6mz880XzVHhE8aEssmfFaxeoYAEbdDX9qva5KJH+113vLy/usGmPqT4YVMCQqd/bzmCk5K5ua7wy8WIP6VjKCd010Uw2BUzBzSumIcX59jp5PXrFj67YavDP9PEw9zywA7kIldXh6LdiBlIxTgemMXbYMx5/na5t+RviFPNejiMu/8iBohT0sFzOzXhTNZzfnp1k7sYKYUrTSTvHX4mv6YE5UW9iBeBoVypWnl+7uvZq6wWlmRvXoCiPWr9ufMiwbO2ujKari0iFTdF/Bx9iRVURh71hApO7cxRMMKyfY5PQKpIPdI3m7weuJuw2p7nBNt96d6mWNu+qiF7NxuHarVvgam6h2SZdpSEjt0wXoNBmgn3vX05lS6S/iUKIZMUf36rZ1NOWSgEo+bBfhRxtk2M507Ufc+R4op01rykfjvS2LUFrEngmxPIwD7zLiFWaaRzwxCyuI8OEsc4XgUwfiJsrH5WkCAVx5d265VfiHfrefQ7ehR4OaxlAi0WJxqQWvBuPbjljzfHPioAWqM48DhypuyrNKCHz9G7H5a/6WHYDucIzGVgKd2u6jqHK2O69tJ6r4L35DmFRg1vjXUMvKt8fz/QthPOBSHBb1FmPoB/8kEjAwWBsaYwqZ7tpAwLBWbjBag8GsLSRj4tKon2ugXhj/Wixo4QiTOGDJdZdWPhj1DvE/tnnhLo6qiCkWEgoG8ndgVahNKJCyXChCEjbnbo+zX/hhOFL12n/xix7vcgJTdj32xHeh1Q0N8zXAr8Z+cSw4h266Z1iBERJ6UA+CzzMAouVPa8WAZc2XsXkAGkO8yM+wRwqbeONTAicX0KY9MlXvpetaiAnuqN5PnMaHCvAUkG//0MyhNeYjHSQG5/s7eTQvqgigvYBk3geVB3zp87qsA4kT8/Bx+3MPLODRXhOLgX6ADkR1Q3sEFqU/Zo/vf903Dgs073vCYNRbQPj0CUfo9lUBmmJjyVsw1gBazQ2NFGHgSzoUYLPoE0p5IIoyKXl90WopOPcMWuyG9zoWzuugl8d0jGgWoHV2J6jOgMxt6lsDdFAn7RKf4Rv04d1MI7VVO3pISfqnaP1IwXzHTWwEbdLhYaovcybEEwr+4WLON2ivCQ+0VtmIo1o+pY1/CDASKBSsYZBFc0kLdr4+nvwrKfWnlcwIE/Nz+ECEaa5VW4zn4LGA7mQwwxZcNqQ0MT3tIr+XIEQzbxdiaTVUE4ZBX4Y/OezpUjPDU435HfchsbFj0tpjULy2pT49bmESr3HY4aiiNgUV9wYn/APXMT35kfSI53vV+0qs8FcQM/BVNGPoFRbNUNoWGRqAZPQPolsLr6LtBztKhJPc6yiVi0cw18d9/veb1uPC4JNRbJJxwVyHN06IQ+pOe5UxFofpl2N66U7VnrryEZL333Zcvco79KyOXhvoFbwyp+9oo5I33A5p/8vNVLwLRwGChUSx1RSu1ezmc1fJzuTWhNXWvQLqPIBpCIMmufn0b68rspqbpI+OzHJi2rpAhjhJQ2D6VAi1AIPqRNtTZjVewXjAdgrMCXQVLZD6Wbw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83f1c234-4376-481f-b3e3-08dd1f0dea2b X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB7044.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:44:38.2188 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hV5dOFnoFkW0grYv2riEbuNeNGuEfsHWf4Xzm+MAFVezgIDLKi2wgqlI+od+uDdMQKcP22sw8vIpAJ6UL1BffA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9132 Fix sparse warnings: fsl_asrc_m2m.c:360:45: sparse: warning: incorrect type in argument 1 (different base types) fsl_asrc_m2m.c:360:45: sparse: expected restricted snd_pcm_format_t [usertype] pcm_forma fsl_asrc_m2m.c:360:45: sparse: got unsigned int [usertype] format fsl_asrc_m2m.c:361:41: sparse: warning: incorrect type in assignment (different base types) fsl_asrc_m2m.c:361:41: sparse: expected restricted snd_pcm_format_t fsl_asrc_m2m.c:361:41: sparse: got unsigned int [usertype] format fsl_asrc_m2m.c:365:45: sparse: warning: incorrect type in argument 1 (different base types) fsl_asrc_m2m.c:365:45: sparse: expected restricted snd_pcm_format_t [usertype] pcm_forma fsl_asrc_m2m.c:365:45: sparse: got unsigned int [usertype] pcm_format fsl_asrc_m2m.c:366:42: sparse: warning: incorrect type in assignment (different base types) fsl_asrc_m2m.c:366:42: sparse: expected restricted snd_pcm_format_t fsl_asrc_m2m.c:366:42: sparse: got unsigned int [usertype] pcm_format fsl_asrc_m2m.c:595:54: sparse: warning: incorrect type in assignment (different base types) fsl_asrc_m2m.c:595:54: sparse: expected unsigned int [usertype] formats fsl_asrc_m2m.c:595:54: sparse: got restricted snd_pcm_format_t [assigned] [usertype] k Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202412180043.PAA4t4sQ-lkp@intel.com/ Signed-off-by: Shengjiu Wang Reviewed-by: Daniel Baluta --- sound/soc/fsl/fsl_asrc_m2m.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index f266a3f5fd48..4906843e2a8f 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -357,13 +357,13 @@ static int fsl_asrc_m2m_comp_set_params(struct snd_compr_stream *stream, if (ret) return -EINVAL; - if (pcm_format_to_bits(params->codec.format) & cap.fmt_in) - pair->sample_format[IN] = params->codec.format; + if (pcm_format_to_bits((__force snd_pcm_format_t)params->codec.format) & cap.fmt_in) + pair->sample_format[IN] = (__force snd_pcm_format_t)params->codec.format; else return -EINVAL; - if (pcm_format_to_bits(params->codec.pcm_format) & cap.fmt_out) - pair->sample_format[OUT] = params->codec.pcm_format; + if (pcm_format_to_bits((__force snd_pcm_format_t)params->codec.pcm_format) & cap.fmt_out) + pair->sample_format[OUT] = (__force snd_pcm_format_t)params->codec.pcm_format; else return -EINVAL; @@ -592,7 +592,7 @@ static int fsl_asrc_m2m_fill_codec_caps(struct fsl_asrc *asrc, cap.rate_in, cap.rate_in_count * sizeof(__u32)); codec->descriptor[j].num_sample_rates = cap.rate_in_count; - codec->descriptor[j].formats = k; + codec->descriptor[j].formats = (__force __u32)k; codec->descriptor[j].pcm_formats = cap.fmt_out; codec->descriptor[j].src.out_sample_rate_min = cap.rate_out[0]; codec->descriptor[j].src.out_sample_rate_max =