public: add XEN_RING_NR_UNCONSUMED_*() macros to ring.h
authorJuergen Gross <jgross@suse.com>
Fri, 28 Jan 2022 10:47:00 +0000 (11:47 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 28 Jan 2022 10:47:00 +0000 (11:47 +0100)
commit21170a738c11b24815b4afab2151bd3aa2a29acc
treeac4f45c4b72471e4ad9b1385c3078338a4b05017
parentaa390d513a67a6ec0a069eea7478e5ecd54a7ea6
public: add XEN_RING_NR_UNCONSUMED_*() macros to ring.h

Today RING_HAS_UNCONSUMED_*() macros are returning the number of
unconsumed requests or responses instead of a boolean as the name of
the macros would imply.

As this "feature" is already being used, rename the macros to
XEN_RING_NR_UNCONSUMED_*() and define the RING_HAS_UNCONSUMED_*() macros
by using the new XEN_RING_NR_UNCONSUMED_*() macros. In order to avoid
future misuse let RING_HAS_UNCONSUMED_*() optionally really return a
boolean (can be activated by defining XEN_RING_HAS_UNCONSUMED_IS_BOOL).

Note that the known misuses need to be switched to the new
XEN_RING_NR_UNCONSUMED_*() macros when using the RING_HAS_UNCONSUMED_*()
variants returning a boolean value.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/include/public/io/ring.h