From patchwork Mon Aug 28 07:21:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9924331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 089EC60383 for ; Mon, 28 Aug 2017 07:22:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE87E28599 for ; Mon, 28 Aug 2017 07:22:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E313828660; Mon, 28 Aug 2017 07:22:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93E7428616 for ; Mon, 28 Aug 2017 07:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750865AbdH1HVo (ORCPT ); Mon, 28 Aug 2017 03:21:44 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33993 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbdH1HVn (ORCPT ); Mon, 28 Aug 2017 03:21:43 -0400 Received: by mail-pg0-f68.google.com with SMTP id 63so5751182pgc.1; Mon, 28 Aug 2017 00:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=KJRK2wmSxFqZX6yaFJrguQPbD7llS6vdE4UCx8KonRQ=; b=uSM4S8H0q/foTuFhErkS+qsDXcfZO0eSEYl7qxg6LyU7ALr9H387SdAnJqvJaOl0AJ dBkhhGjjhNotOEfNuI6UwuzZcDLVv1NwuawTpeOtp1b3604F1wbrtyX7pWGdUPfiucym 9VQ44gEG4Ul/hjWrxL5XJmUGoqjPxYIeL54GoNoznN2S7KUEmZvW1+SDJ12TD0lRqCtm 6j92t9gcjk6aWPqPjQIueu5ztsJg3eUEBPkBGMEqgLvB1QdWFFFGR6LADYUurqVZWxLD ng+T9mC90Vkp+UubQmyWC4kDlh1hAYjyrlnGTGLtGPJc8Bi7dAS5riUCxwp/ZJR0ofRv 8RZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KJRK2wmSxFqZX6yaFJrguQPbD7llS6vdE4UCx8KonRQ=; b=fDbu4guEVrsMduU58/1E9rJnYBbQGDd780CJpRWFKObQNf9IGYN7rAXVPVH8lfmVAJ nrmKapjHSPCVfO50urkFPJfp8t4Cu8d3Er+Dx9hfhcgKhR6KV6eSU/9zreA6gCcbLCCc HRCYi+YjW+rwN5Ypp4jXVutZXMb0h7luTNzswU6A/SfLR6W24FHLJPTPRC6nH1MfhNmw uis3rzBCNOEg6vF2lSlVOf62dW0cGkeKNMFVoFytvhSTlJHQBCoDc7Y6Xv8lmKWAFToX VOaOWXHaP3NBbt0FpEky3HOj6Z7Wj4h7HzrhX2VP2yVZd9UW9oB/WBXfOiV3DaD4vZa9 tnSQ== X-Gm-Message-State: AHYfb5jAeLIl8GwT5k2YagnkqXRAcZ88PfltobNJRMJGZmQD10H4tKCW V4Vw9TZ770qIYFZu X-Received: by 10.101.88.141 with SMTP id d13mr1998102pgu.65.1503904903106; Mon, 28 Aug 2017 00:21:43 -0700 (PDT) Received: from gmail.com ([117.196.112.54]) by smtp.gmail.com with ESMTPSA id r79sm8682550pfa.147.2017.08.28.00.21.39 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Aug 2017 00:21:42 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 28 Aug 2017 12:51:36 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, mchehab@kernel.org, ezequiel@vanguardiasur.com.ar, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] [media] usb: make i2c_client const Date: Mon, 28 Aug 2017 12:51:35 +0530 Message-Id: <1503904895-10871-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make these const as they are only used in a copy operation. Done using Coccinelle. @match disable optional_qualifier@ identifier s; @@ static struct i2c_client s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ position ref.p; identifier match.s,f,c; expression e; @@ ( e = s@p | e = s@p.f | c(...,s@p.f,...) | c(...,s@p,...) ) @bad depends on !good1@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct i2c_client s; Signed-off-by: Bhumika Goyal --- drivers/media/usb/au0828/au0828-i2c.c | 2 +- drivers/media/usb/em28xx/em28xx-i2c.c | 2 +- drivers/media/usb/stk1160/stk1160-i2c.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-i2c.c b/drivers/media/usb/au0828/au0828-i2c.c index 42b352b..348b384 100644 --- a/drivers/media/usb/au0828/au0828-i2c.c +++ b/drivers/media/usb/au0828/au0828-i2c.c @@ -342,7 +342,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap) .algo = &au0828_i2c_algo_template, }; -static struct i2c_client au0828_i2c_client_template = { +static const struct i2c_client au0828_i2c_client_template = { .name = "au0828 internal", }; diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index 60b195c..fa3fe4c 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -882,7 +882,7 @@ static u32 functionality(struct i2c_adapter *i2c_adap) .algo = &em28xx_algo, }; -static struct i2c_client em28xx_client_template = { +static const struct i2c_client em28xx_client_template = { .name = "em28xx internal", }; diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c index 3f2517b..7151e28 100644 --- a/drivers/media/usb/stk1160/stk1160-i2c.c +++ b/drivers/media/usb/stk1160/stk1160-i2c.c @@ -246,7 +246,7 @@ static u32 functionality(struct i2c_adapter *adap) .algo = &algo, }; -static struct i2c_client client_template = { +static const struct i2c_client client_template = { .name = "stk1160 internal", };