public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 02/12] drm/edid: Fix add_cea_modes() style issues
Date: Wed, 14 Aug 2013 13:16:25 +0300	[thread overview]
Message-ID: <20130814101625.GM7159@intel.com> (raw)
In-Reply-To: <1376435848-14584-3-git-send-email-damien.lespiau@intel.com>

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älä)
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  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 = NULL;
>  	int i;
> @@ -2441,10 +2441,11 @@ add_alternate_cea_modes(struct drm_connector *connector, 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 = connector->dev;
> -	u8 * mode, cea_mode;
> +	const u8 *mode;
> +	u8 cea_mode;
>  	int modes = 0;
>  
>  	for (mode = db; mode < db + len; mode++) {
> @@ -2499,10 +2500,10 @@ cea_db_offsets(const u8 *cea, int *start, int *end)
>  	for ((i) = (start); (i) < (end) && (i) + cea_db_payload_len(&(cea)[(i)]) < (end); (i) += 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 = drm_find_cea_extension(edid);
> -	u8 * db, dbl;
> +	u8 *cea = drm_find_cea_extension(edid);
> +	u8 *db, dbl;

cea and db could be const here.

>  	int modes = 0;
>  
>  	if (cea && cea_revision(cea) >= 3) {
> @@ -2516,7 +2517,7 @@ add_cea_modes(struct drm_connector *connector, struct edid *edid)
>  			dbl = cea_db_payload_len(db);
>  
>  			if (cea_db_tag(db) == VIDEO_BLOCK)
> -				modes += do_cea_modes (connector, db+1, dbl);
> +				modes += 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älä
Intel OTC

  reply	other threads:[~2013-08-14 10:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 23:17 HDMI 4k support v2 Damien Lespiau
2013-08-13 23:17 ` [PATCH 01/12] drm: Don't export drm_find_cea_extension() any more Damien Lespiau
2013-08-13 23:17 ` [PATCH 02/12] drm/edid: Fix add_cea_modes() style issues Damien Lespiau
2013-08-14 10:16   ` Ville Syrjälä [this message]
2013-08-13 23:17 ` [PATCH 03/12] drm/edid: Parse the HDMI CEA block and look for 4k modes Damien Lespiau
2013-08-14  9:32   ` Simon Farnsworth
2013-08-13 23:17 ` [PATCH 04/12] drm: Add support for alternate clocks of " Damien Lespiau
2013-08-14  9:33   ` Simon Farnsworth
2013-08-14 10:18   ` [Intel-gfx] " Ville Syrjälä
2013-08-13 23:17 ` [PATCH 05/12] video/hdmi: Don't let the user of this API create invalid infoframes Damien Lespiau
2013-08-13 23:17 ` [PATCH 06/12] video/hdmi: Derive the bar data valid bit from the bar data fields Damien Lespiau
2013-08-14 10:41   ` Ville Syrjälä
2013-08-13 23:17 ` [PATCH 07/12] video/hdmi: Introduce helpers for the HDMI vendor specific infoframe Damien Lespiau
2013-08-14 10:50   ` Ville Syrjälä
2013-08-14 11:24   ` [Intel-gfx] " Ville Syrjälä
     [not found] ` <1376435848-14584-1-git-send-email-damien.lespiau-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-08-13 23:17   ` [PATCH 08/12] gpu: host1x: Port the HDMI vendor infoframe code the common helpers Damien Lespiau
     [not found]     ` <1376435848-14584-9-git-send-email-damien.lespiau-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-08-14 11:20       ` Ville Syrjälä
2013-08-13 23:17 ` [PATCH 09/12] drm/edid: Move HDMI_IDENTIFIER to hdmi.h Damien Lespiau
2013-08-13 23:17 ` [PATCH 10/12] video/hdmi: Hook the HDMI vendor infoframe with the generic _pack() Damien Lespiau
2013-08-14 11:14   ` [Intel-gfx] " Ville Syrjälä
2013-08-13 23:17 ` [PATCH 11/12] drm: Add a helper to forge HDMI vendor infoframes Damien Lespiau
2013-08-14  9:42   ` Simon Farnsworth
2013-08-13 23:17 ` [PATCH 12/12] drm/i915/hdmi: Write HDMI vendor specific infoframes Damien Lespiau
2013-08-14  9:43 ` HDMI 4k support v2 Simon Farnsworth
2013-08-14 11:32 ` Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2013-08-14 17:19 HDMI 4k support v3 Damien Lespiau
2013-08-14 17:19 ` [PATCH 02/12] drm/edid: Fix add_cea_modes() style issues Damien Lespiau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130814101625.GM7159@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=damien.lespiau@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox