@samitouri / QOSamiQemu / commits / 58e0580ab8

audio/mixeng: drop some needless checks

The NULL checks for be, name, callback_fn, and as in audio_mixeng_backend_open_{in,out} are redundant: the callers audio_be_open_{in,out} already assert that name, callback_fn, and as are non-NULL, and dereference be unconditionally via AUDIO_BACKEND_GET_CLASS(be) before the call. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20260224163229.2918858-1-marcandre.lureau@redhat.com>

Marc-André Lureau committed Feb 24, 2026 at 17:32 UTC 58e0580ab88cf133d28ff93be150524375eb29c2
1 file changed -6
audio/audio_template.h
-6
@@ -497,12 +497,6 @@ static SW *glue(audio_mixeng_backend_open_, TYPE) (
497 AudioMixengBackendClass *k;
498 AudiodevPerDirectionOptions *pdo;
499
500 - if (!be || !name || !callback_fn || !as) {
501 - audio_bug("backend=%p name=%p callback_fn=%p as=%p",
502 - be, name, callback_fn, as);
503 - goto fail;
504 - }
505 -
500 k = AUDIO_MIXENG_BACKEND_GET_CLASS(s);
501 pdo = glue(audio_get_pdo_, TYPE)(s->dev);
502