All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/sdvo: Fix harmless build warning
@ 2010-10-29 10:31 Dongdong Deng
  2010-10-30 11:30 ` Peter Stuge
  0 siblings, 1 reply; 3+ messages in thread
From: Dongdong Deng @ 2010-10-29 10:31 UTC (permalink / raw)
  To: airlied; +Cc: dongdong.deng, dri-devel

Removing the following harmless build warning to let compiler happy.

drivers/gpu/drm/i915/intel_sdvo.c: In function 'intel_sdvo_mode_set':
drivers/gpu/drm/i915/intel_sdvo.c:1097: warning: 'rate' may be used
uninitialized in this function

Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
CC: David Airlie <airlied@linux.ie>
CC: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/i915/intel_sdvo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index ee73e42..6899f90 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1170,7 +1170,8 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
 	switch (sdvo_pixel_multiply) {
 	case 1: rate = SDVO_CLOCK_RATE_MULT_1X; break;
 	case 2: rate = SDVO_CLOCK_RATE_MULT_2X; break;
-	case 4: rate = SDVO_CLOCK_RATE_MULT_4X; break;
+	case 4:
+	default: rate = SDVO_CLOCK_RATE_MULT_4X;
 	}
 	if (!intel_sdvo_set_clock_rate_mult(intel_sdvo, rate))
 		return;
-- 
1.6.0.4

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

* Re: [PATCH] drm/i915/sdvo: Fix harmless build warning
  2010-10-29 10:31 [PATCH] drm/i915/sdvo: Fix harmless build warning Dongdong Deng
@ 2010-10-30 11:30 ` Peter Stuge
  2010-11-01  2:39   ` DDD
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stuge @ 2010-10-30 11:30 UTC (permalink / raw)
  To: Dongdong Deng; +Cc: dri-devel

Dongdong Deng wrote:
> Removing the following harmless build warning to let compiler happy.

> @@ -1170,7 +1170,8 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
>  	switch (sdvo_pixel_multiply) {
>  	case 1: rate = SDVO_CLOCK_RATE_MULT_1X; break;
>  	case 2: rate = SDVO_CLOCK_RATE_MULT_2X; break;
> -	case 4: rate = SDVO_CLOCK_RATE_MULT_4X; break;
> +	case 4:
> +	default: rate = SDVO_CLOCK_RATE_MULT_4X;
>  	}
>  	if (!intel_sdvo_set_clock_rate_mult(intel_sdvo, rate))
>  		return;

Even if the default case can not trigger, is 4x a good default multiplier?

Also, shouldn't there be a break; also in the default: case?


//Peter

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

* Re: [PATCH] drm/i915/sdvo: Fix harmless build warning
  2010-10-30 11:30 ` Peter Stuge
@ 2010-11-01  2:39   ` DDD
  0 siblings, 0 replies; 3+ messages in thread
From: DDD @ 2010-11-01  2:39 UTC (permalink / raw)
  To: peter; +Cc: dri-devel

Peter Stuge wrote:
> Dongdong Deng wrote:
>> Removing the following harmless build warning to let compiler happy.
> 
>> @@ -1170,7 +1170,8 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
>>  	switch (sdvo_pixel_multiply) {
>>  	case 1: rate = SDVO_CLOCK_RATE_MULT_1X; break;
>>  	case 2: rate = SDVO_CLOCK_RATE_MULT_2X; break;
>> -	case 4: rate = SDVO_CLOCK_RATE_MULT_4X; break;
>> +	case 4:
>> +	default: rate = SDVO_CLOCK_RATE_MULT_4X;
>>  	}
>>  	if (!intel_sdvo_set_clock_rate_mult(intel_sdvo, rate))
>>  		return;
> 
> Even if the default case can not trigger, is 4x a good default multiplier?
> 
> Also, shouldn't there be a break; also in the default: case?

Hello Peter,

In the last maintree, the warning have gone with following changing. :-)

     switch (pixel_multiplier) {
     default:
     case 1: rate = SDVO_CLOCK_RATE_MULT_1X; break;
     case 2: rate = SDVO_CLOCK_RATE_MULT_2X; break;
     case 4: rate = SDVO_CLOCK_RATE_MULT_4X; break;
     }


Thanks,
Dongdong

> 
> 
> //Peter
> 

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

end of thread, other threads:[~2010-11-01  2:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-29 10:31 [PATCH] drm/i915/sdvo: Fix harmless build warning Dongdong Deng
2010-10-30 11:30 ` Peter Stuge
2010-11-01  2:39   ` DDD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.