mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.garry@linux.dev>
To: "Adrián García Casado" <adriangarciacasado42@gmail.com>,
	"Martin K . Petersen" <mkp@kernel.org>,
	"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: John Garry <john.g.garry@oracle.com>,
	Jason Yan <yanaijie@huawei.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: libsas: Add __printf attribute to sas_ata_printk()
Date: Wed, 21 Oct 2026 09:56:13 +0100	[thread overview]
Message-ID: <c1282924-f91c-440b-b683-b663765a3e38@linux.dev> (raw)
In-Reply-To: <20261020195934.250768-1-adriangarciacasado42@gmail.com>

On 10/20/26 20:59, Adrián García Casado wrote:
> 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@gmail.com>
> ---
>   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)
>   	}
>   }

I checked 
https://gcc.gnu.org/onlinedocs/gcc/Common-Attributes.html#Common-Function-Attributes 
format section, and this looks sane, so:
Reviewed-by: John Garry <john.garry@linux.dev>


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


      reply	other threads:[~2026-10-21  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 19:59 Adrián García Casado
2026-10-21  8:56 ` John Garry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1282924-f91c-440b-b683-b663765a3e38@linux.dev \
    --to=john.garry@linux.dev \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adriangarciacasado42@gmail.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkp@kernel.org \
    --cc=yanaijie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®