linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] drm/i915/request: Remove unused variables
@ 2021-11-21 10:13 cgel.zte
  2021-11-21 12:18 ` Christophe JAILLET
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: cgel.zte @ 2021-11-21 10:13 UTC (permalink / raw)
  To: jani.nikula
  Cc: joonas.lahtinen, rodrigo.vivi, airlied, daniel, intel-gfx,
	dri-devel, linux-kernel, yong yiran, Zeal Robot

From: yong yiran <yong.yiran@zte.com.cn>

The clang_analyzer complains as follows:
drivers/gpu/drm/i915/i915_request.c:2119:2 warning:
Value stored to 'x' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: yong yiran <yong.yiran@zte.com.cn>
---
 drivers/gpu/drm/i915/i915_request.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 820a1f38b271..5e4420f461e9 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -2047,7 +2047,6 @@ void i915_request_show(struct drm_printer *m,
 {
 	const char *name = rq->fence.ops->get_timeline_name((struct dma_fence *)&rq->fence);
 	char buf[80] = "";
-	int x = 0;
 
 	/*
 	 * The prefix is used to show the queue status, for which we use
@@ -2079,8 +2078,6 @@ void i915_request_show(struct drm_printer *m,
 	 *      from the lists
 	 */
 
-	x = print_sched_attr(&rq->sched.attr, buf, x, sizeof(buf));
-
 	drm_printf(m, "%s%.*s%c %llx:%lld%s%s %s @ %dms: %s\n",
 		   prefix, indent, "                ",
 		   queue_status(rq),
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH linux-next] drm/i915/request: Remove unused variables
  2021-11-21 10:13 [PATCH linux-next] drm/i915/request: Remove unused variables cgel.zte
@ 2021-11-21 12:18 ` Christophe JAILLET
  2021-11-21 12:18 ` Christophe JAILLET
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Christophe JAILLET @ 2021-11-21 12:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: intel-gfx, dri-devel

Le 21/11/2021 à 11:13, cgel.zte@gmail.com a écrit :
> From: yong yiran <yong.yiran@zte.com.cn>
> 
> The clang_analyzer complains as follows:
> drivers/gpu/drm/i915/i915_request.c:2119:2 warning:
> Value stored to 'x' is never read
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: yong yiran <yong.yiran@zte.com.cn>
> ---
>   drivers/gpu/drm/i915/i915_request.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 820a1f38b271..5e4420f461e9 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -2047,7 +2047,6 @@ void i915_request_show(struct drm_printer *m,
>   {
>   	const char *name = rq->fence.ops->get_timeline_name((struct dma_fence *)&rq->fence);
>   	char buf[80] = "";
> -	int x = 0;
>   
>   	/*
>   	 * The prefix is used to show the queue status, for which we use
> @@ -2079,8 +2078,6 @@ void i915_request_show(struct drm_printer *m,
>   	 *      from the lists
>   	 */
>   
> -	x = print_sched_attr(&rq->sched.attr, buf, x, sizeof(buf));
> -

Seriously?

CJ


>   	drm_printf(m, "%s%.*s%c %llx:%lld%s%s %s @ %dms: %s\n",
>   		   prefix, indent, "                ",
>   		   queue_status(rq),
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH linux-next] drm/i915/request: Remove unused variables
  2021-11-21 10:13 [PATCH linux-next] drm/i915/request: Remove unused variables cgel.zte
  2021-11-21 12:18 ` Christophe JAILLET
@ 2021-11-21 12:18 ` Christophe JAILLET
  2021-11-22  9:09   ` Jani Nikula
  2021-11-22  6:48 ` kernel test robot
  2021-11-22  7:08 ` kernel test robot
  3 siblings, 1 reply; 6+ messages in thread
From: Christophe JAILLET @ 2021-11-21 12:18 UTC (permalink / raw)
  To: cgel.zte, jani.nikula
  Cc: joonas.lahtinen, rodrigo.vivi, airlied, daniel, intel-gfx,
	dri-devel, linux-kernel, yong yiran, Zeal Robot

