From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 02/12] drm/edid: Fix add_cea_modes() style issues Date: Wed, 14 Aug 2013 13:16:25 +0300 Message-ID: <20130814101625.GM7159@intel.com> References: <1376435848-14584-1-git-send-email-damien.lespiau@intel.com> <1376435848-14584-3-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1376435848-14584-3-git-send-email-damien.lespiau@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: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Aug 14, 2013 at 12:17:18AM +0100, Damien Lespiau wrote: > A few styles issues have crept in here, fix them before touching this > code again. > = > v2: constify arguments that can be (Ville Syrj=E4l=E4) > = > Signed-off-by: Damien Lespiau > --- > drivers/gpu/drm/drm_edid.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > = > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index e014785..9e9b6ed 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -2301,7 +2301,7 @@ add_detailed_modes(struct drm_connector *connector,= struct edid *edid, > /* > * Search EDID for CEA extension block. > */ > -static u8 *drm_find_cea_extension(struct edid *edid) > +static u8 *drm_find_cea_extension(const struct edid *edid) This guy still casts away the const internally. Not sure if something will complain about that. So maybe just drop this bit for now. A long time ago I posted a big contify everything in drm_edid.c patch, and it did in a way that didn't ad new warnings even w/ -Wcast-qual. Maybe I should resurrect it. > { > u8 *edid_ext =3D NULL; > int i; > @@ -2441,10 +2441,11 @@ add_alternate_cea_modes(struct drm_connector *con= nector, struct edid *edid) > } > = > static int > -do_cea_modes (struct drm_connector *connector, u8 *db, u8 len) > +do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) > { > struct drm_device *dev =3D connector->dev; > - u8 * mode, cea_mode; > + const u8 *mode; > + u8 cea_mode; > int modes =3D 0; > = > for (mode =3D db; mode < db + len; mode++) { > @@ -2499,10 +2500,10 @@ cea_db_offsets(const u8 *cea, int *start, int *en= d) > for ((i) =3D (start); (i) < (end) && (i) + cea_db_payload_len(&(cea)[(i= )]) < (end); (i) +=3D cea_db_payload_len(&(cea)[(i)]) + 1) > = > static int > -add_cea_modes(struct drm_connector *connector, struct edid *edid) > +add_cea_modes(struct drm_connector *connector, const struct edid *edid) > { > - u8 * cea =3D drm_find_cea_extension(edid); > - u8 * db, dbl; > + u8 *cea =3D drm_find_cea_extension(edid); > + u8 *db, dbl; cea and db could be const here. > int modes =3D 0; > = > if (cea && cea_revision(cea) >=3D 3) { > @@ -2516,7 +2517,7 @@ add_cea_modes(struct drm_connector *connector, stru= ct edid *edid) > dbl =3D cea_db_payload_len(db); > = > if (cea_db_tag(db) =3D=3D VIDEO_BLOCK) > - modes +=3D do_cea_modes (connector, db+1, dbl); > + modes +=3D do_cea_modes(connector, db + 1, dbl); > } > } > = > -- = > 1.8.3.1 > = > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Ville Syrj=E4l=E4 Intel OTC