sys/xen: Use __printflike() instead of format(printf)

The __printflike macro sets the format to freebsd_kprintf which recent
clang understands and warns about. Fixes the following error:
`passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]`

MFC after:	1 week
This commit is contained in:
Alex Richardson
2025-09-15 21:54:36 -07:00
committed by Dimitry Andric
parent 3c0ea1b629
commit 4cd7be3e81
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ struct xbb_softc;
struct xbb_xen_req; struct xbb_xen_req;
static void xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt, static void xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt,
...) __attribute__((format(printf, 3, 4))); ...) __printflike(3, 4);
static int xbb_shutdown(struct xbb_softc *xbb); static int xbb_shutdown(struct xbb_softc *xbb);
/*------------------------------ Data Structures -----------------------------*/ /*------------------------------ Data Structures -----------------------------*/
+1 -1
View File
@@ -182,7 +182,7 @@ void xen_intr_unbind(xen_intr_handle_t *handle);
*/ */
int int
xen_intr_describe(xen_intr_handle_t port_handle, const char *fmt, ...) xen_intr_describe(xen_intr_handle_t port_handle, const char *fmt, ...)
__attribute__((format(printf, 2, 3))); __printflike(2, 3);
/** /**
* Signal the remote peer of an interrupt source associated with an * Signal the remote peer of an interrupt source associated with an
+4 -4
View File
@@ -151,7 +151,7 @@ int xenbus_grant_ring(device_t dev, unsigned long ring_mfn, grant_ref_t *refp);
* printf arguments. * printf arguments.
*/ */
void xenbus_dev_error(device_t dev, int err, const char *fmt, ...) void xenbus_dev_error(device_t dev, int err, const char *fmt, ...)
__attribute__((format(printf, 3, 4))); __printflike(3, 4);
/** /**
* va_list version of xenbus_dev_error(). * va_list version of xenbus_dev_error().
@@ -162,7 +162,7 @@ void xenbus_dev_error(device_t dev, int err, const char *fmt, ...)
* \param ap Va_list of printf arguments. * \param ap Va_list of printf arguments.
*/ */
void xenbus_dev_verror(device_t dev, int err, const char *fmt, va_list ap) void xenbus_dev_verror(device_t dev, int err, const char *fmt, va_list ap)
__attribute__((format(printf, 3, 0))); __printflike(3, 0);
/** /**
* Equivalent to xenbus_dev_error(), followed by * Equivalent to xenbus_dev_error(), followed by
@@ -174,7 +174,7 @@ void xenbus_dev_verror(device_t dev, int err, const char *fmt, va_list ap)
* printf arguments. * printf arguments.
*/ */
void xenbus_dev_fatal(device_t dev, int err, const char *fmt, ...) void xenbus_dev_fatal(device_t dev, int err, const char *fmt, ...)
__attribute__((format(printf, 3, 4))); __printflike(3, 4);
/** /**
* va_list version of xenbus_dev_fatal(). * va_list version of xenbus_dev_fatal().
@@ -185,7 +185,7 @@ void xenbus_dev_fatal(device_t dev, int err, const char *fmt, ...)
* \param ap Va_list of printf arguments. * \param ap Va_list of printf arguments.
*/ */
void xenbus_dev_vfatal(device_t dev, int err, const char *fmt, va_list) void xenbus_dev_vfatal(device_t dev, int err, const char *fmt, va_list)
__attribute__((format(printf, 3, 0))); __printflike(3, 0);
/** /**
* Convert a member of the xenbus_state enum into an ASCII string. * Convert a member of the xenbus_state enum into an ASCII string.
+1 -1
View File
@@ -270,7 +270,7 @@ int xs_scanf(struct xs_transaction t,
*/ */
int xs_printf(struct xs_transaction t, const char *dir, int xs_printf(struct xs_transaction t, const char *dir,
const char *node, const char *fmt, ...) const char *node, const char *fmt, ...)
__attribute__((format(printf, 4, 5))); __printflike(4, 5);
/** /**
* va_list version of xenbus_printf(). * va_list version of xenbus_printf().