Skip to contentSkip to conversation

drm: msm: adreno_gpu.c: Add and use pr_fmt(fmt)

PATCH Superseded zhaoxiao 2 participants 3 messages Aug 25, 2021

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

zhaoxiao

author
#0 lore raw

PATCH 1/1 drm: msm: adreno_gpu.c: Add and use pr_fmt(fmt)

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/adreno/adreno_gpu.c +8 -6
index 9f5a30234b33..6b75fbd39121 100644
@@ -20,6 +20,8 @@
 #include "msm_gem.h"
 #include "msm_mmu.h"
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 static bool zap_available = true;
 
 static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
@@ -753,7 +755,7 @@ void adreno_dump_info(struct msm_gpu *gpu)
 	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
 	int i;
 
-	printk("revision: %d (%d.%d.%d.%d)\n",
+	pr_info("revision: %d (%d.%d.%d.%d)\n",
 			adreno_gpu->info->revn, adreno_gpu->rev.core,
 			adreno_gpu->rev.major, adreno_gpu->rev.minor,
 			adreno_gpu->rev.patchid);
@@ -761,12 +763,12 @@ void adreno_dump_info(struct msm_gpu *gpu)
 	for (i = 0; i < gpu->nr_rings; i++) {
 		struct msm_ringbuffer *ring = gpu->rb[i];
 
-		printk("rb %d: fence:    %d/%d\n", i,
+		pr_info("rb %d: fence:    %d/%d\n", i,
 			ring->memptrs->fence,
 			ring->seqno);
 
-		printk("rptr:     %d\n", get_rptr(adreno_gpu, ring));
-		printk("rb wptr:  %d\n", get_wptr(ring));
+		pr_info("rptr:     %d\n", get_rptr(adreno_gpu, ring));
+		pr_info("rb wptr:  %d\n", get_wptr(ring));
 	}
 }
 
@@ -780,7 +782,7 @@ void adreno_dump(struct msm_gpu *gpu)
 		return;
 
 	/* dump these out in a form that can be parsed by demsm: */
-	printk("IO:region %s 00000000 00020000\n", gpu->name);
+	pr_info("IO:region %s 00000000 00020000\n", gpu->name);
 	for (i = 0; adreno_gpu->registers[i] != ~0; i += 2) {
 		uint32_t start = adreno_gpu->registers[i];
 		uint32_t end   = adreno_gpu->registers[i+1];
@@ -788,7 +790,7 @@ void adreno_dump(struct msm_gpu *gpu)
 
 		for (addr = start; addr <= end; addr++) {
 			uint32_t val = gpu_read(gpu, addr);
-			printk("IO:R %08x %08x\n", addr<<2, val);
+			pr_info("IO:R %08x %08x\n", addr<<2, val);
 		}
 	}
 }
Signature · 1 line
2.20.1
#1 lore raw
Thank you for the patch! Perhaps something to improve:

Hi zhaoxiao,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.14-rc7 next-20210825]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/zhaoxiao/drm-msm-adreno_gpu-c-Add-and-use-pr_fmt-fmt/20210825-173430
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 6e764bcd1cf72a2846c0e53d3975a09b242c04c9
config: arm64-randconfig-r035-20210825 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ea08c4cd1c0869ec5024a8bb3f5cdf06ab03ae83)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/bcd3c50e8c6b447878a38d6a853d12c1c657357b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review zhaoxiao/drm-msm-adreno_gpu-c-Add-and-use-pr_fmt-fmt/20210825-173430 git checkout bcd3c50e8c6b447878a38d6a853d12c1c657357b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/msm/adreno/adreno_gpu.c:23:9: warning: 'pr_fmt' macro redefined [-Wmacro-redefined]
   #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
           ^
   include/linux/printk.h:348:9: note: previous definition is here
   #define pr_fmt(fmt) fmt
           ^

1 warning generated.

vim +/pr_fmt +23 drivers/gpu/drm/msm/adreno/adreno_gpu.c

    22	
  > 23	#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    24	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#2 lore raw
In reply to zhaoxiao
Thank you for the patch! Perhaps something to improve:

Hi zhaoxiao,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.14-rc7 next-20210825]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/zhaoxiao/drm-msm-adreno_gpu-c-Add-and-use-pr_fmt-fmt/20210825-173430
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 6e764bcd1cf72a2846c0e53d3975a09b242c04c9
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/bcd3c50e8c6b447878a38d6a853d12c1c657357b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review zhaoxiao/drm-msm-adreno_gpu-c-Add-and-use-pr_fmt-fmt/20210825-173430 git checkout bcd3c50e8c6b447878a38d6a853d12c1c657357b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/msm/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/msm/adreno/adreno_gpu.c:23: warning: "pr_fmt" redefined
      23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
         | 
   In file included from include/asm-generic/bug.h:22,
                    from arch/arm/include/asm/bug.h:60,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/current.h:5,
                    from ./arch/arm/include/generated/asm/current.h:1,
                    from include/linux/mutex.h:14,
                    from include/linux/interconnect.h:10,
                    from drivers/gpu/drm/msm/adreno/adreno_gpu.c:10:
   include/linux/printk.h:348: note: this is the location of the previous definition
     348 | #define pr_fmt(fmt) fmt
         | 

vim +/pr_fmt +23 drivers/gpu/drm/msm/adreno/adreno_gpu.c

    22	
  > 23	#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    24	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org