From patchwork Tue Jul 4 09:11:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minjie Du X-Patchwork-Id: 698971 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 28DD6EB64DA for ; Tue, 4 Jul 2023 15:53:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 279DA7F4; Tue, 4 Jul 2023 17:52:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 279DA7F4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1688486006; bh=iq2KVGJP53BqCyqPlbJh19tc67lf3/n4/bAEQXA6pLg=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=XE6y9bZovshnVlGYzv9to4Q9oPVod9DEVn2v8xfb9G3yNp9wNP4Bc7+LyqKp4w6CK GQP73GCF/ZfZmwjyj1u1suY/j/xepG+gEqZ8DH7O2IB0bMyQ9wEacE3CDmdcFGAqzy c3xNB3YGZTzCt3dlcmNWveAkw28Rfqe7s83Q90AQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3BEB2F80535; Tue, 4 Jul 2023 17:52:13 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 47ACDF80125; Tue, 4 Jul 2023 17:52:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1D152F80125; Tue, 4 Jul 2023 11:12:07 +0200 (CEST) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20720.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::720]) (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 4727AF800E4 for ; Tue, 4 Jul 2023 11:11:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4727AF800E4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=Oxy+2nM5 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WkNBElDraykqjLTRFbiugwxNWmUj9llEyhPSTSaEi/i2GxNBJn1nNAUwfA8LgZRejmsRux9F9rXmM4SZYglMgfi28uENNDhEQt8agiFjB2hjlcFeF4QTaLxVkJzQzn5vurrLsc3E2nNlibd9iwiupLFuo9jZZ4kHihMzfqbOgORv3Kirb1TAMbtY70LXV1VVN2NzIwbEECszLU/6KkNz1sZdJexemxdOS6GSzh52QLUuGEKmU2xPowgl7zDFOADl7KB7tOjWv8My9x88plBPSLRtVVSYw9CwNPDWrnNYcRvbExxa5Yr13KfyZlD5jHyAvZwoG0V5GVM7wdZUgMnUxQ== 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=F1JblLbZYn+97rf+x0NM+vTxzOU6gRCHl0eZE0GEJ7o=; b=jMjqfDanU4V5OP3eDlV06givLofHJkfgPnneOnQscSiOL20AdNWo0kiLlKrmI0BrJp3YWwIqz2FjImn2hpnW+tfIfPU9RdRhqxQWL+u/HJUaElnL2s+nVBQpdXRzyDm8IwhqR5aE1vKpSFPO7g+0QnWLG+9CvyG1DQEbD3UZ2Gddq1SKphSEoK5BLdiL8BtZzYQgMpsr+xlzZ2NqWANyZ4fr75DBhK2tC6lfNVIpA62AeCh93ItEpt0+PAR2Bd0Hnt5cjDrhYr6wqW39YMASLhgByQ6nj1fxcUYpN96PkoRU7CcWL+oKNl2OFfAcIKM7dmA3kkt8YUPc4RSNcqKeUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F1JblLbZYn+97rf+x0NM+vTxzOU6gRCHl0eZE0GEJ7o=; b=Oxy+2nM59Ase/BrqPnrnVtXJffyu+7rkzAmSFdoXS2cR4GwINCr2Vxtw+eot7xi+EYbWFqi4di4sOjT/iFceNoNRNHjvn8A+89h16EB7GxqknZXPNry4pL537IlfEm2rSWtP1xf8yznkCJREHDx+uZCFkBgz1Wct7ErGCIkahY35rXLrhdwSMolGqtwHah5cjOaag1Usrui4IKBXiRCIkH3JKvntB5JiGcbz0nfX4UZQl3KqiugoAQQRrEAHIZZvBLEKhCaDgrPqt7UhYsuZk+m0Hyz4w4OzxQ2Kfft5d1+qg0xRK5YssFa9KT4ONQPzt9qo4+hfML7FA6/pDk03Eg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB5288.apcprd06.prod.outlook.com (2603:1096:4:1dc::9) by SEYPR06MB5789.apcprd06.prod.outlook.com (2603:1096:101:ba::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 09:11:48 +0000 Received: from SG2PR06MB5288.apcprd06.prod.outlook.com ([fe80::c2b:41ab:3b14:f920]) by SG2PR06MB5288.apcprd06.prod.outlook.com ([fe80::c2b:41ab:3b14:f920%6]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 09:11:48 +0000 From: Minjie Du To: Jaroslav Kysela , Takashi Iwai , Minjie Du , Stephen Rothwell , alsa-devel@alsa-project.org (moderated list:SOUND), linux-kernel@vger.kernel.org (open list) Cc: opensource.kernel@vivo.com Subject: [PATCH v1] sound: riptide: Remove duplicate judgments code Date: Tue, 4 Jul 2023 17:11:31 +0800 Message-Id: <20230704091131.6662-1-duminjie@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SI1PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:1f6::14) To SG2PR06MB5288.apcprd06.prod.outlook.com (2603:1096:4:1dc::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG2PR06MB5288:EE_|SEYPR06MB5789:EE_ X-MS-Office365-Filtering-Correlation-Id: b430ebae-3cac-4ffa-9ba4-08db7c6eb255 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ExlJG48rxXOABxPr1GiKbQ4fMKKBh8UQqHTbJswIu1uYaYV3hRAfq2js9uS/fDrK117EHSMNRXScSzZltMHpokh/x9xxeunQEwjfmCmj3OUSbKlQH+oRvJ8bVScmHtTBSEmwqqPqSOkEYtP74n9ilNZg+VuY8MSt/aaFoRSbH4d7G8Rg0/OgR4cGUu+P/vOD5b//ArjHCCHSLU/kwbCyonoObIQlkv0yKq5k3a7CEVCea+yXB79xkcOuL2Q2BH88wXCgP8P7QHmSj/MsPZvQ1yY++UtCenKelwmoVUr/yO5pt/lEpe6zviF7l8GyUIS45XyCPzY7Xo16pbyu5Z7jJYVMwecpuOSaZDt55pj7chJD19jFW1+7JWSejkomKq3CjoZEfFOG16PLjKcpcwRkJTwR54EfbI8ZXGZqYkWqvggCyhRBntRAUSvy6ESkw0mLc+Rt2c2agZdaBTn2c4mx2jOdV3GkCpXpVdOzQtNN+uEo5z1vdRcYG6Cfh3OqqAE17mcZiHgnhuUxB9rJhm1vFwQVRH9s8D8A40Ns3CdOT78phyWKM/2xe/WkVEHNOgJVNnfxaVh/mNJe4egeDkOJEH0NiMr16ninF7xovUTpWkpN5k7thr+anIbtgaXALX8r X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SG2PR06MB5288.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(366004)(396003)(451199021)(8936002)(5660300002)(8676002)(41300700001)(38350700002)(38100700002)(66946007)(66556008)(316002)(4326008)(66476007)(110136005)(36756003)(86362001)(107886003)(6666004)(478600001)(6506007)(26005)(6512007)(186003)(1076003)(52116002)(6486002)(83380400001)(2616005)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vkxeZRT8dKKJMia6lsAYxlTM0zcNeOpgq+TKmqEmiG7yMEMdVzofWYb9R/8IQfD6XKL5n08m4WykXLrrgSULnJurMsmJ4Q2Emytrf6Jsvwixjr03NRBnmZZyRQUIv+dm+n/cWsZMNkokAcyauMMcdGeUh2VXOpWWCcILOvaG4a5Yz1/rM+CA//OErp2ORRbdFxw6Kc4KDJ495mEADdNas7y7V16YDLK6xdE7UAvJIDOKW6i+4S+jH4kJdZH/Hc14HJ1ahcuLo6J4mc+P68r23LQBG6PmGBE+vGVnKQcEQG9qQinSRwHgrG1bo5+xhFWLM+MYmVKQldyn0mBYydXzYTHbJsr4QURNHMBb8teiXWreho2X33cMU4rWzZ5hd0EkSGdzXobUFwjxKnSvLe8BzKxpa8fQFS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NZhQxhnUV3V0sy2rVpPHJCMx6kuA2h02Vu7ZWuW/jYxkwegUxc5DbztVYrjo+f4BV/h+Yw2S7EZQWuBzA9c/+bBTyQR+qBHjVbI4a/KnJlBocz X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b430ebae-3cac-4ffa-9ba4-08db7c6eb255 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB5288.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 09:11:48.4825 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wy1lBFpvR7GV8c0Q5uP3YfiqV5vdmBY1Xv/y2X/oT4EIS7FgYiz64vne+lccnnE1/Lf9gtLTD5Iq8q304h/KiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5789 X-MailFrom: duminjie@vivo.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: 6KJ2GY4DDRPE3CW44FYBZ52DA6BR3TAX X-Message-ID-Hash: 6KJ2GY4DDRPE3CW44FYBZ52DA6BR3TAX X-Mailman-Approved-At: Tue, 04 Jul 2023 15:52:09 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Fix: delate duplicate judgments Could you help check it out? Thank you! Signed-off-by: Minjie Du --- sound/pci/riptide/riptide.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index b37c877c2..9bf4b2e86 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -958,8 +958,7 @@ getsourcesink(struct cmdif *cif, unsigned char source, unsigned char sink, { union cmdret rptr = CMDRET_ZERO; - if (SEND_RSSV(cif, source, sink, &rptr) && - SEND_RSSV(cif, source, sink, &rptr)) + if (SEND_RSSV(cif, source, sink, &rptr)) return -EIO; *a = rptr.retbytes[0]; *b = rptr.retbytes[1]; @@ -978,8 +977,7 @@ getsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int *rate) s = intdec; for (i = 0; i < 2; i++) { if (*s != 0xff) { - if (SEND_RSRC(cif, *s, &rptr) && - SEND_RSRC(cif, *s, &rptr)) + if (SEND_RSRC(cif, *s, &rptr)) return -EIO; p[i] += rptr.retwords[1]; p[i] *= rptr.retwords[2]; @@ -1013,8 +1011,7 @@ setsampleformat(struct cmdif *cif, sig = snd_pcm_format_unsigned(format) != 0; order = snd_pcm_format_big_endian(format) != 0; - if (SEND_SETF(cif, mixer, w, ch, order, sig, id) && - SEND_SETF(cif, mixer, w, ch, order, sig, id)) { + if (SEND_SETF(cif, mixer, w, ch, order, sig, id)) { snd_printdd("setsampleformat failed\n"); return -EIO; } @@ -1060,7 +1057,7 @@ getmixer(struct cmdif *cif, short num, unsigned short *rval, { union cmdret rptr = CMDRET_ZERO; - if (SEND_RDGV(cif, num, num, &rptr) && SEND_RDGV(cif, num, num, &rptr)) + if (SEND_RDGV(cif, num, num, &rptr)) return -EIO; *rval = rptr.retwords[0]; *lval = rptr.retwords[1];