From: Bart Van Assche <hidden> Date: 2018-06-15 22:37:04
The C programming language does not allow to use preprocessor statements
inside macro arguments (pr_info() is defined as a macro). Hence rework
the pr_info() statement in btrfs_print_mod_info() such that it becomes
compliant. This patch allows tools like sparse to analyze the BTRFS
source code.
Fixes: 62e855771dac ("btrfs: convert printk(KERN_* to use pr_* calls")
Signed-off-by: Bart Van Assche <redacted>
Cc: Jeff Mahoney <redacted>
Cc: David Sterba <dsterba@suse.com>
---
fs/btrfs/super.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Nikolay Borisov <hidden> Date: 2018-06-16 10:28:16
On 16.06.2018 01:36, Bart Van Assche wrote:
quoted hunk
The C programming language does not allow to use preprocessor statements
inside macro arguments (pr_info() is defined as a macro). Hence rework
the pr_info() statement in btrfs_print_mod_info() such that it becomes
compliant. This patch allows tools like sparse to analyze the BTRFS
source code.
Fixes: 62e855771dac ("btrfs: convert printk(KERN_* to use pr_* calls")
Signed-off-by: Bart Van Assche <redacted>
Cc: Jeff Mahoney <redacted>
Cc: David Sterba <dsterba@suse.com>
---
fs/btrfs/super.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: David Sterba <hidden> Date: 2018-06-18 09:29:24
On Sat, Jun 16, 2018 at 01:28:13PM +0300, Nikolay Borisov wrote:
On 16.06.2018 01:36, Bart Van Assche wrote:
quoted
The C programming language does not allow to use preprocessor statements
inside macro arguments (pr_info() is defined as a macro). Hence rework
the pr_info() statement in btrfs_print_mod_info() such that it becomes
compliant. This patch allows tools like sparse to analyze the BTRFS
source code.
Fixes: 62e855771dac ("btrfs: convert printk(KERN_* to use pr_* calls")
Signed-off-by: Bart Van Assche <redacted>
Cc: Jeff Mahoney <redacted>
Cc: David Sterba <dsterba@suse.com>
---
fs/btrfs/super.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Nikolay Borisov <hidden> Date: 2018-06-18 09:31:24
On 18.06.2018 12:26, David Sterba wrote:
On Sat, Jun 16, 2018 at 01:28:13PM +0300, Nikolay Borisov wrote:
quoted
On 16.06.2018 01:36, Bart Van Assche wrote:
quoted
The C programming language does not allow to use preprocessor statements
inside macro arguments (pr_info() is defined as a macro). Hence rework
the pr_info() statement in btrfs_print_mod_info() such that it becomes
compliant. This patch allows tools like sparse to analyze the BTRFS
source code.
Fixes: 62e855771dac ("btrfs: convert printk(KERN_* to use pr_* calls")
Signed-off-by: Bart Van Assche <redacted>
Cc: Jeff Mahoney <redacted>
Cc: David Sterba <dsterba@suse.com>
---
fs/btrfs/super.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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?
From: Bart Van Assche <hidden> Date: 2018-06-20 16:44:58
On Mon, 2018-06-18 at 12:31 +0300, Nikolay Borisov wrote:
On 18.06.2018 12:26, David Sterba wrote:
quoted
On Sat, Jun 16, 2018 at 01:28:13PM +0300, Nikolay Borisov wrote:
quoted
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�+����{���k~���^n�r���z���h����&���z��z�ޗ�+��+zf���h���~����i��������z_��j:+v���)ߣ�m
From: David Sterba <hidden> Date: 2018-06-20 16:58:48
On Wed, Jun 20, 2018 at 04:44:54PM +0000, Bart Van Assche wrote:
On Mon, 2018-06-18 at 12:31 +0300, Nikolay Borisov wrote:
quoted
On 18.06.2018 12:26, David Sterba wrote:
quoted
On Sat, Jun 16, 2018 at 01:28:13PM +0300, Nikolay Borisov wrote:
quoted
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().
Right, the pr_info(fmt,...) does not compile. The closest version I got to is
below. It does not look pretty, but I can't think of a better version right
now.
From: Jeff Mahoney <hidden> Date: 2018-06-20 17:20:00
On 6/20/18 12:55 PM, David Sterba wrote:
quoted hunk
On Wed, Jun 20, 2018 at 04:44:54PM +0000, Bart Van Assche wrote:
quoted
On Mon, 2018-06-18 at 12:31 +0300, Nikolay Borisov wrote:
quoted
On 18.06.2018 12:26, David Sterba wrote:
quoted
On Sat, Jun 16, 2018 at 01:28:13PM +0300, Nikolay Borisov wrote:
quoted
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().
Right, the pr_info(fmt,...) does not compile. The closest version I got to is
below. It does not look pretty, but I can't think of a better version right
now.