[Intel-gfx] [PATCH] drm/i915: Fix the VBT child device parsing for BSW

Damien Lespiau damien.lespiau at intel.com
Thu Apr 9 01:49:25 PDT 2015


On Wed, Mar 25, 2015 at 06:45:58PM +0200, ville.syrjala at linux.intel.com wrote:
> +static union child_device_config *
> +child_device_ptr(struct bdb_general_definitions *p_defs, int i)
> +{
> +	return (void *) &p_defs->devices[i * p_defs->child_dev_size];
> +}

Actually this looks wrong. We're doing:

  p_defs->devices + sizeof(union child_device_config) * i * child_dev_size

instead of:

  (u8)p_defs->devices + i * child_dev_size

?

I wondered about the (void *) cast precedence over [], because gcc
treats void * pointer arithmetic with a size of 1, but [] will be done
first apparently.

-- 
Damien


More information about the Intel-gfx mailing list