From 29f9eece2c98cc001699adf8b4601bf3129511b9 Mon Sep 17 00:00:00 2001 From: Seiichi Horie <26223147+suikan4github@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:54:14 +0900 Subject: [PATCH] Issue #15 : Remove the redundant parameter check code from ConfigureSRC() The assertion at the top of the rpp_driver::Adau1361Lower::ConfigureSrc() was redudant becuase the switch-case statement has default to catch the unkown Fs. So, the assertion was removed. Death test passed. --- src/codec/adau1361lower.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/codec/adau1361lower.cpp b/src/codec/adau1361lower.cpp index ac0752b..a3b655a 100644 --- a/src/codec/adau1361lower.cpp +++ b/src/codec/adau1361lower.cpp @@ -512,10 +512,6 @@ void ::rpp_driver::Adau1361Lower::InitializeRegisters() { // Set the converter clock. void ::rpp_driver::Adau1361Lower::ConfigureSrc(unsigned int fs) { - assert((fs == 24000 || fs == 32000 || fs == 48000 || fs == 96000 || - fs == 22050 || fs == 44100 || fs == 88200) && - "Bad Fs"); - switch (fs) { case 22050: case 24000: { @@ -549,7 +545,7 @@ void ::rpp_driver::Adau1361Lower::ConfigureSrc(unsigned int fs) { break; } default: - assert(false); + assert(false && "Bad Fs"); } }