[PATCH] scsi: libsas: Add __printf attribute to sas_ata_printk()

From: Adrián García Casado

Date: Tue Oct 20 2026 - 15:59:56 EST


sas_ata_printk() formats its variadic arguments via struct va_format and
%pV before passing them to printk().

Because %pV hides the format string from the compiler, GCC does not suggest
the format attribute under -Wsuggest-attribute=format, and callers do not
get compile-time format string validation.

Add the __printf(3, 4) attribute to sas_ata_printk() to enable compile-time
format string checking for its callers.

Signed-off-by: Adrián García Casado <adriangarciacasado42@xxxxxxxxx>
---
drivers/scsi/libsas/sas_ata.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 61368e55bf..53eac56c3a 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -372,6 +372,7 @@ static int local_ata_check_ready(struct ata_link *link)
}
}

+__printf(3, 4)
static int sas_ata_printk(const char *level, const struct domain_device *ddev,
const char *fmt, ...)
{
--
2.39.5