diff mbox series

[4/8] drm/i915/guc: Update GuC messages in intel_guc_ct.c

Message ID 20230120164050.1765-5-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show
Series GuC oriented print macros | expand

Commit Message

Michal Wajdeczko Jan. 20, 2023, 4:40 p.m. UTC
Use new macros to have common prefix that also include GT#.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

kernel test robot Jan. 20, 2023, 7:49 p.m. UTC | #1
Hi Michal,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]

url:    https://github.com/intel-lab-lkp/linux/commits/Michal-Wajdeczko/drm-i915-guc-Add-GuC-oriented-print-macros/20230121-004232
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
patch link:    https://lore.kernel.org/r/20230120164050.1765-5-michal.wajdeczko%40intel.com
patch subject: [PATCH 4/8] drm/i915/guc: Update GuC messages in intel_guc_ct.c
config: i386-randconfig-a004 (https://download.01.org/0day-ci/archive/20230121/202301210330.zvfxkqjp-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/intel-lab-lkp/linux/commit/e3ee219e703a4153b750288ac3e28cd2ea4130c1
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Michal-Wajdeczko/drm-i915-guc-Add-GuC-oriented-print-macros/20230121-004232
        git checkout e3ee219e703a4153b750288ac3e28cd2ea4130c1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c:27:40: warning: unused function 'ct_to_i915' [-Wunused-function]
   static inline struct drm_i915_private *ct_to_i915(struct intel_guc_ct *ct)
                                          ^
   1 warning generated.


vim +/ct_to_i915 +27 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c

6fb086e5e6ba82d Daniele Ceraolo Spurio 2021-06-02  26  
6fb086e5e6ba82d Daniele Ceraolo Spurio 2021-06-02 @27  static inline struct drm_i915_private *ct_to_i915(struct intel_guc_ct *ct)
6fb086e5e6ba82d Daniele Ceraolo Spurio 2021-06-02  28  {
6fb086e5e6ba82d Daniele Ceraolo Spurio 2021-06-02  29  	return ct_to_gt(ct)->i915;
6fb086e5e6ba82d Daniele Ceraolo Spurio 2021-06-02  30  }
6fb086e5e6ba82d Daniele Ceraolo Spurio 2021-06-02  31
John Harrison Jan. 23, 2023, 10:54 p.m. UTC | #2
On 1/20/2023 08:40, Michal Wajdeczko wrote:
> Use new macros to have common prefix that also include GT#.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> ---
>   drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 12 ++++--------
>   1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> index 2b22065e87bf..89adfc4193d2 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> @@ -11,6 +11,7 @@
>   
>   #include "i915_drv.h"
>   #include "intel_guc_ct.h"
> +#include "intel_guc_print.h"
>   #include "gt/intel_gt.h"
>   
>   static inline struct intel_guc *ct_to_guc(struct intel_guc_ct *ct)
> @@ -28,21 +29,16 @@ static inline struct drm_i915_private *ct_to_i915(struct intel_guc_ct *ct)
>   	return ct_to_gt(ct)->i915;
>   }
>   
> -static inline struct drm_device *ct_to_drm(struct intel_guc_ct *ct)
> -{
> -	return &ct_to_i915(ct)->drm;
> -}
> -
>   #define CT_ERROR(_ct, _fmt, ...) \
> -	drm_err(ct_to_drm(_ct), "CT: " _fmt, ##__VA_ARGS__)
> +	guc_err(ct_to_guc(_ct), "CT: " _fmt, ##__VA_ARGS__)
>   #ifdef CONFIG_DRM_I915_DEBUG_GUC
>   #define CT_DEBUG(_ct, _fmt, ...) \
> -	drm_dbg(ct_to_drm(_ct), "CT: " _fmt, ##__VA_ARGS__)
> +	guc_dbg(ct_to_guc(_ct), "CT: " _fmt, ##__VA_ARGS__)
>   #else
>   #define CT_DEBUG(...)	do { } while (0)
>   #endif
>   #define CT_PROBE_ERROR(_ct, _fmt, ...) \
> -	i915_probe_error(ct_to_i915(ct), "CT: " _fmt, ##__VA_ARGS__)
> +	guc_probe_error(ct_to_guc(ct), "CT: " _fmt, ##__VA_ARGS__)
ct_to_i915 is also now redundant and can be removed?

John.

>   
>   /**
>    * DOC: CTB Blob
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
index 2b22065e87bf..89adfc4193d2 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
@@ -11,6 +11,7 @@ 
 
 #include "i915_drv.h"
 #include "intel_guc_ct.h"
+#include "intel_guc_print.h"
 #include "gt/intel_gt.h"
 
 static inline struct intel_guc *ct_to_guc(struct intel_guc_ct *ct)
@@ -28,21 +29,16 @@  static inline struct drm_i915_private *ct_to_i915(struct intel_guc_ct *ct)
 	return ct_to_gt(ct)->i915;
 }
 
-static inline struct drm_device *ct_to_drm(struct intel_guc_ct *ct)
-{
-	return &ct_to_i915(ct)->drm;
-}
-
 #define CT_ERROR(_ct, _fmt, ...) \
-	drm_err(ct_to_drm(_ct), "CT: " _fmt, ##__VA_ARGS__)
+	guc_err(ct_to_guc(_ct), "CT: " _fmt, ##__VA_ARGS__)
 #ifdef CONFIG_DRM_I915_DEBUG_GUC
 #define CT_DEBUG(_ct, _fmt, ...) \
-	drm_dbg(ct_to_drm(_ct), "CT: " _fmt, ##__VA_ARGS__)
+	guc_dbg(ct_to_guc(_ct), "CT: " _fmt, ##__VA_ARGS__)
 #else
 #define CT_DEBUG(...)	do { } while (0)
 #endif
 #define CT_PROBE_ERROR(_ct, _fmt, ...) \
-	i915_probe_error(ct_to_i915(ct), "CT: " _fmt, ##__VA_ARGS__)
+	guc_probe_error(ct_to_guc(ct), "CT: " _fmt, ##__VA_ARGS__)
 
 /**
  * DOC: CTB Blob