From patchwork Wed Oct 10 11:33:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 1572991 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2C22040135 for ; Wed, 10 Oct 2012 11:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751260Ab2JJLdQ (ORCPT ); Wed, 10 Oct 2012 07:33:16 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:60563 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144Ab2JJLdP (ORCPT ); Wed, 10 Oct 2012 07:33:15 -0400 Received: by mail-ie0-f174.google.com with SMTP id k13so611884iea.19 for ; Wed, 10 Oct 2012 04:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HO+MR+KZEDiypkOfSte8F+5RywD/8ajhSYMnp/fahm8=; b=i7Ht1t0dqSFjLDFudrOD2EmXJBzd7D77v1za9jUA8u91YftqQRoGExZMZmANPVXiK+ WJ4/m+rYy+ItxJPeMozpraeTtqz0DZ2DdXuF4171H0FszM37CeV2OUU6h11i9LpbfTDS OioHZBaz8AAEGjRVNqcTGc4iYOHHJcJYg0ASxPlS0A87g7Dhh4UNu9TUc4hDyXsV/r+X z8Zq0NrV9ry4JBXqdgMHR1z7r+rdimmNyZuAfawe6AdJNnlkEvJvZhFmmhU/lN7X4IEA zqUCEMFnVu0ZGEmtu7tUR/1515V6ZKty9HvWWV2jtcIjsqH+CFEIsEwPE22TU++SHDVx KAqQ== MIME-Version: 1.0 Received: by 10.43.104.200 with SMTP id dn8mr18108909icc.43.1349868794285; Wed, 10 Oct 2012 04:33:14 -0700 (PDT) Received: by 10.42.228.10 with HTTP; Wed, 10 Oct 2012 04:33:14 -0700 (PDT) In-Reply-To: <20121010110521.3981a23f@endymion.delvare> References: <1349782668-9098-1-git-send-email-shubhrajyoti@ti.com> <20121010110521.3981a23f@endymion.delvare> Date: Wed, 10 Oct 2012 17:03:14 +0530 Message-ID: Subject: Re: [PATCH] matroxfb: Convert struct i2c_msg initialization to C99 format From: Shubhrajyoti Datta To: Jean Delvare Cc: Shubhrajyoti D , linux-fbdev@vger.kernel.org, FlorianSchandinat@gmx.de, linux-i2c@vger.kernel.org, dmitry.torokhov@gmail.com Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org On Wed, Oct 10, 2012 at 2:35 PM, Jean Delvare wrote: > On Tue, 9 Oct 2012 17:07:48 +0530, Shubhrajyoti D wrote: Thanks updated patch below. From 99073779197f5759a76e65c3f4ef2ad4e9c88eaf Mon Sep 17 00:00:00 2001 From: Shubhrajyoti D Date: Mon, 17 Sep 2012 21:19:32 +0530 Subject: [PATCHv2] matroxfb: Convert struct i2c_msg initialization to C99 format Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Thanks to Julia Lawall for automating the conversion Acked-by: Jean Delvare Signed-off-by: Shubhrajyoti D --- drivers/video/matrox/matroxfb_maven.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c index 217678e..f66c34c 100644 --- a/drivers/video/matrox/matroxfb_maven.c +++ b/drivers/video/matrox/matroxfb_maven.c @@ -137,8 +137,20 @@ static int* get_ctrl_ptr(struct maven_data* md, int idx) { static int maven_get_reg(struct i2c_client* c, char reg) { char dst; - struct i2c_msg msgs[] = {{ c->addr, I2C_M_REV_DIR_ADDR, sizeof(reg), ® }, - { c->addr, I2C_M_RD | I2C_M_NOSTART, sizeof(dst), &dst }}; + struct i2c_msg msgs[] = { + { + .addr = c->addr, + .flags = I2C_M_REV_DIR_ADDR, + .len = sizeof(reg), + .buf = ® + }, + { + .addr = c->addr, + .flags = I2C_M_RD | I2C_M_NOSTART, + .len = sizeof(dst), + .buf = &dst + } + }; s32 err; err = i2c_transfer(c->adapter, msgs, 2);