[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/9] audio: remove special audio_calloc function
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 2/9] audio: remove special audio_calloc function |
Date: |
Mon, 16 Jan 2023 09:23:22 +0000 |
User-agent: |
Mutt/2.2.9 (2022-11-12) |
On Sun, Jan 15, 2023 at 03:03:29PM +0100, Volker Rümelin wrote:
> Am 13.01.23 um 17:21 schrieb Daniel P. Berrangé:
> > The audio_calloc function does various checks on the size and
> > nmembers parameters to detect various error conditions. There
> > are only 5 callers
> >
> > * alsa_poll_helper: the pollfd count is small and bounded,
> > * audio_pcm_create_voice_pair_: allocating a single fixed
> > size struct
> > * audio_pcm_sw_alloc_resources_: samples could be negative
> > zero, or overflow, so needs a check
> > * audio_pcm_hw_add_new_: voice size could be zero for
> > backends that don't support audio input
> > * st_rate_start: allocating a single fixed size struct
> >
> > IOW, only two of the callers need special error checks and
> > it is clearer if their respective checks are inlined. Thus
> > audio_calloc can be eliminated.
>
> Hi Daniel,
>
> my patch series at
> https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg02895.html also
> removes audio_calloc(). There will be merge conflicts.
Ah, yes, sorry I missed that. I've sent a few comments on your
impl. Consider this patch dropped.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH 0/9] audio: remove deprecated QEMU_AUDIO env support, Daniel P . Berrangé, 2023/01/13
- [PATCH 4/9] audio: remove QEMUSoundCard linked list, Daniel P . Berrangé, 2023/01/13
- [PATCH 9/9] audio: remove support for QEMU_AUDIO_ env variables, Daniel P . Berrangé, 2023/01/13
- [PATCH 2/9] audio: remove special audio_calloc function, Daniel P . Berrangé, 2023/01/13
- [PATCH 6/9] docs: split the deprecation warning for soundcards vs VNC, Daniel P . Berrangé, 2023/01/13
- [PATCH 5/9] audio: remove empty AUD_remove_card method, Daniel P . Berrangé, 2023/01/13
- [PATCH 7/9] ui/vnc: don't accept VNC_ENCODING_AUDIO without audiodev, Daniel P . Berrangé, 2023/01/13
- [PATCH 3/9] audio: remove unused 'name' in QEMUSoundCard struct, Daniel P . Berrangé, 2023/01/13
- [PATCH 1/9] audio: don't check qemu_add_vm_change_state_handler failure, Daniel P . Berrangé, 2023/01/13
- [PATCH 8/9] audio: audio state is now mandatory for capture, Daniel P . Berrangé, 2023/01/13