mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
maint: add syntax check to prohibit static zero init
Now that all offenders have been cleaned, turn on a syntax-check rule to prevent future offenders. * cfg.mk (sc_prohibit_static_zero_init): New rule. * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Avoid false positive. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
ec81cf8942
commit
85f2d0dd55
8
cfg.mk
8
cfg.mk
@ -962,6 +962,14 @@ sc_prohibit_paren_brace:
|
||||
halt='Put space between closing parenthesis and opening brace' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# C guarantees that static variables are zero initialized, and some compilers
|
||||
# waste space by sticking explicit initializers in .data instead of .bss
|
||||
sc_prohibit_static_zero_init:
|
||||
@prohibit='\bstatic\b.*= *(0[^xX0-9]|NULL|false)' \
|
||||
in_vc_files='\.[chx](\.in)?$$' \
|
||||
halt='static variables do not need explicit zero initialization'\
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# FreeBSD exports the "devname" symbol which produces a warning.
|
||||
sc_prohibit_devname:
|
||||
@prohibit='\bdevname\b' \
|
||||
|
@ -15671,7 +15671,8 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
|
||||
* that back into the return status of this API call. */
|
||||
while (1) {
|
||||
/* Poll every 50ms */
|
||||
static struct timespec ts = { .tv_sec = 0,
|
||||
static struct timespec ts = {
|
||||
.tv_sec = 0,
|
||||
.tv_nsec = 50 * 1000 * 1000ull };
|
||||
virDomainBlockJobInfo dummy;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user