linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] drm/i915/display: Delete redundant post_mask assignment
@ 2021-12-08  7:46 cgel.zte
  2021-12-08 13:04 ` Ville Syrjälä
  0 siblings, 1 reply; 3+ messages in thread
From: cgel.zte @ 2021-12-08  7:46 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Joonas Lahtinen, Rodrigo Vivi, David Airlie, Daniel Vetter,
	Stephen Rothwell, intel-gfx, dri-devel, linux-kernel,
	luo penghao, Zeal Robot

From: luo penghao <luo.penghao@zte.com.cn>

This value will be overwritten by the following if statement, even
if the if is not executed, the value will not be used

The clang_analyzer complains as follows:

Value stored to 'port_mask' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index bd18432..3aad0c3 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2011,7 +2011,6 @@ void intel_ddi_sanitize_encoder_pll_mapping(struct intel_encoder *encoder)
 			return;
 	}
 
-	port_mask = BIT(encoder->port);
 	ddi_clk_needed = encoder->base.crtc;
 
 	if (encoder->type == INTEL_OUTPUT_DSI) {
-- 
2.15.2



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

* Re: [PATCH linux-next] drm/i915/display: Delete redundant post_mask assignment
  2021-12-08  7:46 [PATCH linux-next] drm/i915/display: Delete redundant post_mask assignment cgel.zte
@ 2021-12-08 13:04 ` Ville Syrjälä
  2021-12-08 13:20   ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2021-12-08 13:04 UTC (permalink / raw)
  To: cgel.zte
  Cc: Jani Nikula, Stephen Rothwell, David Airlie, intel-gfx,
	linux-kernel, dri-devel, luo penghao, Rodrigo Vivi, Zeal Robot

On Wed, Dec 08, 2021 at 07:46:19AM +0000, cgel.zte@gmail.com wrote:
> From: luo penghao <luo.penghao@zte.com.cn>
> 
> This value will be overwritten by the following if statement, even
> if the if is not executed, the value will not be used
> 
> The clang_analyzer complains as follows:
> 
> Value stored to 'port_mask' is never read
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index bd18432..3aad0c3 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -2011,7 +2011,6 @@ void intel_ddi_sanitize_encoder_pll_mapping(struct intel_encoder *encoder)
>  			return;
>  	}
>  
> -	port_mask = BIT(encoder->port);
>  	ddi_clk_needed = encoder->base.crtc;
>  
>  	if (encoder->type == INTEL_OUTPUT_DSI) {

'port_mask' declaration could now be moved into this block.

> -- 
> 2.15.2
> 

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH linux-next] drm/i915/display: Delete redundant post_mask assignment
  2021-12-08 13:04 ` Ville Syrjälä
@ 2021-12-08 13:20   ` Jani Nikula
  0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2021-12-08 13:20 UTC (permalink / raw)
  To: Ville Syrjälä, cgel.zte
  Cc: Stephen Rothwell, David Airlie, intel-gfx, linux-kernel,
	dri-devel, luo penghao, Rodrigo Vivi, Zeal Robot

On Wed, 08 Dec 2021, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Wed, Dec 08, 2021 at 07:46:19AM +0000, cgel.zte@gmail.com wrote:
>> From: luo penghao <luo.penghao@zte.com.cn>
>> 
>> This value will be overwritten by the following if statement, even
>> if the if is not executed, the value will not be used
>> 
>> The clang_analyzer complains as follows:
>> 
>> Value stored to 'port_mask' is never read
>> 
>> Reported-by: Zeal Robot <zealci@zte.com.cn>
>> Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
>> ---
>>  drivers/gpu/drm/i915/display/intel_ddi.c | 1 -
>>  1 file changed, 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
>> index bd18432..3aad0c3 100644
>> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
>> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
>> @@ -2011,7 +2011,6 @@ void intel_ddi_sanitize_encoder_pll_mapping(struct intel_encoder *encoder)
>>  			return;
>>  	}
>>  
>> -	port_mask = BIT(encoder->port);
>>  	ddi_clk_needed = encoder->base.crtc;
>>  
>>  	if (encoder->type == INTEL_OUTPUT_DSI) {
>
> 'port_mask' declaration could now be moved into this block.

I've basically given up on patches from cgel.zte@gmail.com,
luo.penghao@zte.com.cn, zealci@zte.com.cn, etc. The patches are the
simplest possible changes to silence static analyzer warnings, with no
further analysis of the issues, and no follow-up on questions.

Until that changes, I think we're better off just regarding them static
as analyzer reports.


BR,
Jani.


>
>> -- 
>> 2.15.2
>> 

-- 
Jani Nikula, Intel Open Source Graphics Center

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

end of thread, other threads:[~2021-12-08 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08  7:46 [PATCH linux-next] drm/i915/display: Delete redundant post_mask assignment cgel.zte
2021-12-08 13:04 ` Ville Syrjälä
2021-12-08 13:20   ` Jani Nikula

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).