Re: [PATCH] btrfs: Fix a C compliance issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-06-18 at 12:31 +0300, Nikolay Borisov wrote:
> On 18.06.2018 12:26, David Sterba wrote:
> > On Sat, Jun 16, 2018 at 01:28:13PM +0300, Nikolay Borisov wrote:
> > > I'd rather not see more printk being added. Nothing prevents from having
> > > the fmt string being passed to pr_info.
> > 
> > So you mean to do
> > 
> > +	static const char fmt[] = "Btrfs loaded, crc32c=%s"
> > +	pr_info(fmt);
> 
> Pretty much, something along the lines of
> 
> pr_info(fmt, crc32c_impl).
> 
> printk requires having the KERN_INFO in the format string, which I see
> no point in doing, correct me if I'm wrong?

You should know that what you proposed doesn't compile because pr_info()
relies on string concatenation and hence requires that its first argument is
a string constant instead of a const char pointer. Anyway, I will rework this
patch such that it uses pr_info() instead of printk().

Bart.


��.n��������+%������w��{.n�����{����n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux