From: Thierry Reding Subject: Re: [PATCH v3 1/9] drm: Make drm_num_cea_modes unsigned Date: Mon, 14 Jan 2013 16:06:13 +0100 Message-ID: <20130114150613.GB24129@avionic-0098.adnet.avionic-design.de> References: <1358173828-31674-1-git-send-email-thierry.reding@avionic-design.de> <1358173828-31674-2-git-send-email-thierry.reding@avionic-design.de> <20130114144239.GF3867@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1885410934==" Return-path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by gabe.freedesktop.org (Postfix) with ESMTP id F32A0E5BFA for ; Mon, 14 Jan 2013 07:06:26 -0800 (PST) In-Reply-To: <20130114144239.GF3867@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Ville =?utf-8?B?U3lyasOkbMOk?= Cc: Paulo Zanoni , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1885410934== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XF85m9dhOBO43t/C" Content-Disposition: inline --XF85m9dhOBO43t/C Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 14, 2013 at 04:42:39PM +0200, Ville Syrj=C3=A4l=C3=A4 wrote: > On Mon, Jan 14, 2013 at 03:30:20PM +0100, Thierry Reding wrote: > > Since the variable's value is the size of an array, we can assume that > > it will never be negative. > >=20 > > Signed-off-by: Thierry Reding > > --- > > drivers/gpu/drm/drm_edid_modes.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/drivers/gpu/drm/drm_edid_modes.h b/drivers/gpu/drm/drm_edi= d_modes.h > > index 5dbf7d2..d65d863 100644 > > --- a/drivers/gpu/drm/drm_edid_modes.h > > +++ b/drivers/gpu/drm/drm_edid_modes.h > > @@ -771,4 +771,4 @@ static const struct drm_display_mode edid_cea_modes= [] =3D { > > 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, > > DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, > > }; > > -static const int drm_num_cea_modes =3D ARRAY_SIZE(edid_cea_modes); > > +static const unsigned int drm_num_cea_modes =3D ARRAY_SIZE(edid_cea_mo= des); >=20 > Why do we even have these num_foo things? I think it would be clearer to > use ARRAY_SIZE(foo) directly where appropriate. Actually I was thinking about maybe writing a patch to move the table out of the header and into drm_edid.c (or drm_cea.c?) to make it less easy to create duplicates of the table. In that case, using the ARRAY_SIZE macro directly wouldn't be an option. Thierry --XF85m9dhOBO43t/C Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJQ9B7lAAoJEN0jrNd/PrOhH3MQAI77rAFgeA14o76fC6UkyTyu eA8w7xVW4C9RLRMcI+ZsvVkI/szyteKxW/FB7S1KnDUWB2Ag2CDuRN0vpGjBuYCi GrxJAM2QZRGQNnHOE7B7xNblMWKKPX9j8YZHhcTNri/rtZCNmCj/IZkXzrVmtOMU Y1l7Rmk1ByUEffXKKAkWspgsmG2OMcowJf5kQqNCvvfyOY1iTa86GLD/Sv9RbhFW Le79ds00jD7J7TZQJjrpuBfFz7NEq3k8dw7bBiOzsifELGkYmUxAMEAVfMzyEg0m xslLBcbq7f9M8oFrmy1QCl/ieq4k3osNQpl032i59bup1IPDhPPzOzy6BtxW9qaF kCvel1ZxMmElc55L+TQa0VFLVhMBY82xZNnk1hx2E5NuO+O0enW6I4AWGpINL5g7 DK9TzkKo1WkBCuuX9fJ9SrpI59HToT1nMTla95iG9bxu57wijJD4BA0VGRfXlMZn M3p5y2HGUxr6RBVCGt1m/CZ7ypHytZaUZbVVJxqxlhnHVVnuaveuCzAKmGLROynF cKg0TTlFmdtps3L0ZWr1D1vmqHnDUdQy68WSAeFw4VYXvVneAAzTfUUE+3QlbnUm YlemQIAig6iHqyY18bSI8W8uTtj+2u4ERHhCXnfFI2L4d2ByKXv+jo2DtSaFU6z3 E45/2/rAB3ghyp+VC21C =hwhH -----END PGP SIGNATURE----- --XF85m9dhOBO43t/C-- --===============1885410934== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1885410934==--