Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Hannes Reinecke <hare@suse.de>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, John Garry <john.g.garry@oracle.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <mkp@kernel.org>
Subject: Re: [PATCH v2 2/2] scsi: core: Eliminate scsi_log_{reserve,release}_buffer()
Date: Wed, 9 Sep 2026 20:50:27 -0700	[thread overview]
Message-ID: <f43d9c65-20dc-4b5b-bc63-e48b48782446@acm.org> (raw)
In-Reply-To: <f53edf7b-fc80-4815-a884-f03a25ab0527@suse.de>


On 9/7/26 7:44 AM, Hannes Reinecke wrote:
> On 8/31/26 7:58 PM, Bart Van Assche wrote:
>> -static size_t sdev_format_header(char *logbuf, size_t logbuf_len,
>> -                 const char *name, int tag)
>> +static void __printf(5, 0)
>> +sdev_tag_prefix_vprintk(const char *level, const struct scsi_device 
>> *sdev,
>> +            const char *name, int tag, const char *fmt,
>> +            va_list *args)
>>   {
>> -    size_t off = 0;
>> +    const struct device *dev;
>> +    struct va_format vaf = {
>> +        .fmt = fmt,
>> +        .va = args,
>> +    };
>> -    if (name)
>> -        off += scnprintf(logbuf + off, logbuf_len - off,
>> -                 "[%s] ", name);
>> +    if (!sdev)
>> +        return;
>> -    if (WARN_ON(off >= logbuf_len))
>> -        return off;
>> +    dev = &sdev->sdev_gendev;
>> +    if (name) {
>> +        if (tag >= 0)
>> +            dev_printk(level, dev, "[%s] tag#%d %pV", name, tag,
>> +                   &vaf);
>> +        else
>> +            dev_printk(level, dev, "[%s] %pV", name, &vaf);
>> +    } else {
>> +        if (tag >= 0)
>> +            dev_printk(level, dev, "tag#%d %pV", tag, &vaf);
>> +        else
>> +            dev_printk(level, dev, "%pV", &vaf);
>> +    }
>> +}
> But that would completely revert the idea of this patch; 'dev_printk' 
> will always insert a newline after the string argument, and the whole 
> point of this patch was that do _not_ want to have a newline here as we
> want to print out several things before terminating the log message.

No direct nor any indirect callers of this function use KERN_CONT, isn't
it? Please let me know if I overlooked something.

Bart.

      parent reply	other threads:[~2026-09-10  3:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 17:58 [PATCH v2 0/2] scsi: core: Optimize the SCSI printk() variants Bart Van Assche
2026-08-31 17:58 ` [PATCH v2 1/2] scsi: core: Add KUnit tests for scsi_logging.c Bart Van Assche
2026-08-31 20:05   ` sashiko-bot
2026-08-31 17:58 ` [PATCH v2 2/2] scsi: core: Eliminate scsi_log_{reserve,release}_buffer() Bart Van Assche
2026-09-07 14:44   ` Hannes Reinecke
2026-09-09 16:37     ` Bart Van Assche
2026-09-10 10:45       ` Hannes Reinecke
2026-09-10 13:28         ` Bart Van Assche
2026-09-10  3:50     ` Bart Van Assche [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=f43d9c65-20dc-4b5b-bc63-e48b48782446@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.de \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mkp@kernel.org \
    /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