[PATCH] drm/radeon/kms: Shorten buffers in radeon_ddc_probe

Jean Delvare khali at linux-fr.org
Tue Jul 12 06:38:15 PDT 2011


On Mon, 27 Jun 2011 22:44:42 +0200, Jean Delvare wrote:
> No need for 2-byte buffers, we only send one byte and receive one
> byte.
> 
> Signed-off-by: Jean Delvare <khali at linux-fr.org>
> Cc: David Airlie <airlied at linux.ie>
> Cc: Alex Deucher <alexdeucher at gmail.com>
> ---
>  drivers/gpu/drm/radeon/radeon_i2c.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> --- linux-3.0-rc4.orig/drivers/gpu/drm/radeon/radeon_i2c.c	2011-06-27 15:39:33.000000000 +0200
> +++ linux-3.0-rc4/drivers/gpu/drm/radeon/radeon_i2c.c	2011-06-27 15:40:35.000000000 +0200
> @@ -34,21 +34,20 @@
>   */
>  bool radeon_ddc_probe(struct radeon_connector *radeon_connector)
>  {
> -	u8 out_buf[] = { 0x0, 0x0};
> -	u8 buf[2];
> +	u8 out = 0x0, in;
>  	int ret;
>  	struct i2c_msg msgs[] = {
>  		{
>  			.addr = 0x50,
>  			.flags = 0,
>  			.len = 1,
> -			.buf = out_buf,
> +			.buf = &out,
>  		},
>  		{
>  			.addr = 0x50,
>  			.flags = I2C_M_RD,
>  			.len = 1,
> -			.buf = buf,
> +			.buf = &in,
>  		}
>  	};

Please disregard this patch, it is superseded by a more important
workaround by Thomas Reim.

-- 
Jean Delvare


More information about the dri-devel mailing list