From patchwork Thu Oct 12 09:41:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 10001379 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 4A7456028A for ; Thu, 12 Oct 2017 09:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D46428CD5 for ; Thu, 12 Oct 2017 09:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31FA128CE2; Thu, 12 Oct 2017 09:41:25 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 95DCA28CD5 for ; Thu, 12 Oct 2017 09:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755671AbdJLJlX (ORCPT ); Thu, 12 Oct 2017 05:41:23 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35701 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755110AbdJLJlW (ORCPT ); Thu, 12 Oct 2017 05:41:22 -0400 Received: by mail-wm0-f65.google.com with SMTP id b189so3623805wmd.2; Thu, 12 Oct 2017 02:41:22 -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=INuklo1xIwdLRsFC3HmHr420BIvQrT/0H9fwQtW7HUs=; b=Sv5EFZz+6swPNWsY0Dxj1uU+fPKPkBxT1iFsBEMJxQsfglhhye8WmfVH9N2SzYFylz 4fHWZWye20QNjVmryNsgnJtIvnpI9h6R2fRaYBXAUVeZ+sPJgkv8nNEWfOmNH3mjPxi/ wPkkGFun/+fAhCfnxxQit861kWsQx0xFbnLOIhfU1OuPkAAwrzNQaHxPpIqcOl54Shfd Ezu+TcOlEjTzeidhK0IhEiAplLy1uxoSMCJoxgpAXnC+kE82qTGFZqg/YvXwevmRgyb+ 43XGnNOmu4IOORCAxkJO8R6Ynu2kWxVAGYuEbXCOsuKsa+eWaUpDpZgvFX+Iem40oNdv 9WbQ== 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=INuklo1xIwdLRsFC3HmHr420BIvQrT/0H9fwQtW7HUs=; b=JArTjDQdqiWdjwUH78zvScjSlVVzzRmM62KrBNdyRkfzK57M+9tWJEqMJBm0Ekvu2W HydzmKel34eRryaBccEcpKPWUlmGz9VDVd7EHJnUc1F3J2KXw+ybBB/FCgzSd5ClzwqU z5nCR7fP6bz7vtUHScTSTG41hopjqlmy2LgAOrDcerBCqLMVd0ggwV3xn+WAoHJHEcye yKwSjf6vcWcOQk0LV4WBftSWfKnV0zZOQuPlNXs9LWKyo9QdAHPp8kJyCl8qY7ZDf8CS 84kqHxOG7DOvFROGoe0IpSV+8ys0MkEGn7MERSlcaQyy+foix6ZyB1igtpHHIFFdQ9oY Uoxw== X-Gm-Message-State: AMCzsaW2aGU1AQaTKoSq5mrLQ2dH1389hmwSdIvcEIDVxMkHmrvCNDfu Uy27UnmbKjXUpytFHWeacoE= X-Google-Smtp-Source: AOwi7QBqhDOhESHGbn+dQXCUe5UhxpaFG9lQeMS52MGdFZ4i/FKI3reihSrqD2+uBdt6qVFriR3JIQ== X-Received: by 10.223.185.41 with SMTP id k38mr1684618wrf.257.1507801281394; Thu, 12 Oct 2017 02:41:21 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id w14sm9840239wmf.13.2017.10.12.02.41.19 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 12 Oct 2017 02:41:20 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Thu, 12 Oct 2017 11:41:19 +0200 From: Bhumika Goyal To: julia.lawall@lip6.fr, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] iio: make config_item_type const Date: Thu, 12 Oct 2017 11:41:16 +0200 Message-Id: <1507801276-1716-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a followup patch for: https://lkml.org/lkml/2017/10/11/375 https://patchwork.kernel.org/patch/9999649/ https://lkml.org/lkml/2017/10/11/469 and https://lkml.org/lkml/2017/10/11/661 Make the config_item_type structures const as they are either passed to the functions having the argument as const (link 2,3,4) or they are stored in the const "ci_type" field of a config_item structure (link 1). Done using Coccinelle. Signed-off-by: Bhumika Goyal --- drivers/iio/dummy/iio_simple_dummy.c | 2 +- drivers/iio/industrialio-configfs.c | 2 +- drivers/iio/industrialio-sw-device.c | 6 +++--- drivers/iio/industrialio-sw-trigger.c | 6 +++--- drivers/iio/trigger/iio-trig-hrtimer.c | 2 +- drivers/iio/trigger/iio-trig-loop.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/iio/dummy/iio_simple_dummy.c b/drivers/iio/dummy/iio_simple_dummy.c index a45d01e..6205247 100644 --- a/drivers/iio/dummy/iio_simple_dummy.c +++ b/drivers/iio/dummy/iio_simple_dummy.c @@ -26,7 +26,7 @@ #include #include "iio_simple_dummy.h" -static struct config_item_type iio_dummy_type = { +static const struct config_item_type iio_dummy_type = { .ct_owner = THIS_MODULE, }; diff --git a/drivers/iio/industrialio-configfs.c b/drivers/iio/industrialio-configfs.c index 45ce2bc..5a0aae1 100644 --- a/drivers/iio/industrialio-configfs.c +++ b/drivers/iio/industrialio-configfs.c @@ -17,7 +17,7 @@ #include #include -static struct config_item_type iio_root_group_type = { +static const struct config_item_type iio_root_group_type = { .ct_owner = THIS_MODULE, }; diff --git a/drivers/iio/industrialio-sw-device.c b/drivers/iio/industrialio-sw-device.c index 81b49cf..90df97c 100644 --- a/drivers/iio/industrialio-sw-device.c +++ b/drivers/iio/industrialio-sw-device.c @@ -19,9 +19,9 @@ #include static struct config_group *iio_devices_group; -static struct config_item_type iio_device_type_group_type; +static const struct config_item_type iio_device_type_group_type; -static struct config_item_type iio_devices_group_type = { +static const struct config_item_type iio_devices_group_type = { .ct_owner = THIS_MODULE, }; @@ -156,7 +156,7 @@ static void device_drop_group(struct config_group *group, .drop_item = &device_drop_group, }; -static struct config_item_type iio_device_type_group_type = { +static const struct config_item_type iio_device_type_group_type = { .ct_group_ops = &device_ops, .ct_owner = THIS_MODULE, }; diff --git a/drivers/iio/industrialio-sw-trigger.c b/drivers/iio/industrialio-sw-trigger.c index 8d24fb1..bc6b7fb 100644 --- a/drivers/iio/industrialio-sw-trigger.c +++ b/drivers/iio/industrialio-sw-trigger.c @@ -19,9 +19,9 @@ #include static struct config_group *iio_triggers_group; -static struct config_item_type iio_trigger_type_group_type; +static const struct config_item_type iio_trigger_type_group_type; -static struct config_item_type iio_triggers_group_type = { +static const struct config_item_type iio_triggers_group_type = { .ct_owner = THIS_MODULE, }; @@ -156,7 +156,7 @@ static void trigger_drop_group(struct config_group *group, .drop_item = &trigger_drop_group, }; -static struct config_item_type iio_trigger_type_group_type = { +static const struct config_item_type iio_trigger_type_group_type = { .ct_group_ops = &trigger_ops, .ct_owner = THIS_MODULE, }; diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c index 3ee9216..7accd01 100644 --- a/drivers/iio/trigger/iio-trig-hrtimer.c +++ b/drivers/iio/trigger/iio-trig-hrtimer.c @@ -30,7 +30,7 @@ struct iio_hrtimer_info { ktime_t period; }; -static struct config_item_type iio_hrtimer_type = { +static const struct config_item_type iio_hrtimer_type = { .ct_owner = THIS_MODULE, }; diff --git a/drivers/iio/trigger/iio-trig-loop.c b/drivers/iio/trigger/iio-trig-loop.c index b4b02db..94a90e0 100644 --- a/drivers/iio/trigger/iio-trig-loop.c +++ b/drivers/iio/trigger/iio-trig-loop.c @@ -36,7 +36,7 @@ struct iio_loop_info { struct task_struct *task; }; -static struct config_item_type iio_loop_type = { +static const struct config_item_type iio_loop_type = { .ct_owner = THIS_MODULE, };