Le 21/11/2021 à 11:13, cgel.zte@gmail.com a écrit :
> From: yong yiran <yong.yiran@zte.com.cn>
> 
> The clang_analyzer complains as follows:
> drivers/gpu/drm/i915/i915_request.c:2119:2 warning:
> Value stored to 'x' is never read
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: yong yiran <yong.yiran@zte.com.cn>
> ---
>   drivers/gpu/drm/i915/i915_request.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 820a1f38b271..5e4420f461e9 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -2047,7 +2047,6 @@ void i915_request_show(struct drm_printer *m,
>   {
>   	const char *name = rq->fence.ops->get_timeline_name((struct dma_fence *)&rq->fence);
>   	char buf[80] = "";
> -	int x = 0;
>   
>   	/*
>   	 * The prefix is used to show the queue status, for which we use
> @@ -2079,8 +2078,6 @@ void i915_request_show(struct drm_printer *m,
>   	 *      from the lists
>   	 */
>   
> -	x = print_sched_attr(&rq->sched.attr, buf, x, sizeof(buf));
> -

Seriously?

CJ


>   	drm_printf(m, "%s%.*s%c %llx:%lld%s%s %s @ %dms: %s\n",
>   		   prefix, indent, "                ",
>   		   queue_status(rq),
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH linux-next] drm/i915/request: Remove unused variables
  2021-11-21 10:13 [PATCH linux-next] drm/i915/request: Remove unused variables cgel.zte
  2021-11-21 12:18 ` Christophe JAILLET
  2021-11-21 12:18 ` Christophe JAILLET
@ 2021-11-22  6:48 ` kernel test robot
  2021-11-22  7:08 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-22  6:48 UTC (permalink / raw)
  To: cgel.zte, jani.nikula
  Cc: kbuild-all, airlied, intel-gfx, linux-kernel, dri-devel,
	yong yiran, rodrigo.vivi, Zeal Robot

[-- Attachment #1: Type: text/plain, Size: 2342 bytes --]

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20211118]

url:    https://github.com/0day-ci/linux/commits/cgel-zte-gmail-com/drm-i915-request-Remove-unused-variables/20211121-181441
base:    5191249f880367a4cd675825cd721a8d78f26a45
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/117f34e1836e312bdea3b7c886d829e30f55a094
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review cgel-zte-gmail-com/drm-i915-request-Remove-unused-variables/20211121-181441
        git checkout 117f34e1836e312bdea3b7c886d829e30f55a094
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i915/i915_request.c:2032:12: error: 'print_sched_attr' defined but not used [-Werror=unused-function]
    2032 | static int print_sched_attr(const struct i915_sched_attr *attr,
         |            ^~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +/print_sched_attr +2032 drivers/gpu/drm/i915/i915_request.c

7e2e69ed4678a4 Maarten Lankhorst 2021-10-21  2031  
1f0e785a9cc09b Chris Wilson      2020-11-19 @2032  static int print_sched_attr(const struct i915_sched_attr *attr,
1f0e785a9cc09b Chris Wilson      2020-11-19  2033  			    char *buf, int x, int len)
1f0e785a9cc09b Chris Wilson      2020-11-19  2034  {
1f0e785a9cc09b Chris Wilson      2020-11-19  2035  	if (attr->priority == I915_PRIORITY_INVALID)
1f0e785a9cc09b Chris Wilson      2020-11-19  2036  		return x;
1f0e785a9cc09b Chris Wilson      2020-11-19  2037  
1f0e785a9cc09b Chris Wilson      2020-11-19  2038  	x += snprintf(buf + x, len - x,
1f0e785a9cc09b Chris Wilson      2020-11-19  2039  		      " prio=%d", attr->priority);
1f0e785a9cc09b Chris Wilson      2020-11-19  2040  
1f0e785a9cc09b Chris Wilson      2020-11-19  2041  	return x;
1f0e785a9cc09b Chris Wilson      2020-11-19  2042  }
1f0e785a9cc09b Chris Wilson      2020-11-19  2043  

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 67189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH linux-next] drm/i915/request: Remove unused variables
  2021-11-21 10:13 [PATCH linux-next] drm/i915/request: Remove unused variables cgel.zte
                   ` (2 preceding siblings ...)
  2021-11-22  6:48 ` kernel test robot
@ 2021-11-22  7:08 ` kernel test robot
  3 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-11-22  7:08 UTC (permalink / raw)
  To: cgel.zte, jani.nikula
  Cc: llvm, kbuild-all, airlied, intel-gfx, linux-kernel, dri-devel,
	yong yiran, rodrigo.vivi, Zeal Robot

[-- Attachment #1: Type: text/plain, Size: 2451 bytes --]

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20211118]

url:    https://github.com/0day-ci/linux/commits/cgel-zte-gmail-com/drm-i915-request-Remove-unused-variables/20211121-181441
base:    5191249f880367a4cd675825cd721a8d78f26a45
config: x86_64-randconfig-c007-20211121 (attached as .config)
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/117f34e1836e312bdea3b7c886d829e30f55a094
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review cgel-zte-gmail-com/drm-i915-request-Remove-unused-variables/20211121-181441
        git checkout 117f34e1836e312bdea3b7c886d829e30f55a094
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

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

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i915/i915_request.c:2032:12: error: unused function 'print_sched_attr' [-Werror,-Wunused-function]
   static int print_sched_attr(const struct i915_sched_attr *attr,
              ^
   1 error generated.


vim +/print_sched_attr +2032 drivers/gpu/drm/i915/i915_request.c

7e2e69ed4678a4 Maarten Lankhorst 2021-10-21  2031  
1f0e785a9cc09b Chris Wilson      2020-11-19 @2032  static int print_sched_attr(const struct i915_sched_attr *attr,
1f0e785a9cc09b Chris Wilson      2020-11-19  2033  			    char *buf, int x, int len)
1f0e785a9cc09b Chris Wilson      2020-11-19  2034  {
1f0e785a9cc09b Chris Wilson      2020-11-19  2035  	if (attr->priority == I915_PRIORITY_INVALID)
1f0e785a9cc09b Chris Wilson      2020-11-19  2036  		return x;
1f0e785a9cc09b Chris Wilson      2020-11-19  2037  
1f0e785a9cc09b Chris Wilson      2020-11-19  2038  	x += snprintf(buf + x, len - x,
1f0e785a9cc09b Chris Wilson      2020-11-19  2039  		      " prio=%d", attr->priority);
1f0e785a9cc09b Chris Wilson      2020-11-19  2040  
1f0e785a9cc09b Chris Wilson      2020-11-19  2041  	return x;
1f0e785a9cc09b Chris Wilson      2020-11-19  2042  }
1f0e785a9cc09b Chris Wilson      2020-11-19  2043  

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35289 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH linux-next] drm/i915/request: Remove unused variables
  2021-11-21 12:18 ` Christophe JAILLET
@ 2021-11-22  9:09   ` Jani Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2021-11-22  9:09 UTC (permalink / raw)
  To: Christophe JAILLET, cgel.zte
  Cc: joonas.lahtinen, rodrigo.vivi, airlied, daniel, intel-gfx,
	dri-devel, linux-kernel, yong yiran, Zeal Robot, Tvrtko Ursulin

On Sun, 21 Nov 2021, Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> Le 21/11/2021 à 11:13, cgel.zte@gmail.com a écrit :
>> From: yong yiran <yong.yiran@zte.com.cn>
>> 
>> The clang_analyzer complains as follows:
>> drivers/gpu/drm/i915/i915_request.c:2119:2 warning:
>> Value stored to 'x' is never read
>> 
>> Reported-by: Zeal Robot <zealci@zte.com.cn>
>> Signed-off-by: yong yiran <yong.yiran@zte.com.cn>

The sender's Signed-off-by is missing.

>> ---
>>   drivers/gpu/drm/i915/i915_request.c | 3 ---
>>   1 file changed, 3 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
>> index 820a1f38b271..5e4420f461e9 100644
>> --- a/drivers/gpu/drm/i915/i915_request.c
>> +++ b/drivers/gpu/drm/i915/i915_request.c
>> @@ -2047,7 +2047,6 @@ void i915_request_show(struct drm_printer *m,
>>   {
>>   	const char *name = rq->fence.ops->get_timeline_name((struct dma_fence *)&rq->fence);
>>   	char buf[80] = "";
>> -	int x = 0;
>>   
>>   	/*
>>   	 * The prefix is used to show the queue status, for which we use
>> @@ -2079,8 +2078,6 @@ void i915_request_show(struct drm_printer *m,
>>   	 *      from the lists
>>   	 */
>>   
>> -	x = print_sched_attr(&rq->sched.attr, buf, x, sizeof(buf));
>> -
>
> Seriously?

Basically I've started considering all of these patches as static
analyzer reports *only*. The "fixes" have often been completely wrong or
have missed the real issue and merely silenced the warning.

I really couldn't say anything about the "Zeal Robot" itself, but the
patches are giving it a bad reputation.


BR,
Jani.




>
> CJ
>
>
>>   	drm_printf(m, "%s%.*s%c %llx:%lld%s%s %s @ %dms: %s\n",
>>   		   prefix, indent, "                ",
>>   		   queue_status(rq),
>> 
>

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-22  9:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-21 10:13 [PATCH linux-next] drm/i915/request: Remove unused variables cgel.zte
2021-11-21 12:18 ` Christophe JAILLET
2021-11-21 12:18 ` Christophe JAILLET
2021-11-22  9:09   ` Jani Nikula
2021-11-22  6:48 ` kernel test robot
2021-11-22  7:08 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).