From patchwork Mon Oct 16 15:18:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 10008815 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 CFB79601D5 for ; Mon, 16 Oct 2017 15:26:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0773285ED for ; Mon, 16 Oct 2017 15:26:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4A2F285FC; Mon, 16 Oct 2017 15:26:05 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 4679C285ED for ; Mon, 16 Oct 2017 15:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754104AbdJPPZ7 (ORCPT ); Mon, 16 Oct 2017 11:25:59 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50407 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753717AbdJPPTU (ORCPT ); Mon, 16 Oct 2017 11:19:20 -0400 Received: by mail-wm0-f66.google.com with SMTP id u138so4408567wmu.5; Mon, 16 Oct 2017 08:19:18 -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:in-reply-to:references; bh=WE9H1sKmHfbMjWlwycNW7Fx+Ni/XGQbBNBfmCWUWbsM=; b=htR8WZhT4+uwiZEwtItzyQDajavXoddGaqMoZqRtNUmV7xYS1fHt6rQ9JOER+90dhH uxjfyaW1m2EGE2aj5mFPNmw25fPTkxKNJGjL24lcID0BTuvw0rfoerrphyy1XroCCm6z XqPbmxxdI4uamjh3o5VtjWBTNVz34fYhx4P3xKM1opFVjJ+B+xAsFl16PUomnYpKtjHC nFjwZzz2elE0UhlmTT4RQFVtXqreGDlwnFK6arlYYn+4jto4e6MULYM5d/dBhDjMkOy2 vmRPcQyM6bAYu8s2vH4IXf9wX1YRjJuCgjfjbeH8516epSHR/qjlryKR/fE97iLPZCJi xcmg== 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:in-reply-to :references; bh=WE9H1sKmHfbMjWlwycNW7Fx+Ni/XGQbBNBfmCWUWbsM=; b=DkbUmKmb/0wOE1jHMnE2JVfc8+bd2hpij/FEWpdHAL4YRLW01zy97ieFs83fmUpcut OQW071m/lWkM+u7TyPO7/C2ac96VvFGGqPVmNPR7edCIO3S6u3ahvfGgliB6oafLoDAm XkhTTr3Rxz9imU+OvzZrLVBXGdx6lSkkwDZJBJaCiM2Wshac5ARJGapODhcq/1ePM/OP g/rbPOiV8N8s4daJemz7wgpncWhfyR+qVOJ/0bvk7+gXHN9ZHM2/wg3qvfXCC262zvVy L/YNqta8KSbVrZsrl+PC8hu7JrslzC95rLC3FQxx6LwcQ6wmbciAGgUDNhRELGDe9DRa 1G4A== X-Gm-Message-State: AMCzsaV8AJ/5J41wEtrtdoZ1QjuRKHt9ncS9B/KjJQNfPIZ/akKTVIrK DhbBSETRjo4bRIubnYzzXDA= X-Google-Smtp-Source: ABhQp+SJDnUKWjb+3eJiJoy7hqHtVEQfhS/20h9C3FxOpNqwU2J1XPAXNniFlEQRxE2qdP2l1t95mg== X-Received: by 10.28.36.212 with SMTP id k203mr1069523wmk.127.1508167157527; Mon, 16 Oct 2017 08:19:17 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id p49sm13545774wrc.61.2017.10.16.08.19.15 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:16 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:15 +0200 From: Bhumika Goyal To: julia.lawall@lip6.fr, rjw@rjwysocki.net, lenb@kernel.org, alexander.shishkin@linux.intel.com, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, hch@lst.de, sagi@grimberg.me, kishon@ti.com, bhelgaas@google.com, nab@linux-iscsi.org, balbi@kernel.org, gregkh@linuxfoundation.org, laurent.pinchart@ideasonboard.com, jlbec@evilplan.org, ccaulfie@redhat.com, teigland@redhat.com, mfasheh@versity.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-usb@vger.kernel.org, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH v2 04/15] iio: make function argument and some structures const Date: Mon, 16 Oct 2017 17:18:43 +0200 Message-Id: <1508167134-6243-5-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508167134-6243-1-git-send-email-bhumirks@gmail.com> References: <1508167134-6243-1-git-send-email-bhumirks@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make the argument of the functions iio_sw{d/t}_group_init_type_name const as they are only passed to the function config_group_init_type_name having the argument as const. Make the config_item_type structures const as they are either passed to the functions having the argument as const or they are stored in the const "ci_type" field of a config_item structure. Signed-off-by: Bhumika Goyal Acked-by: Jonathan Cameron --- * Changes in v2- Combine all the followup patches and the constification patches into a series. 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 +- include/linux/iio/sw_device.h | 2 +- include/linux/iio/sw_trigger.h | 2 +- 8 files changed, 12 insertions(+), 12 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, }; diff --git a/include/linux/iio/sw_device.h b/include/linux/iio/sw_device.h index fa79319..8642b91 100644 --- a/include/linux/iio/sw_device.h +++ b/include/linux/iio/sw_device.h @@ -60,7 +60,7 @@ struct iio_sw_device *to_iio_sw_device(struct config_item *item) static inline void iio_swd_group_init_type_name(struct iio_sw_device *d, const char *name, - struct config_item_type *type) + const struct config_item_type *type) { #if IS_ENABLED(CONFIG_CONFIGFS_FS) config_group_init_type_name(&d->group, name, type); diff --git a/include/linux/iio/sw_trigger.h b/include/linux/iio/sw_trigger.h index c97eab6..0c43738 100644 --- a/include/linux/iio/sw_trigger.h +++ b/include/linux/iio/sw_trigger.h @@ -60,7 +60,7 @@ struct iio_sw_trigger *to_iio_sw_trigger(struct config_item *item) static inline void iio_swt_group_init_type_name(struct iio_sw_trigger *t, const char *name, - struct config_item_type *type) + const struct config_item_type *type) { #if IS_ENABLED(CONFIG_CONFIGFS_FS) config_group_init_type_name(&t->group, name, type);