Re: [kvm-unit-tests PATCH 01/11] arm/pci: Device tree PCI probing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 28, 2016 at 04:17:19PM +0100, Alexander Gordeev wrote:
> On Wed, Jan 13, 2016 at 04:13:07PM +0100, Andrew Jones wrote:
> > > +	assert(dt_get_nr_cells(node, &nac_root, &nsc_root) == 0);
> > 
> > Sorry the starter code I sent you had statements inside asserts().
> > We avoid those now, see commit 18ab6cadf
> 
> Hmm.. the commit does not appear addressing the described
> in changelog condition '...if somebody introduces a switch to
> "#define assert(...) /*nothing*/"...' as to-be-void asserts
> are not followed by return value checks (even when seemingly
> possible). If it worth following this pattern?
>

The asserts on return values that we've left are only there out
of paranoia. It's highly unlikely the return codes will not be
their expected values, but if they were, then it'd be good to
halt immediately, rather than continue on making the issue more
difficult to debug.

Now, it's also highly unlikely we'll ever run kvm-unit-tests with
a no-op assert() function, but I'm glad Thomas suggested we avoid
embedding actual functionality in them, as it's now the more correct
way to use assert().

Thanks,
drew
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux