[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Purge uses of banned g_assert_FOO()
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] [PATCH] Purge uses of banned g_assert_FOO() |
Date: |
Mon, 11 Jun 2018 10:22:21 +0100 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
On Mon, Jun 11, 2018 at 08:06:49AM +0200, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <address@hidden> writes:
>
> > On 06/08/2018 02:12 PM, Daniel P. Berrangé wrote:
> >> On Fri, Jun 08, 2018 at 07:02:31PM +0200, Markus Armbruster wrote:
> >>> We banned use of certain g_assert_FOO() functions outside tests, and
> >>> made checkpatch.pl flag them (commit 6e9389563e5). We neglected to
> >>> purge existing uses. Do that now.
> >>>
> >>> Signed-off-by: Markus Armbruster <address@hidden>
> >>> ---
> >>> hw/ide/ahci.c | 2 +-
> >>> hw/ppc/spapr_ovec.c | 12 ++++++------
> >>> hw/usb/dev-smartcard-reader.c | 2 +-
> >>> qom/object.c | 10 +++++-----
> >>> util/qht.c | 2 +-
> >>> 5 files changed, 14 insertions(+), 14 deletions(-)
> >>>
> >>> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> >>
> >>> diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
> >>> index 2131e33d27..13d0befd9c 100644
> >>> --- a/hw/usb/dev-smartcard-reader.c
> >>> +++ b/hw/usb/dev-smartcard-reader.c
> >>> @@ -786,7 +786,7 @@ static void ccid_write_data_block(USBCCIDState *s,
> >>> uint8_t slot, uint8_t seq,
> >>> DPRINTF(s, D_VERBOSE, "error %d\n", p->b.bError);
> >>> }
> >>> if (len) {
> >>> - g_assert_nonnull(data);
> >>> + assert(data);
> >>
> >> nitpick - all the other conversions used g_assert()
>
> The other conversions are in files that predominantly or exclusively use
> g_assert(). This one is in a file that exclusively uses assert().
Ah ok, makes sense then.
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 :|