From patchwork Thu Nov 22 10:22:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 1783451 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id BF65EDF24C for ; Thu, 22 Nov 2012 11:11:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B5B6AE64A3 for ; Thu, 22 Nov 2012 03:11:21 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by gabe.freedesktop.org (Postfix) with ESMTP id 551FAE63F0 for ; Thu, 22 Nov 2012 02:56:11 -0800 (PST) Received: from debian (p5DCF0728.dip0.t-ipconnect.de [93.207.7.40]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0McxrW-1TsbY722YE-00ILOX; Thu, 22 Nov 2012 11:51:01 +0100 Received: from sles11.fritz.box (sles11.fritz.box [192.168.178.22]) by debian (Postfix) with ESMTP id 14E5A3F35B; Thu, 22 Nov 2012 11:50:59 +0100 (CET) From: Egbert Eich To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 01/18] DRM/KMS/EDID: Mask out Segment Bits when calculating Offset. Date: Thu, 22 Nov 2012 05:22:51 -0500 Message-Id: <1353579788-30637-2-git-send-email-eich@suse.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1353579788-30637-1-git-send-email-eich@suse.com> References: <1353356598-10634-1-git-send-email-eich@suse.de> <1353579788-30637-1-git-send-email-eich@suse.com> X-Provags-ID: V02:K0:4vV+lkC+sgl6gEpESNwENJlz6rRYgoSIQrM2Xzs6k1Q 0T+VlxiW6Gr+o+s3ipfiXRx7Ohf4dHSTvHP5GGVprLvcmD/aKl zWrZd9MPCEKMq7hWFfiWKAOjHxdguaFtmcVeiR+I9+/7rZlYFc hljpkv1hxKS3SmTdXaKj1PwI5JhqoCp/Vq7fKRoMX9KKkQqnB2 0jj2MhlbQUk1JjweWbTktBWJUG2MqJIZxbE2Ozou9FaFvbixmg 2rcrW6bEXE72TWs8AA+hRX3WkoaanBlfDFdk5/mAKVqIzfgVEk QHGZkjojqWZEEzmOe2Nbkf5rzfXsElALhByplM+brF5N+IyDhz FIox5iAZHzCovUzE4BLc= Cc: Egbert Eich , tiwai@suse.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This patch is a bit cosmetic as the variable size will truncate the start address anyway but for readability it should be made explicite that the lowest bit in the EDID block number determines the I2C start address. Signed-off-by: Egbert Eich --- drivers/gpu/drm/drm_edid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index fadcd44..049fa52 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -258,7 +258,7 @@ static int drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf, int block, int len) { - unsigned char start = block * EDID_LENGTH; + unsigned char start = (block & 0x01) * EDID_LENGTH; unsigned char segment = block >> 1; unsigned char xfers = segment ? 3 : 2; int ret, retries = 5;