Re: [PATCH 1/1] RDMA/rxe: Make pr_fmt work

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

 




在 2024/4/4 20:01, Zhu Yanjun 写道:


在 2024/4/4 16:59, Jason Gunthorpe 写道:
On Wed, Mar 27, 2024 at 08:40:54PM +0100, Zhu Yanjun wrote:
在 2024/3/27 14:08, Jason Gunthorpe 写道:
On Sat, Mar 23, 2024 at 09:31:39AM +0100, Yanjun.Zhu wrote:
From: Zhu Yanjun<yanjun.zhu@xxxxxxxxx>

If the definition of pr_fmt is before the header file. The pr_fmt
will be overwritten by the header file. So move the definition of
pr_fmt to the below of the header file.
what header file?
include/linux/printk.h

Because this driver will finally call printk function to output the logs,
the header file include/linux/printk.h needs be included.

In include/linux/printk.h, pr_fmt is defined.
This doesn't make sense, printk.h has:

#ifndef pr_fmt
#define pr_fmt(fmt) fmt
#endif

Before or after printk.h should not have an impact.


Sorry. The previous mail is not sent successfully. I resend it.

#ifndef pr_fmt

...

#endif

The above will not undefine pr_fmt.

#undef pr_fmt will undefine pr_fmt.

This link explains the above in details.

https://www.techonthenet.com/c_language/directives/ifndef.php

Thanks a lot for your comments.

Zhu Yanjun

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux