Re: [PATCH] ceph: undefine pr_fmt before redefining it

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

 



On Fri, Aug 2, 2019 at 7:23 PM Jeff Layton <jlayton@xxxxxxxxxx> wrote:
>
> The preprocessor throws a warning here in some cases:
>
> In file included from fs/ceph/super.h:5,
>                  from fs/ceph/io.c:16:
> ./include/linux/ceph/ceph_debug.h:5: warning: "pr_fmt" redefined
>     5 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>       |
> In file included from ./include/linux/kernel.h:15,
>                  from fs/ceph/io.c:12:
> ./include/linux/printk.h:288: note: this is the location of the previous definition
>   288 | #define pr_fmt(fmt) fmt
>       |
>
> Since we do mean to redefine it, make that explicit by undefining it
> first.
>
> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> ---
>  include/linux/ceph/ceph_debug.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/ceph/ceph_debug.h b/include/linux/ceph/ceph_debug.h
> index d5a5da838caf..fa4a84e0e018 100644
> --- a/include/linux/ceph/ceph_debug.h
> +++ b/include/linux/ceph/ceph_debug.h
> @@ -2,6 +2,7 @@
>  #ifndef _FS_CEPH_DEBUG_H
>  #define _FS_CEPH_DEBUG_H
>
> +#undef pr_fmt
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
>  #include <linux/string.h>

Hi Jeff,

Looks like fs/ceph/io.c is a new file you are working on?  ceph_debug.h
should be included at the top of every file.

Thanks,

                Ilya



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux