diff mbox

[1/2] drm/edid: Use ARRAY_SIZE in drm_add_modes_noedid

Message ID 1439200538-25233-1-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Aug. 10, 2015, 9:55 a.m. UTC
Spotted while reading code for random reasons.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thierry Reding Aug. 10, 2015, 11:57 a.m. UTC | #1
On Mon, Aug 10, 2015 at 11:55:37AM +0200, Daniel Vetter wrote:
> Spotted while reading code for random reasons.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 4a403eb90ded..4780b1924bef 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3810,7 +3810,7 @@ int drm_add_modes_noedid(struct drm_connector *connector,
>  	struct drm_display_mode *mode;
>  	struct drm_device *dev = connector->dev;
>  
> -	count = sizeof(drm_dmt_modes) / sizeof(struct drm_display_mode);
> +	count = ARRAY_SIZE(drm_dmt_modes);
>  	if (hdisplay < 0)
>  		hdisplay = 0;
>  	if (vdisplay < 0)


Reviewed-by: Thierry Reding <treding@nvidia.com>
Daniel Vetter Aug. 10, 2015, 12:08 p.m. UTC | #2
On Mon, Aug 10, 2015 at 01:57:21PM +0200, Thierry Reding wrote:
> On Mon, Aug 10, 2015 at 11:55:37AM +0200, Daniel Vetter wrote:
> > Spotted while reading code for random reasons.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/drm_edid.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 4a403eb90ded..4780b1924bef 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -3810,7 +3810,7 @@ int drm_add_modes_noedid(struct drm_connector *connector,
> >  	struct drm_display_mode *mode;
> >  	struct drm_device *dev = connector->dev;
> >  
> > -	count = sizeof(drm_dmt_modes) / sizeof(struct drm_display_mode);
> > +	count = ARRAY_SIZE(drm_dmt_modes);
> >  	if (hdisplay < 0)
> >  		hdisplay = 0;
> >  	if (vdisplay < 0)
> 
> 
> Reviewed-by: Thierry Reding <treding@nvidia.com>

Thanks for the review, applied to drm-misc.
-Danie
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 4a403eb90ded..4780b1924bef 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3810,7 +3810,7 @@  int drm_add_modes_noedid(struct drm_connector *connector,
 	struct drm_display_mode *mode;
 	struct drm_device *dev = connector->dev;
 
-	count = sizeof(drm_dmt_modes) / sizeof(struct drm_display_mode);
+	count = ARRAY_SIZE(drm_dmt_modes);
 	if (hdisplay < 0)
 		hdisplay = 0;
 	if (vdisplay < 0)