From patchwork Thu Jun 2 09:09:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 578529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EB14FC43334 for ; Thu, 2 Jun 2022 09:10:52 +0000 (UTC) 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 008171740; Thu, 2 Jun 2022 11:10:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 008171740 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654161051; bh=x5EDPeQMv3q33yhNRq3oz2Q7XgHzXh0H34JBZu9FNNE=; h=Date:From:To:Subject:In-Reply-To:Cc:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=iu9vmvMJh81oxcE3r6/BUIsEJVRHD65hidp/bSDgilf4t1Su8S4mZuI888MRfFpXi NNa5iRUyK8FXl8NhujqO5YSirL/kVygND6jXNqOZRityh1RrAwaF2Wpj0oyISS+EDj hCt0j3xL5lVLX+KJh5ScLFRIpg2pycw9cKvCaNCk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9F05AF80158; Thu, 2 Jun 2022 11:10:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D18D8F80236; Thu, 2 Jun 2022 11:09:58 +0200 (CEST) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E29C0F80124; Thu, 2 Jun 2022 11:09:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E29C0F80124 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="s8ITVzTX"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="JQhDWKWq" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2528TS48020499; Thu, 2 Jun 2022 09:09:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=+NvTtdPxVv4L+NmIYTezbe7PQQVJ728tod1uWudzs+Y=; b=s8ITVzTXvSaSIpSFKwlza/hlATGim8RvMlXLHwu2Nr6Q9Tjj3ZqFvv8ESmKC9ym0t5Un WAmHLxrELvq70xBYSCSAdY6OpcD3afHI0P5fM/4xXkL+Nw7ef6yUqZqflC8WU6p8tRKq ket3vU1+/DrZ47nrnGVTPdzORbwkswaB+5CYX5mcCueh1SChiMIo9g3SXYA/EqMgszFi 6kU8jCuy1r00Gk4Qh0VgMN2Dlr6zPCws+OWyHCWKOmgjDoQn5+4r5/VoYor9hvYwxlpl rFn2L3A3d8kDfUJwANntpKEoR+KaR0qLWvIx80MXbeOpyU/a2WQU1h9ApoFIQScrz7B9 6w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gbcahsxtt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Jun 2022 09:09:51 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25291WNE028449; Thu, 2 Jun 2022 09:09:49 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3gc8k18t21-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Jun 2022 09:09:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJBkXcqWjNOU5qSxDeXOhIJ+iD6k07ePdWfl+ggaoBgmiOnfEFeatha/9lTxZVyKvfeWhS7H2DTqzqhmENcFxBjbSzpeQH07C0CyIie30NgGv71YmN2VsZs9E77Bd2lXy3MAb6FdC//1tMTA05zk/DTeMgPN+C099EXJb/bekbrRhI2EpThJl8DvXeedjVa0DDLBBtXQIYWo4wQtZX0buTUv8nB5pH2yrsevlRu28d5M1g43P4+S8fbAjuSEjrVIRexdJy6XOHNJWx8M8MFiSdKap5D5y1XEYpLN4uDxfN43nTlhKGzymAiI4CAlKX5DHqvgrXYgLSdPzqDaEIkNsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+NvTtdPxVv4L+NmIYTezbe7PQQVJ728tod1uWudzs+Y=; b=A83M6W0zNkowhbMORzh/GBCVyXS0gnnwqE8epwr2g6olg2/O476eB1uZot7f8xmXBtal9F8Ih5nPSai3h+Ha+LxZRCfMRs+ubmRQbP2lNl74s96pVTpCMg68baPFmg0mJTfFiH3hbv43r2TgJ7SUYeD92O8IcUlO57A3em8HNzXx7lRgekvY/zoAcBTFaGb2Dz7BKumXMZa+F0B5qEy/PIWcDzKH39jn9Pfiik+E1Tz4Q9NdhmGD3mUITe4hxnADpgV6PtUVDbeLv03fXVekfPwk7xNmqJTfPx10wnxymPczQrJaHveAX/bJQ/d3Os6awkYEE7aa7g1424+vYgM49g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+NvTtdPxVv4L+NmIYTezbe7PQQVJ728tod1uWudzs+Y=; b=JQhDWKWqMkz3g/qTB30ABmxvrbZ21sS5uu0/B5PMDGdH60Axy3UP2jA0W6vV+GqIkkN9YefW6buwSWr9WU6rHSCVHPvi3lvsjcMlGQaNDOGfiK1b7rUTTr/USBfEJrvKV8wVS6H0+mOGQubLxWgYICT+n3EBo9LMUSQsHl1GPRc= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 2 Jun 2022 09:09:47 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::86f:81ba:9951:5a7e]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::86f:81ba:9951:5a7e%2]) with mapi id 15.20.5293.019; Thu, 2 Jun 2022 09:09:47 +0000 Date: Thu, 2 Jun 2022 12:09:35 +0300 From: Dan Carpenter To: Pierre-Louis Bossart , Peter Ujfalusi Subject: [PATCH 2/2] ASoC: SOF: ipc-msg-injector: Fix reversed if statement Message-ID: Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0140.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::19) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb52588b-417a-432c-259d-08da4477a462 X-MS-TrafficTypeDiagnostic: SA2PR10MB4474:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HgJMX1vh+Pqb9c2+EMGEx0ziSavdfzrxPLyH+r0ly0Ekv/UbDaFDs22C8TP5WAz0xNyafR35UZfGGHnzuzkcI31O3j7ja2M4he0Dn6MQLuwGiZx7eAEEyv/tj7kpp3EM3qGB01B0E9sy/EJ+5V7aS0WMzz3Vb012I0tYv5OpvTqi9hMAuJ++GWWM0a13+uwGeziokwFDTw0TONXswrYxBjSeZrSOFcecCC/my85QZbMl0taJz3nA/wdQPOumFSw0i2qidFTKIWXWJSrdslzaYNdaOcI3U7HMBurnjivRDW3lBiek3h3L4L9XtbIhUlxCvo8ct48A+eW0CC0z2gn+fHtGfa33wfl9HO0O9ric8yMsLAsya0vbgsVyDD+DKdUsoFyYzPHXpZzgmN+uhSLTYpf7kmwfJ6KbCf1ACwmNpSgIP0fFzBupVpOLPKSK9oTMvAVkwRFWxvZV1TlZx5lYiEky1BuwGkI+qRjjWq6FPl94utusBZ5twTlOX5Kw/S4cH47LYJXSfIIQ7yeSwsowoAGRwWia4zkcQVnE8pk2RTs8JGCVkcUg+NLWgFX2KUjwArm061KrhdopPVP8byd4m8NoP+IsWYgLHwnn/IrRRL7ne3t/9/us7NyWqnmE6HqIUfmWMCoj4z46b+Cda7C8YxwIlpy6SX7lR8MLjOGEROPmXSH0d+PpyOjJu9MLckAAKVosjdQif/vGft1poGGoQKk6rW18VtPEpAPHN0U0hcY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2365.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(7916004)(366004)(186003)(83380400001)(66946007)(38350700002)(38100700002)(66476007)(66556008)(316002)(4326008)(5660300002)(2906002)(8936002)(44832011)(7416002)(54906003)(26005)(6506007)(6512007)(6666004)(9686003)(52116002)(110136005)(508600001)(6486002)(33716001)(8676002)(86362001)(67856001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kcXK5cWs5xXyc7CMqGNjHbXsrSyJgR/Zr3Zis4bMpPZ/Y5j/FqmZOKCo7aISbmgrksCI2LOSdhEiiqzE6TNLZZJBhvvuD9v6qDKRjXJ2TqH5x6hF3mdgpUNI+FVHXLZ1rZxtjeGVpyzVMGE2vP7Sb9CKLP9AtdEBIXyoelbtUpq/9L88jCTtIqaHBR8E9GIBoLkW2CKIw4kAE6EJhNzyARsBICaQ5myTnNYHXEFRdy7u4QNmRYEuC56/JmaMh/QSbSM2qRKo8JjvkmCs3Sqc+bLWAQbucbFCD2nqK3zBrH4O4/nb04EfjYPAcuxP3GgbXGSClXFFvkD0Lj7G1H9FW4Xo9n2+TVMxAFi6G/5rDWVuOZ7HrZp3dAAPodVpVjQ8bYFcWsD3e+rMCR+9bto4RmotMmtAidn5WiJksNVQ7EMZN2ibDUCq4swxVIV5wa6VMnvJCkCdIsbP2zyTMM417UDqDp3nBdf5ToomWVWkug5FDKbM6suLElyohsyWOx6k6ZgsofOJ5m/npg7G3UeXAs//tKBsvdQhvbjwuO2tVxEK9WnCHdxr/TOwqQ0o352998KtXMhmUcY1Poige58aQ/TZjW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y6FUxxdUvLwPbXC0HYm5u0C9u6+417oQT70wANuLM7B3XPwa2gQbDTr2ueLcJIL9bmtPyvfADs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb52588b-417a-432c-259d-08da4477a462 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 09:09:47.7132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SP51cJ3Le8RNqExJ4+KmCaz/k8PGHol5ALGljLQFPjmYPQlUzfY/d+DJdOrLS9dRT4+2702XR4uhkdUUx7pF5Ut8gr11HG8h88/huIoV0HI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4474 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517, 18.0.874 definitions=2022-06-02_01:2022-06-01, 2022-06-02 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206020037 X-Proofpoint-ORIG-GUID: cMSD2OMfgMsPG5ViKE14Dby5dMDI7ldW X-Proofpoint-GUID: cMSD2OMfgMsPG5ViKE14Dby5dMDI7ldW Cc: alsa-devel@alsa-project.org, Kai Vehmanen , Bard Liao , Takashi Iwai , kernel-janitors@vger.kernel.org, Liam Girdwood , Mark Brown , Ranjani Sridharan , Daniel Baluta , sound-open-firmware@alsa-project.org 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This if statement is reversed. In fact, the condition can just be deleted because writing zero bytes is a no-op. Fixes: 066c67624d8c ("ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages") Signed-off-by: Dan Carpenter --- sound/soc/sof/sof-client-ipc-msg-injector.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sound/soc/sof/sof-client-ipc-msg-injector.c b/sound/soc/sof/sof-client-ipc-msg-injector.c index 030cb97d7713..6bdfa527b7f7 100644 --- a/sound/soc/sof/sof-client-ipc-msg-injector.c +++ b/sound/soc/sof/sof-client-ipc-msg-injector.c @@ -200,16 +200,14 @@ static ssize_t sof_msg_inject_ipc4_dfs_write(struct file *file, return -EFAULT; count -= size; - if (!count) { - /* Copy the payload */ - size = simple_write_to_buffer(ipc4_msg->data_ptr, - priv->max_msg_size, ppos, buffer, - count); - if (size < 0) - return size; - if (size != count) - return -EFAULT; - } + /* Copy the payload */ + size = simple_write_to_buffer(ipc4_msg->data_ptr, + priv->max_msg_size, ppos, buffer, + count); + if (size < 0) + return size; + if (size != count) + return -EFAULT; ipc4_msg->data_size = count;