diff mbox

[1/2] drm/i915/dp: use sizeof for memset instead of magic value

Message ID 1380888528-4507-1-git-send-email-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Oct. 4, 2013, 12:08 p.m. UTC
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter Oct. 4, 2013, 12:44 p.m. UTC | #1
On Fri, Oct 04, 2013 at 03:08:47PM +0300, Jani Nikula wrote:
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 60118da..0ed7717 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2406,7 +2406,7 @@ static bool
>  intel_dp_reset_link_train(struct intel_dp *intel_dp, uint32_t *DP,
>  			uint8_t dp_train_pat)
>  {
> -	memset(intel_dp->train_set, 0, 4);
> +	memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));

Oh, missed that one in my big review of alloc/memset. Patch merged,
thanks.
-Daniel

>  	intel_dp_set_signal_levels(intel_dp, DP);
>  	return intel_dp_set_link_train(intel_dp, DP, dp_train_pat);
>  }
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula Oct. 4, 2013, 3:28 p.m. UTC | #2
On Fri, 04 Oct 2013, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Oct 04, 2013 at 03:08:47PM +0300, Jani Nikula wrote:
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_dp.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>> index 60118da..0ed7717 100644
>> --- a/drivers/gpu/drm/i915/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>> @@ -2406,7 +2406,7 @@ static bool
>>  intel_dp_reset_link_train(struct intel_dp *intel_dp, uint32_t *DP,
>>  			uint8_t dp_train_pat)
>>  {
>> -	memset(intel_dp->train_set, 0, 4);
>> +	memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
>
> Oh, missed that one in my big review of alloc/memset.

You didn't, I sneaked it in afterwards...

Jani.

> -Daniel
>
>>  	intel_dp_set_signal_levels(intel_dp, DP);
>>  	return intel_dp_set_link_train(intel_dp, DP, dp_train_pat);
>>  }
>> -- 
>> 1.7.9.5
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula Oct. 9, 2013, 9:54 a.m. UTC | #3
On Fri, 04 Oct 2013, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Oct 04, 2013 at 03:08:47PM +0300, Jani Nikula wrote:
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_dp.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>> index 60118da..0ed7717 100644
>> --- a/drivers/gpu/drm/i915/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>> @@ -2406,7 +2406,7 @@ static bool
>>  intel_dp_reset_link_train(struct intel_dp *intel_dp, uint32_t *DP,
>>  			uint8_t dp_train_pat)
>>  {
>> -	memset(intel_dp->train_set, 0, 4);
>> +	memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
>
> Oh, missed that one in my big review of alloc/memset. Patch merged,
> thanks.

How about patch 2/2?

Jani.
Daniel Vetter Oct. 9, 2013, 10:47 a.m. UTC | #4
On Wed, Oct 09, 2013 at 12:54:48PM +0300, Jani Nikula wrote:
> On Fri, 04 Oct 2013, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Fri, Oct 04, 2013 at 03:08:47PM +0300, Jani Nikula wrote:
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >> ---
> >>  drivers/gpu/drm/i915/intel_dp.c |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> >> index 60118da..0ed7717 100644
> >> --- a/drivers/gpu/drm/i915/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/intel_dp.c
> >> @@ -2406,7 +2406,7 @@ static bool
> >>  intel_dp_reset_link_train(struct intel_dp *intel_dp, uint32_t *DP,
> >>  			uint8_t dp_train_pat)
> >>  {
> >> -	memset(intel_dp->train_set, 0, 4);
> >> +	memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
> >
> > Oh, missed that one in my big review of alloc/memset. Patch merged,
> > thanks.
> 
> How about patch 2/2?

Oh, I've missed Ville's r-b. Now merged to dinq.

Thanks for poking, Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 60118da..0ed7717 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2406,7 +2406,7 @@  static bool
 intel_dp_reset_link_train(struct intel_dp *intel_dp, uint32_t *DP,
 			uint8_t dp_train_pat)
 {
-	memset(intel_dp->train_set, 0, 4);
+	memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
 	intel_dp_set_signal_levels(intel_dp, DP);
 	return intel_dp_set_link_train(intel_dp, DP, dp_train_pat);
 }