From patchwork Mon Oct 16 15:18:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AYyB0aAe"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2Jf4nXNz9s0g for ; Tue, 17 Oct 2017 02:28:02 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754040AbdJPP1e (ORCPT ); Mon, 16 Oct 2017 11:27:34 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:51942 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753622AbdJPPTL (ORCPT ); Mon, 16 Oct 2017 11:19:11 -0400 Received: by mail-wm0-f65.google.com with SMTP id f4so4489683wme.0; Mon, 16 Oct 2017 08:19:09 -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=yVMYFBR/CQr00T8dBrzajOqWB6n362pCrB13rY5ZD/4=; b=AYyB0aAe5ST6luOxZIZZEsye2f1BiAg1NSZeRKcRZCKGyCecUg3uwmjK8SPGzyWRfK zIMKFjuuw6j34JJJH29BtbM3+iFyMCFv773xO7PYZp3lVH4lbzMbPxItWiqVOb3/AXag VkV8YjpzJ65dwuEbvnWCn+OiXsLMk0CFn9fdVznuYPBHnPoxu9ptc278KqUt2S2ycstW V1CwBWbbwQS/WUGAZSoFNa11Ml4XywoukFeG33NxyfLUS2j4OwdifmbtEsA9P/CQS0pf gjCvoZ4k859Oj6BjHIwXqHNHLowUrfW59vCDAsKfMibgvqMBJdGYBWSM0trfAm4cV4y/ xTew== 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=yVMYFBR/CQr00T8dBrzajOqWB6n362pCrB13rY5ZD/4=; b=Ne8Vm8jR+sWMdUfVTYodP0yqXTUfauoWJ26zxAFTz/2zCTQoiH52wEsV+VDYEybri0 jeG+Pyzqemf+iUxEH/72n0GFNFoFrmzbi/hiz/+Yqsk93hUq4G1xXfJllF28KNeNa081 8ZyCS5HvziAZuqiMWv+6Fnkemw36YIarWUCmITs0+7PqFFcZn5XhcH6GlUqxlmZp67US Ftt7mkneYNrbK2A68scv6stgE9em1ckhEQ7KehsWme02cl593LIST0dN2R80VQJw5iDT Uc3c033Oo7acUmc0YiZI/TgD/NucFrEU9bhU2mX923Spx1l8qcUhrfXe/f2NmJZrYrwc 2NMA== X-Gm-Message-State: AMCzsaV/yrb0m2pIBA8Xv3JD0zUgtT8dw6MXJqMKZpJCVyOL++Xxjvig GjE3m3mfLN5GaYx40MaRy7I= X-Google-Smtp-Source: ABhQp+SHRCx9oqPVi25KzaW//g/QZzlZnkzrO8eSwbNUnPN8MkzIoBMbtEKyX99XCEU710q4qWeuSQ== X-Received: by 10.223.134.154 with SMTP id 26mr978307wrx.137.1508167148605; Mon, 16 Oct 2017 08:19:08 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id c45sm9257879wrg.97.2017.10.16.08.19.06 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:07 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:06 +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 01/15] configfs: make ci_type field, some pointers and function arguments const Date: Mon, 16 Oct 2017 17:18:40 +0200 Message-Id: <1508167134-6243-2-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The ci_type field of the config_item structure do not modify the fields of the config_item_type structure it points to. And the other pointers initialized with ci_type do not modify the fields as well. So, make the ci_type field and the pointers initialized with ci_type as const. Make the struct config_item_type *type function argument of functions config_{item/group}_init_type_name const as the argument in both the functions is only stored in the ci_type field of a config_item structure which is now made const. Make the argument of configfs_register_default_group const as it is only passed to the argument of the function config_group_init_type_name which is now const. Signed-off-by: Bhumika Goyal Acked-by: Greg Kroah-Hartman --- * Changes in v2- Combine all the followup patches and the constification patches into a series. fs/configfs/dir.c | 10 +++++----- fs/configfs/item.c | 6 +++--- fs/configfs/symlink.c | 4 ++-- include/linux/configfs.h | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 56fb261..577cff2 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -584,7 +584,7 @@ static void detach_attrs(struct config_item * item) static int populate_attrs(struct config_item *item) { - struct config_item_type *t = item->ci_type; + const struct config_item_type *t = item->ci_type; struct configfs_attribute *attr; struct configfs_bin_attribute *bin_attr; int error = 0; @@ -901,7 +901,7 @@ static void configfs_detach_group(struct config_item *item) static void client_disconnect_notify(struct config_item *parent_item, struct config_item *item) { - struct config_item_type *type; + const struct config_item_type *type; type = parent_item->ci_type; BUG_ON(!type); @@ -920,7 +920,7 @@ static void client_disconnect_notify(struct config_item *parent_item, static void client_drop_item(struct config_item *parent_item, struct config_item *item) { - struct config_item_type *type; + const struct config_item_type *type; type = parent_item->ci_type; BUG_ON(!type); @@ -1260,7 +1260,7 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode struct config_item *parent_item; struct configfs_subsystem *subsys; struct configfs_dirent *sd; - struct config_item_type *type; + const struct config_item_type *type; struct module *subsys_owner = NULL, *new_item_owner = NULL; char *name; @@ -1810,7 +1810,7 @@ void configfs_unregister_group(struct config_group *group) struct config_group * configfs_register_default_group(struct config_group *parent_group, const char *name, - struct config_item_type *item_type) + const struct config_item_type *item_type) { int ret; struct config_group *group; diff --git a/fs/configfs/item.c b/fs/configfs/item.c index a66f662..88f266e 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c @@ -113,7 +113,7 @@ int config_item_set_name(struct config_item *item, const char *fmt, ...) void config_item_init_type_name(struct config_item *item, const char *name, - struct config_item_type *type) + const struct config_item_type *type) { config_item_set_name(item, "%s", name); item->ci_type = type; @@ -122,7 +122,7 @@ void config_item_init_type_name(struct config_item *item, EXPORT_SYMBOL(config_item_init_type_name); void config_group_init_type_name(struct config_group *group, const char *name, - struct config_item_type *type) + const struct config_item_type *type) { config_item_set_name(&group->cg_item, "%s", name); group->cg_item.ci_type = type; @@ -148,7 +148,7 @@ struct config_item *config_item_get_unless_zero(struct config_item *item) static void config_item_cleanup(struct config_item *item) { - struct config_item_type *t = item->ci_type; + const struct config_item_type *t = item->ci_type; struct config_group *s = item->ci_group; struct config_item *parent = item->ci_parent; diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index c8aabba..78ffc26 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c @@ -138,7 +138,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna struct configfs_dirent *sd; struct config_item *parent_item; struct config_item *target_item = NULL; - struct config_item_type *type; + const struct config_item_type *type; sd = dentry->d_parent->d_fsdata; /* @@ -186,7 +186,7 @@ int configfs_unlink(struct inode *dir, struct dentry *dentry) struct configfs_dirent *sd = dentry->d_fsdata; struct configfs_symlink *sl; struct config_item *parent_item; - struct config_item_type *type; + const struct config_item_type *type; int ret; ret = -EPERM; /* What lack-of-symlink returns */ diff --git a/include/linux/configfs.h b/include/linux/configfs.h index c967090..90b90f8 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h @@ -58,7 +58,7 @@ struct config_item { struct list_head ci_entry; struct config_item *ci_parent; struct config_group *ci_group; - struct config_item_type *ci_type; + const struct config_item_type *ci_type; struct dentry *ci_dentry; }; @@ -72,7 +72,7 @@ static inline char *config_item_name(struct config_item * item) extern void config_item_init_type_name(struct config_item *item, const char *name, - struct config_item_type *type); + const struct config_item_type *type); extern struct config_item *config_item_get(struct config_item *); extern struct config_item *config_item_get_unless_zero(struct config_item *); @@ -101,7 +101,7 @@ struct config_group { extern void config_group_init(struct config_group *group); extern void config_group_init_type_name(struct config_group *group, const char *name, - struct config_item_type *type); + const struct config_item_type *type); static inline struct config_group *to_config_group(struct config_item *item) { @@ -261,7 +261,7 @@ int configfs_register_group(struct config_group *parent_group, struct config_group * configfs_register_default_group(struct config_group *parent_group, const char *name, - struct config_item_type *item_type); + const struct config_item_type *item_type); void configfs_unregister_default_group(struct config_group *group); /* These functions can sleep and can alloc with GFP_KERNEL */ From patchwork Mon Oct 16 15:18:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jDBgbp9N"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2HF5Sdvz9t3w for ; Tue, 17 Oct 2017 02:26:49 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753947AbdJPP0p (ORCPT ); Mon, 16 Oct 2017 11:26:45 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:50382 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753641AbdJPPTO (ORCPT ); Mon, 16 Oct 2017 11:19:14 -0400 Received: by mail-wm0-f68.google.com with SMTP id u138so4407667wmu.5; Mon, 16 Oct 2017 08:19:12 -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=6aw5z6fIRjU7mFXBNE78b5byBl4Rjc57yDjxUR1Xc9c=; b=jDBgbp9NMS/Fn/bYgBRU5GAMN2hRyCMEV/NmhPr0PuIIaliMCnwlSnHzLz71Rrd8YJ 8JcE7NVGMaYuGHStWjCwYywqnWqlgp9pDY5lLyDVJu0KYDCGnlTNinsvfX8Sy6gwojJb 2400P9B/rO166rpmuEvKXpXfGWBJFtWvhj4SUmXlQ81IcU6VlQ7N6f9ICafPTDOnOlMm y85Gf3UxbWss2Z8a5aHpf3AwM31RLi6pt5CSxtjiwFT5oxMNoU7Ho5DVR5amyB/bh6tg f2b8Qpcr1AXUlWt7VAlh0Pk87mfX1RfLmx0uSsg2dN8HA6FHYbOCcdkGXkpejLzHiBMG XSRA== 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=6aw5z6fIRjU7mFXBNE78b5byBl4Rjc57yDjxUR1Xc9c=; b=aP7GDSWfzwF3/57HGPRSc+VFNHf011wpi/gS7XRhtPlUu/usCa93hfEqsLKzIAxlbM ZM/veBC7U7tGN2B+oyJO4Kf3qx8m+yiDN3temWdA8Tfc0gmVLSUReninfLnTF2v6smfN 0xe49Jab8AcFw38c+rNvqByMXRC+D7mnGfMWrtd0Bfd+7bY5Y1V63vi9wk5U4mS/2sdo AwPT2ddFsMCQkuY8UwskuMqXFeTnMzKTuT4UvBd2mBfyVoqsLddQ0s1nZw09J3wgUv3x /4xf7slLnJW+D8Ru+KJQVRN7wFl9qQ7nXxK9kaeyNwhx4j5XYOse1U5wbODRkqUGN1up I9Iw== X-Gm-Message-State: AMCzsaWSuVIfth1jl2VU90Pjhllhsgr3ppabI1VwPt2kblAltijFDw+m SM+fi1EvicguCRRpH7jQnRQ= X-Google-Smtp-Source: ABhQp+T1Pj9DK9ANjnwiWhz0pjb3CLgrrA99QIFIgI6rbka86OWmd4F+AyVeh6C5/ru3qVkzGYN3Dw== X-Received: by 10.28.178.81 with SMTP id b78mr1160239wmf.157.1508167151606; Mon, 16 Oct 2017 08:19:11 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id 19sm6756843wms.7.2017.10.16.08.19.09 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:10 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:09 +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 02/15] usb: gadget: make config_item_type structures const Date: Mon, 16 Oct 2017 17:18:41 +0200 Message-Id: <1508167134-6243-3-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make these structures const as they are only passed to the const argument of the functions config_{group/item}_init_type_name. Signed-off-by: Bhumika Goyal Acked-by: Felipe Balbi --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/usb/gadget/function/f_acm.c | 2 +- drivers/usb/gadget/function/f_ecm.c | 2 +- drivers/usb/gadget/function/f_eem.c | 2 +- drivers/usb/gadget/function/f_fs.c | 2 +- drivers/usb/gadget/function/f_hid.c | 2 +- drivers/usb/gadget/function/f_loopback.c | 2 +- drivers/usb/gadget/function/f_mass_storage.c | 4 +-- drivers/usb/gadget/function/f_midi.c | 2 +- drivers/usb/gadget/function/f_ncm.c | 2 +- drivers/usb/gadget/function/f_obex.c | 2 +- drivers/usb/gadget/function/f_phonet.c | 2 +- drivers/usb/gadget/function/f_printer.c | 2 +- drivers/usb/gadget/function/f_rndis.c | 2 +- drivers/usb/gadget/function/f_serial.c | 2 +- drivers/usb/gadget/function/f_sourcesink.c | 2 +- drivers/usb/gadget/function/f_subset.c | 2 +- drivers/usb/gadget/function/f_tcm.c | 2 +- drivers/usb/gadget/function/f_uac1.c | 2 +- drivers/usb/gadget/function/f_uac1_legacy.c | 2 +- drivers/usb/gadget/function/f_uac2.c | 2 +- drivers/usb/gadget/function/uvc_configfs.c | 50 ++++++++++++++-------------- 21 files changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index 5e3828d..8680af4 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -786,7 +786,7 @@ static ssize_t f_acm_port_num_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type acm_func_type = { +static const struct config_item_type acm_func_type = { .ct_item_ops = &acm_item_ops, .ct_attrs = acm_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_ecm.c b/drivers/usb/gadget/function/f_ecm.c index 4c488d1..9657e19 100644 --- a/drivers/usb/gadget/function/f_ecm.c +++ b/drivers/usb/gadget/function/f_ecm.c @@ -845,7 +845,7 @@ static inline struct f_ecm_opts *to_f_ecm_opts(struct config_item *item) NULL, }; -static struct config_item_type ecm_func_type = { +static const struct config_item_type ecm_func_type = { .ct_item_ops = &ecm_item_ops, .ct_attrs = ecm_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c index 007ec6e..5e5d164 100644 --- a/drivers/usb/gadget/function/f_eem.c +++ b/drivers/usb/gadget/function/f_eem.c @@ -556,7 +556,7 @@ static inline struct f_eem_opts *to_f_eem_opts(struct config_item *item) NULL, }; -static struct config_item_type eem_func_type = { +static const struct config_item_type eem_func_type = { .ct_item_ops = &eem_item_ops, .ct_attrs = eem_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 8b34258..5362fc4 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -3385,7 +3385,7 @@ static void ffs_attr_release(struct config_item *item) .release = ffs_attr_release, }; -static struct config_item_type ffs_func_type = { +static const struct config_item_type ffs_func_type = { .ct_item_ops = &ffs_item_ops, .ct_owner = THIS_MODULE, }; diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index d8e359e..6993cb8 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -992,7 +992,7 @@ static ssize_t f_hid_opts_dev_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type hid_func_type = { +static const struct config_item_type hid_func_type = { .ct_item_ops = &hidg_item_ops, .ct_attrs = hid_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c index e700938..9311f8c 100644 --- a/drivers/usb/gadget/function/f_loopback.c +++ b/drivers/usb/gadget/function/f_loopback.c @@ -556,7 +556,7 @@ static ssize_t f_lb_opts_bulk_buflen_store(struct config_item *item, NULL, }; -static struct config_item_type lb_func_type = { +static const struct config_item_type lb_func_type = { .ct_item_ops = &lb_item_ops, .ct_attrs = lb_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 5153e29..a538be3 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -3140,7 +3140,7 @@ static ssize_t fsg_lun_opts_inquiry_string_store(struct config_item *item, NULL, }; -static struct config_item_type fsg_lun_type = { +static const struct config_item_type fsg_lun_type = { .ct_item_ops = &fsg_lun_item_ops, .ct_attrs = fsg_lun_attrs, .ct_owner = THIS_MODULE, @@ -3331,7 +3331,7 @@ static ssize_t fsg_opts_num_buffers_store(struct config_item *item, .drop_item = fsg_lun_drop, }; -static struct config_item_type fsg_func_type = { +static const struct config_item_type fsg_func_type = { .ct_item_ops = &fsg_item_ops, .ct_group_ops = &fsg_group_ops, .ct_attrs = fsg_attrs, diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 5d3d794..53fa073 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c @@ -1189,7 +1189,7 @@ static ssize_t f_midi_opts_id_store(struct config_item *item, NULL, }; -static struct config_item_type midi_func_type = { +static const struct config_item_type midi_func_type = { .ct_item_ops = &midi_item_ops, .ct_attrs = midi_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 45b334c..3599aa4 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -1568,7 +1568,7 @@ static inline struct f_ncm_opts *to_f_ncm_opts(struct config_item *item) NULL, }; -static struct config_item_type ncm_func_type = { +static const struct config_item_type ncm_func_type = { .ct_item_ops = &ncm_item_ops, .ct_attrs = ncm_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_obex.c b/drivers/usb/gadget/function/f_obex.c index d43e86c..9fc7988 100644 --- a/drivers/usb/gadget/function/f_obex.c +++ b/drivers/usb/gadget/function/f_obex.c @@ -411,7 +411,7 @@ static ssize_t f_obex_port_num_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type obex_func_type = { +static const struct config_item_type obex_func_type = { .ct_item_ops = &obex_item_ops, .ct_attrs = acm_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_phonet.c b/drivers/usb/gadget/function/f_phonet.c index 9c4c58e..5fe1f2a 100644 --- a/drivers/usb/gadget/function/f_phonet.c +++ b/drivers/usb/gadget/function/f_phonet.c @@ -599,7 +599,7 @@ static ssize_t f_phonet_ifname_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type phonet_func_type = { +static const struct config_item_type phonet_func_type = { .ct_item_ops = &phonet_item_ops, .ct_attrs = phonet_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index ea0da35a..8072836 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -1261,7 +1261,7 @@ static ssize_t f_printer_opts_q_len_store(struct config_item *item, NULL, }; -static struct config_item_type printer_func_type = { +static const struct config_item_type printer_func_type = { .ct_item_ops = &printer_item_ops, .ct_attrs = printer_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c index c7c5b3c..b981545 100644 --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -890,7 +890,7 @@ static inline struct f_rndis_opts *to_f_rndis_opts(struct config_item *item) NULL, }; -static struct config_item_type rndis_func_type = { +static const struct config_item_type rndis_func_type = { .ct_item_ops = &rndis_item_ops, .ct_attrs = rndis_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_serial.c b/drivers/usb/gadget/function/f_serial.c index cb00ada..4ee860b 100644 --- a/drivers/usb/gadget/function/f_serial.c +++ b/drivers/usb/gadget/function/f_serial.c @@ -281,7 +281,7 @@ static ssize_t f_serial_port_num_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type serial_func_type = { +static const struct config_item_type serial_func_type = { .ct_item_ops = &serial_item_ops, .ct_attrs = acm_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c index 8784fa1..ed22e18 100644 --- a/drivers/usb/gadget/function/f_sourcesink.c +++ b/drivers/usb/gadget/function/f_sourcesink.c @@ -1230,7 +1230,7 @@ static ssize_t f_ss_opts_iso_qlen_store(struct config_item *item, NULL, }; -static struct config_item_type ss_func_type = { +static const struct config_item_type ss_func_type = { .ct_item_ops = &ss_item_ops, .ct_attrs = ss_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_subset.c b/drivers/usb/gadget/function/f_subset.c index 434b983..e810d15 100644 --- a/drivers/usb/gadget/function/f_subset.c +++ b/drivers/usb/gadget/function/f_subset.c @@ -412,7 +412,7 @@ static inline struct f_gether_opts *to_f_gether_opts(struct config_item *item) NULL, }; -static struct config_item_type gether_func_type = { +static const struct config_item_type gether_func_type = { .ct_item_ops = &gether_item_ops, .ct_attrs = gether_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index a82e2bd..e3cec75 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -2166,7 +2166,7 @@ static void tcm_attr_release(struct config_item *item) .release = tcm_attr_release, }; -static struct config_item_type tcm_func_type = { +static const struct config_item_type tcm_func_type = { .ct_item_ops = &tcm_item_ops, .ct_owner = THIS_MODULE, }; diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index 29efbed..4d5487a 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -709,7 +709,7 @@ static void f_uac1_attr_release(struct config_item *item) NULL, }; -static struct config_item_type f_uac1_func_type = { +static const struct config_item_type f_uac1_func_type = { .ct_item_ops = &f_uac1_item_ops, .ct_attrs = f_uac1_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_uac1_legacy.c b/drivers/usb/gadget/function/f_uac1_legacy.c index 5d229e7..178fd12 100644 --- a/drivers/usb/gadget/function/f_uac1_legacy.c +++ b/drivers/usb/gadget/function/f_uac1_legacy.c @@ -921,7 +921,7 @@ static void f_uac1_attr_release(struct config_item *item) NULL, }; -static struct config_item_type f_uac1_func_type = { +static const struct config_item_type f_uac1_func_type = { .ct_item_ops = &f_uac1_item_ops, .ct_attrs = f_uac1_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index f05c3f3..7bb9737 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -921,7 +921,7 @@ static void f_uac2_attr_release(struct config_item *item) NULL, }; -static struct config_item_type f_uac2_func_type = { +static const struct config_item_type f_uac2_func_type = { .ct_item_ops = &f_uac2_item_ops, .ct_attrs = f_uac2_attrs, .ct_owner = THIS_MODULE, diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c index 844cb73..f76619f 100644 --- a/drivers/usb/gadget/function/uvc_configfs.c +++ b/drivers/usb/gadget/function/uvc_configfs.c @@ -127,7 +127,7 @@ static struct uvcg_control_header *to_uvcg_control_header(struct config_item *it NULL, }; -static struct config_item_type uvcg_control_header_type = { +static const struct config_item_type uvcg_control_header_type = { .ct_attrs = uvcg_control_header_attrs, .ct_owner = THIS_MODULE, }; @@ -170,7 +170,7 @@ static void uvcg_control_header_drop(struct config_group *group, .drop_item = uvcg_control_header_drop, }; -static struct config_item_type uvcg_control_header_grp_type = { +static const struct config_item_type uvcg_control_header_grp_type = { .ct_group_ops = &uvcg_control_header_grp_ops, .ct_owner = THIS_MODULE, }; @@ -265,7 +265,7 @@ static ssize_t uvcg_default_processing_bm_controls_show( NULL, }; -static struct config_item_type uvcg_default_processing_type = { +static const struct config_item_type uvcg_default_processing_type = { .ct_attrs = uvcg_default_processing_attrs, .ct_owner = THIS_MODULE, }; @@ -277,7 +277,7 @@ static ssize_t uvcg_default_processing_bm_controls_show( struct config_group group; } uvcg_processing_grp; -static struct config_item_type uvcg_processing_grp_type = { +static const struct config_item_type uvcg_processing_grp_type = { .ct_owner = THIS_MODULE, }; @@ -382,7 +382,7 @@ static ssize_t uvcg_default_camera_bm_controls_show( NULL, }; -static struct config_item_type uvcg_default_camera_type = { +static const struct config_item_type uvcg_default_camera_type = { .ct_attrs = uvcg_default_camera_attrs, .ct_owner = THIS_MODULE, }; @@ -394,7 +394,7 @@ static ssize_t uvcg_default_camera_bm_controls_show( struct config_group group; } uvcg_camera_grp; -static struct config_item_type uvcg_camera_grp_type = { +static const struct config_item_type uvcg_camera_grp_type = { .ct_owner = THIS_MODULE, }; @@ -460,7 +460,7 @@ static ssize_t uvcg_default_camera_bm_controls_show( NULL, }; -static struct config_item_type uvcg_default_output_type = { +static const struct config_item_type uvcg_default_output_type = { .ct_attrs = uvcg_default_output_attrs, .ct_owner = THIS_MODULE, }; @@ -472,7 +472,7 @@ static ssize_t uvcg_default_camera_bm_controls_show( struct config_group group; } uvcg_output_grp; -static struct config_item_type uvcg_output_grp_type = { +static const struct config_item_type uvcg_output_grp_type = { .ct_owner = THIS_MODULE, }; @@ -481,7 +481,7 @@ static ssize_t uvcg_default_camera_bm_controls_show( struct config_group group; } uvcg_terminal_grp; -static struct config_item_type uvcg_terminal_grp_type = { +static const struct config_item_type uvcg_terminal_grp_type = { .ct_owner = THIS_MODULE, }; @@ -586,7 +586,7 @@ static void uvcg_control_class_drop_link(struct config_item *src, .drop_link = uvcg_control_class_drop_link, }; -static struct config_item_type uvcg_control_class_type = { +static const struct config_item_type uvcg_control_class_type = { .ct_item_ops = &uvcg_control_class_item_ops, .ct_owner = THIS_MODULE, }; @@ -596,7 +596,7 @@ static void uvcg_control_class_drop_link(struct config_item *src, struct config_group group; } uvcg_control_class_grp; -static struct config_item_type uvcg_control_class_grp_type = { +static const struct config_item_type uvcg_control_class_grp_type = { .ct_owner = THIS_MODULE, }; @@ -605,7 +605,7 @@ static void uvcg_control_class_drop_link(struct config_item *src, struct config_group group; } uvcg_control_grp; -static struct config_item_type uvcg_control_grp_type = { +static const struct config_item_type uvcg_control_grp_type = { .ct_owner = THIS_MODULE, }; @@ -857,7 +857,7 @@ static void uvcg_streaming_header_drop_link(struct config_item *src, NULL, }; -static struct config_item_type uvcg_streaming_header_type = { +static const struct config_item_type uvcg_streaming_header_type = { .ct_item_ops = &uvcg_streaming_header_item_ops, .ct_attrs = uvcg_streaming_header_attrs, .ct_owner = THIS_MODULE, @@ -901,7 +901,7 @@ static void uvcg_streaming_header_drop(struct config_group *group, .drop_item = uvcg_streaming_header_drop, }; -static struct config_item_type uvcg_streaming_header_grp_type = { +static const struct config_item_type uvcg_streaming_header_grp_type = { .ct_group_ops = &uvcg_streaming_header_grp_ops, .ct_owner = THIS_MODULE, }; @@ -1150,7 +1150,7 @@ static ssize_t uvcg_frame_dw_frame_interval_store(struct config_item *item, NULL, }; -static struct config_item_type uvcg_frame_type = { +static const struct config_item_type uvcg_frame_type = { .ct_attrs = uvcg_frame_attrs, .ct_owner = THIS_MODULE, }; @@ -1419,7 +1419,7 @@ static ssize_t uvcg_uncompressed_guid_format_store(struct config_item *item, NULL, }; -static struct config_item_type uvcg_uncompressed_type = { +static const struct config_item_type uvcg_uncompressed_type = { .ct_group_ops = &uvcg_uncompressed_group_ops, .ct_attrs = uvcg_uncompressed_attrs, .ct_owner = THIS_MODULE, @@ -1469,7 +1469,7 @@ static void uvcg_uncompressed_drop(struct config_group *group, .drop_item = uvcg_uncompressed_drop, }; -static struct config_item_type uvcg_uncompressed_grp_type = { +static const struct config_item_type uvcg_uncompressed_grp_type = { .ct_group_ops = &uvcg_uncompressed_grp_ops, .ct_owner = THIS_MODULE, }; @@ -1619,7 +1619,7 @@ static struct uvcg_mjpeg *to_uvcg_mjpeg(struct config_item *item) NULL, }; -static struct config_item_type uvcg_mjpeg_type = { +static const struct config_item_type uvcg_mjpeg_type = { .ct_group_ops = &uvcg_mjpeg_group_ops, .ct_attrs = uvcg_mjpeg_attrs, .ct_owner = THIS_MODULE, @@ -1663,7 +1663,7 @@ static void uvcg_mjpeg_drop(struct config_group *group, .drop_item = uvcg_mjpeg_drop, }; -static struct config_item_type uvcg_mjpeg_grp_type = { +static const struct config_item_type uvcg_mjpeg_grp_type = { .ct_group_ops = &uvcg_mjpeg_grp_ops, .ct_owner = THIS_MODULE, }; @@ -1728,7 +1728,7 @@ static void uvcg_mjpeg_drop(struct config_group *group, NULL, }; -static struct config_item_type uvcg_default_color_matching_type = { +static const struct config_item_type uvcg_default_color_matching_type = { .ct_attrs = uvcg_default_color_matching_attrs, .ct_owner = THIS_MODULE, }; @@ -1740,7 +1740,7 @@ static void uvcg_mjpeg_drop(struct config_group *group, struct config_group group; } uvcg_color_matching_grp; -static struct config_item_type uvcg_color_matching_grp_type = { +static const struct config_item_type uvcg_color_matching_grp_type = { .ct_owner = THIS_MODULE, }; @@ -2085,7 +2085,7 @@ static void uvcg_streaming_class_drop_link(struct config_item *src, .drop_link = uvcg_streaming_class_drop_link, }; -static struct config_item_type uvcg_streaming_class_type = { +static const struct config_item_type uvcg_streaming_class_type = { .ct_item_ops = &uvcg_streaming_class_item_ops, .ct_owner = THIS_MODULE, }; @@ -2095,7 +2095,7 @@ static void uvcg_streaming_class_drop_link(struct config_item *src, struct config_group group; } uvcg_streaming_class_grp; -static struct config_item_type uvcg_streaming_class_grp_type = { +static const struct config_item_type uvcg_streaming_class_grp_type = { .ct_owner = THIS_MODULE, }; @@ -2104,7 +2104,7 @@ static void uvcg_streaming_class_drop_link(struct config_item *src, struct config_group group; } uvcg_streaming_grp; -static struct config_item_type uvcg_streaming_grp_type = { +static const struct config_item_type uvcg_streaming_grp_type = { .ct_owner = THIS_MODULE, }; @@ -2190,7 +2190,7 @@ static void uvc_attr_release(struct config_item *item) NULL, }; -static struct config_item_type uvc_func_type = { +static const struct config_item_type uvc_func_type = { .ct_item_ops = &uvc_item_ops, .ct_attrs = uvc_attrs, .ct_owner = THIS_MODULE, From patchwork Mon Oct 16 15:18:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="olV8pkap"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2G93lpBz9rvt for ; Tue, 17 Oct 2017 02:25:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753732AbdJPPTV (ORCPT ); Mon, 16 Oct 2017 11:19:21 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:49549 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753703AbdJPPTR (ORCPT ); Mon, 16 Oct 2017 11:19:17 -0400 Received: by mail-wm0-f68.google.com with SMTP id b189so4385729wmd.4; Mon, 16 Oct 2017 08:19:15 -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=mKlm1AwoywTGx62kWE6iGbOscEgVokgM1D18vdQoYVQ=; b=olV8pkapx64DZgP7ZcOna+k0bRAf4n4nZoY42GQzUG4RarniaT0TsTY7Xxtf4xfw0m VTuUsGMaSx267GHv/h/tzNBbbynAA0apqV5ydTWLpwAg4oR5/M3K02h2fHsLMl2ShMS6 +N6FHc8OBDR+2c5pWIzWyI2Cg/4q/ioASvH6WMKqOWHoMiViPwkxxofe4aaa1HYitGOw RoU6E5108rLX8omv/TpNLhABhUSvdyZkXanBNxynq6Xxva7Q5551v1L/f0t8RuEyJhl+ xJDaZiD/CdvKkjNJj+ucGzN+JylbLpY3aPed6PauEef2HRtlTShPTasCcljf23nXCV6U uLgQ== 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=mKlm1AwoywTGx62kWE6iGbOscEgVokgM1D18vdQoYVQ=; b=ZkUS/PISHoTxiXwFtImldsjwCkhoJ+iRcHJ0qSk4lnjVxPma5Bgn9cAR5PzCLaSMEB ZIvGRJd0pUv24x78dar3M66usiHaIrDBKdogRErJWkMrwDDLTwqPlUYKBSsFBspIiz9h gyP70sMpc7oP2DJEoFM42U6Eppfj8Kj8WGuyxScs9lT8SsRShoGgD5ipwO1zxzI4nRns LcAY3ch4GtA5v3SVMV6CdBRP7LNjeKbP/deizSx/uO3Zwa1lPNmLSAqafYRwJYE3iU5R Q7ky6KA+JlmN3G6iv6Yok4ZxYvRpCFBeHEZYG7lHaxlt/ZFYzge07WE9hvhzWZETNabS 8xng== X-Gm-Message-State: AMCzsaW9YVWrfKHDhrvjazPD0UrMullNoudx3bn3FEnlG2pQgglEZKB1 o2BbTLZSEdJamJb6wvsb4J4= X-Google-Smtp-Source: ABhQp+RC1RQNEKWXISIFYIMRHdMlNYB0Jo6hYtGStySF0cbYFxD7rD/s826RCbgNQJ0hG1GbuMeS6g== X-Received: by 10.28.139.72 with SMTP id n69mr1309589wmd.29.1508167154749; Mon, 16 Oct 2017 08:19:14 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id t143sm4588097wmt.45.2017.10.16.08.19.12 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:13 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:12 +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 03/15] target: make config_item_type const Date: Mon, 16 Oct 2017 17:18:42 +0200 Message-Id: <1508167134-6243-4-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make these structures const as they are either passed to the functions having the argument as const or stored as a reference in the "ci_type" const field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/target/iscsi/iscsi_target_stat.c | 12 ++++++------ drivers/target/target_core_configfs.c | 14 +++++++------- drivers/target/target_core_stat.c | 16 ++++++++-------- include/target/iscsi/iscsi_target_stat.h | 12 ++++++------ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_stat.c b/drivers/target/iscsi/iscsi_target_stat.c index 411cb26..df0a398 100644 --- a/drivers/target/iscsi/iscsi_target_stat.c +++ b/drivers/target/iscsi/iscsi_target_stat.c @@ -187,7 +187,7 @@ static ssize_t iscsi_stat_instance_version_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_instance_cit = { +const struct config_item_type iscsi_stat_instance_cit = { .ct_attrs = iscsi_stat_instance_attrs, .ct_owner = THIS_MODULE, }; @@ -249,7 +249,7 @@ static ssize_t iscsi_stat_sess_err_format_errors_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_sess_err_cit = { +const struct config_item_type iscsi_stat_sess_err_cit = { .ct_attrs = iscsi_stat_sess_err_attrs, .ct_owner = THIS_MODULE, }; @@ -390,7 +390,7 @@ static ssize_t iscsi_stat_tgt_attr_fail_intr_addr_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_tgt_attr_cit = { +const struct config_item_type iscsi_stat_tgt_attr_cit = { .ct_attrs = iscsi_stat_tgt_attr_attrs, .ct_owner = THIS_MODULE, }; @@ -522,7 +522,7 @@ static ssize_t iscsi_stat_login_negotiate_fails_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_login_cit = { +const struct config_item_type iscsi_stat_login_cit = { .ct_attrs = iscsi_stat_login_stats_attrs, .ct_owner = THIS_MODULE, }; @@ -579,7 +579,7 @@ static ssize_t iscsi_stat_logout_abnormal_logouts_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_logout_cit = { +const struct config_item_type iscsi_stat_logout_cit = { .ct_attrs = iscsi_stat_logout_stats_attrs, .ct_owner = THIS_MODULE, }; @@ -801,7 +801,7 @@ static ssize_t iscsi_stat_sess_conn_timeout_errors_show( NULL, }; -struct config_item_type iscsi_stat_sess_cit = { +const struct config_item_type iscsi_stat_sess_cit = { .ct_attrs = iscsi_stat_sess_stats_attrs, .ct_owner = THIS_MODULE, }; diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 7e87d95..bd87cc2 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -307,7 +307,7 @@ static void target_core_deregister_fabric( /* * Provides Fabrics Groups and Item Attributes for /sys/kernel/config/target/ */ -static struct config_item_type target_core_fabrics_item = { +static const struct config_item_type target_core_fabrics_item = { .ct_group_ops = &target_core_fabric_group_ops, .ct_attrs = target_core_fabric_item_attrs, .ct_owner = THIS_MODULE, @@ -2376,7 +2376,7 @@ static void target_core_alua_lu_gp_release(struct config_item *item) .release = target_core_alua_lu_gp_release, }; -static struct config_item_type target_core_alua_lu_gp_cit = { +static const struct config_item_type target_core_alua_lu_gp_cit = { .ct_item_ops = &target_core_alua_lu_gp_ops, .ct_attrs = target_core_alua_lu_gp_attrs, .ct_owner = THIS_MODULE, @@ -2434,7 +2434,7 @@ static void target_core_alua_drop_lu_gp( .drop_item = &target_core_alua_drop_lu_gp, }; -static struct config_item_type target_core_alua_lu_gps_cit = { +static const struct config_item_type target_core_alua_lu_gps_cit = { .ct_item_ops = NULL, .ct_group_ops = &target_core_alua_lu_gps_group_ops, .ct_owner = THIS_MODULE, @@ -2813,7 +2813,7 @@ static void target_core_alua_tg_pt_gp_release(struct config_item *item) .release = target_core_alua_tg_pt_gp_release, }; -static struct config_item_type target_core_alua_tg_pt_gp_cit = { +static const struct config_item_type target_core_alua_tg_pt_gp_cit = { .ct_item_ops = &target_core_alua_tg_pt_gp_ops, .ct_attrs = target_core_alua_tg_pt_gp_attrs, .ct_owner = THIS_MODULE, @@ -2884,7 +2884,7 @@ static void target_core_alua_drop_tg_pt_gp( * core/alua/lu_gps and core/alua/tg_pt_gps that are attached to * target_core_alua_cit in target_core_init_configfs() below. */ -static struct config_item_type target_core_alua_cit = { +static const struct config_item_type target_core_alua_cit = { .ct_item_ops = NULL, .ct_attrs = NULL, .ct_owner = THIS_MODULE, @@ -3105,7 +3105,7 @@ static void target_core_hba_release(struct config_item *item) .release = target_core_hba_release, }; -static struct config_item_type target_core_hba_cit = { +static const struct config_item_type target_core_hba_cit = { .ct_item_ops = &target_core_hba_item_ops, .ct_group_ops = &target_core_hba_group_ops, .ct_attrs = target_core_hba_attrs, @@ -3188,7 +3188,7 @@ static void target_core_call_delhbafromtarget( .drop_item = target_core_call_delhbafromtarget, }; -static struct config_item_type target_core_cit = { +static const struct config_item_type target_core_cit = { .ct_item_ops = NULL, .ct_group_ops = &target_core_group_ops, .ct_attrs = NULL, diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c index 8038255..f0db91e 100644 --- a/drivers/target/target_core_stat.c +++ b/drivers/target/target_core_stat.c @@ -96,7 +96,7 @@ static ssize_t target_stat_ports_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type target_stat_scsi_dev_cit = { +static const struct config_item_type target_stat_scsi_dev_cit = { .ct_attrs = target_stat_scsi_dev_attrs, .ct_owner = THIS_MODULE, }; @@ -193,7 +193,7 @@ static ssize_t target_stat_tgt_aborts_no_task_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_tgt_dev_cit = { +static const struct config_item_type target_stat_scsi_tgt_dev_cit = { .ct_attrs = target_stat_scsi_tgt_dev_attrs, .ct_owner = THIS_MODULE, }; @@ -414,7 +414,7 @@ static ssize_t target_stat_lu_creation_time_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_lu_cit = { +static const struct config_item_type target_stat_scsi_lu_cit = { .ct_attrs = target_stat_scsi_lu_attrs, .ct_owner = THIS_MODULE, }; @@ -540,7 +540,7 @@ static ssize_t target_stat_port_busy_count_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_port_cit = { +static const struct config_item_type target_stat_scsi_port_cit = { .ct_attrs = target_stat_scsi_port_attrs, .ct_owner = THIS_MODULE, }; @@ -724,7 +724,7 @@ static ssize_t target_stat_tgt_port_hs_in_cmds_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_tgt_port_cit = { +static const struct config_item_type target_stat_scsi_tgt_port_cit = { .ct_attrs = target_stat_scsi_tgt_port_attrs, .ct_owner = THIS_MODULE, }; @@ -844,7 +844,7 @@ static ssize_t target_stat_transport_proto_id_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_transport_cit = { +static const struct config_item_type target_stat_scsi_transport_cit = { .ct_attrs = target_stat_scsi_transport_attrs, .ct_owner = THIS_MODULE, }; @@ -1206,7 +1206,7 @@ static ssize_t target_stat_auth_row_status_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_auth_intr_cit = { +static const struct config_item_type target_stat_scsi_auth_intr_cit = { .ct_attrs = target_stat_scsi_auth_intr_attrs, .ct_owner = THIS_MODULE, }; @@ -1378,7 +1378,7 @@ static ssize_t target_stat_iport_port_ident_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_att_intr_port_cit = { +static const struct config_item_type target_stat_scsi_att_intr_port_cit = { .ct_attrs = target_stat_scsi_ath_intr_port_attrs, .ct_owner = THIS_MODULE, }; diff --git a/include/target/iscsi/iscsi_target_stat.h b/include/target/iscsi/iscsi_target_stat.h index c27dd47..36e9c9a 100644 --- a/include/target/iscsi/iscsi_target_stat.h +++ b/include/target/iscsi/iscsi_target_stat.h @@ -8,16 +8,16 @@ /* * For struct iscsi_tiqn->tiqn_wwn default groups */ -extern struct config_item_type iscsi_stat_instance_cit; -extern struct config_item_type iscsi_stat_sess_err_cit; -extern struct config_item_type iscsi_stat_tgt_attr_cit; -extern struct config_item_type iscsi_stat_login_cit; -extern struct config_item_type iscsi_stat_logout_cit; +extern const struct config_item_type iscsi_stat_instance_cit; +extern const struct config_item_type iscsi_stat_sess_err_cit; +extern const struct config_item_type iscsi_stat_tgt_attr_cit; +extern const struct config_item_type iscsi_stat_login_cit; +extern const struct config_item_type iscsi_stat_logout_cit; /* * For struct iscsi_session->se_sess default groups */ -extern struct config_item_type iscsi_stat_sess_cit; +extern const struct config_item_type iscsi_stat_sess_cit; /* iSCSI session error types */ #define ISCSI_SESS_ERR_UNKNOWN 0 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: 826372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="htR8WZhT"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2H40rt0z9t3w for ; Tue, 17 Oct 2017 02:26:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753870AbdJPPZ4 (ORCPT ); Mon, 16 Oct 2017 11:25:56 -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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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); From patchwork Mon Oct 16 15:18:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826369 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P8hiPDYQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2FT6RQWz9rvt for ; Tue, 17 Oct 2017 02:25:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753655AbdJPPYt (ORCPT ); Mon, 16 Oct 2017 11:24:49 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55192 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753724AbdJPPTX (ORCPT ); Mon, 16 Oct 2017 11:19:23 -0400 Received: by mail-wm0-f66.google.com with SMTP id i124so4460719wmf.3; Mon, 16 Oct 2017 08:19:20 -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=tHt6p5iAPU9uULv5yRc1EXusJ5CNYDPMq+rmPrwzLEA=; b=P8hiPDYQ7FWvGRqpUxfOlO5U+3tO6gLD7nsFVP4GpHuXXVs70Tacj2A8KOHF9SKiZN lMWQufWojapjGdwLr7VUdsbCDgDkq9Ugrk7kB/RxpH1vsh7Qd/M5Z6SuJlbsGq2fG188 1mum5681iHF87Yc1RS3z9R2NWnYz7CGltA89ZnnxxT2r/gDg5zATVkkfzw+pBZVrpeFx t9lvVm8nqk0Cg/Wdm1j0pR1H8fDd+WyUN4mSD/q6I6CE4qroqwpv9UUXlQKCU/Kw6oOo KfGikXsMUtX0WiuHnFBVccM3ZUxy//9deWrp+Gzy+OneWG6bITiJ7dhgU5PApR/MGz/w L2hw== 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=tHt6p5iAPU9uULv5yRc1EXusJ5CNYDPMq+rmPrwzLEA=; b=cw228cjXUjp7OBMd6YWi8ZkXRSjnUkTMI76apuAwN+XO++DBRXhQlKW1Z6LLTbR2K7 EIKIkv4KuYCmJBI8hMhVKIGV9C25dnYcZfxhdDZ59yGg4fGsjjn+6rvvtL48iiO1PBmv EEgOWJeLDi1ddw3D42FcKAFzzASAD6USfbMiAkfIrL0tJwRqH112S6SNQdp7w0KV39kh pYsOQwpgPkqXaLDhxH+qpNUtV4NblZiwkGUvG8KzvU58GI8Mm7d+qXYWk4A2gDr6xtlE f8HUrXuOg6IaMs8jqkWyHZ0TDGI6fUGQNMfJdqkD5EUmfjOJHDqE4APL5WmmN2Ya45af OhUQ== X-Gm-Message-State: AMCzsaXi3ps23DV8YJHp5HJ8u2rUbMNfb07DvcCXzcb3awa67Y37j11r n/S1JdB9W7aVLMw7KsGR5oA= X-Google-Smtp-Source: ABhQp+TV8Hs0xB03fkEZ6da0rsqhZc6UYDU/jBPBDEwB6LY0eGwyII0urcNPwYflev2cLFHcoux55A== X-Received: by 10.28.156.23 with SMTP id f23mr1313278wme.128.1508167160189; Mon, 16 Oct 2017 08:19:20 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id b190sm8655214wma.22.2017.10.16.08.19.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:19 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:18 +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 05/15] ocfs2/cluster: make config_item_type const Date: Mon, 16 Oct 2017 17:18:44 +0200 Message-Id: <1508167134-6243-6-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make these structures const as they are either passed to the functions having the argument as const or stored as a reference in the "ci_type" const field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal --- * Changes in v2- Combine all the followup patches and the constification patches into a series. fs/ocfs2/cluster/heartbeat.c | 4 ++-- fs/ocfs2/cluster/nodemanager.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index d020604..ea8c551 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -2025,7 +2025,7 @@ static ssize_t o2hb_region_pid_show(struct config_item *item, char *page) .release = o2hb_region_release, }; -static struct config_item_type o2hb_region_type = { +static const struct config_item_type o2hb_region_type = { .ct_item_ops = &o2hb_region_item_ops, .ct_attrs = o2hb_region_attrs, .ct_owner = THIS_MODULE, @@ -2310,7 +2310,7 @@ static ssize_t o2hb_heartbeat_group_mode_store(struct config_item *item, .drop_item = o2hb_heartbeat_group_drop_item, }; -static struct config_item_type o2hb_heartbeat_group_type = { +static const struct config_item_type o2hb_heartbeat_group_type = { .ct_group_ops = &o2hb_heartbeat_group_group_ops, .ct_attrs = o2hb_heartbeat_group_attrs, .ct_owner = THIS_MODULE, diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c index b17d180..a51200e 100644 --- a/fs/ocfs2/cluster/nodemanager.c +++ b/fs/ocfs2/cluster/nodemanager.c @@ -378,7 +378,7 @@ static ssize_t o2nm_node_local_store(struct config_item *item, const char *page, .release = o2nm_node_release, }; -static struct config_item_type o2nm_node_type = { +static const struct config_item_type o2nm_node_type = { .ct_item_ops = &o2nm_node_item_ops, .ct_attrs = o2nm_node_attrs, .ct_owner = THIS_MODULE, @@ -619,7 +619,7 @@ static void o2nm_node_group_drop_item(struct config_group *group, .drop_item = o2nm_node_group_drop_item, }; -static struct config_item_type o2nm_node_group_type = { +static const struct config_item_type o2nm_node_group_type = { .ct_group_ops = &o2nm_node_group_group_ops, .ct_owner = THIS_MODULE, }; @@ -637,7 +637,7 @@ static void o2nm_cluster_release(struct config_item *item) .release = o2nm_cluster_release, }; -static struct config_item_type o2nm_cluster_type = { +static const struct config_item_type o2nm_cluster_type = { .ct_item_ops = &o2nm_cluster_item_ops, .ct_attrs = o2nm_cluster_attrs, .ct_owner = THIS_MODULE, @@ -722,7 +722,7 @@ static void o2nm_cluster_group_drop_item(struct config_group *group, struct conf .drop_item = o2nm_cluster_group_drop_item, }; -static struct config_item_type o2nm_cluster_group_type = { +static const struct config_item_type o2nm_cluster_group_type = { .ct_group_ops = &o2nm_cluster_group_group_ops, .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FCy/W+hl"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2CP39pmz9t3w for ; Tue, 17 Oct 2017 02:23:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbdJPPTb (ORCPT ); Mon, 16 Oct 2017 11:19:31 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:57183 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774AbdJPPTZ (ORCPT ); Mon, 16 Oct 2017 11:19:25 -0400 Received: by mail-wm0-f66.google.com with SMTP id l68so4432101wmd.5; Mon, 16 Oct 2017 08:19:23 -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=8Jisqxw7A/ZtIMfpfNeZkI06QYwTeoJ8cJPTYsVTubo=; b=FCy/W+hlZqM0DdV+elJg99MrW/X1D4YFX55fTPYWUf/QFxmoa1gO4fJvGar1v6wpOg w4AZG3nasDD/76SODqf7oxwlPZR3iqt84PEaCHpfyIfYOImcRSSaALjVZ+rhdMUMvTyj xh/UzaLp2sBt5nW898KZNzFF7HXvG5xhvq/+ojANTNiPrlT8Ah61ppJdc0bLuSvG5gy+ g3ChYMyX5lFz9aJJCiAJf8z7U2EvC3g/QwwMDhcNDkKqdiMiCm1eSkXsUs4dJNu5i0qi Z6dqN7zQiLNkhS+dpTCOBlPyG4AGXQpWoPRoA5UW1fddAdoBhtS0QBqgssR9hgOn7O14 WWVQ== 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=8Jisqxw7A/ZtIMfpfNeZkI06QYwTeoJ8cJPTYsVTubo=; b=dG6IYLl5qSrpOz7G7UP+z4MnXmcXxzmefq2ZbKpsyFA0Ua2rb//7fGT66BD7WQzD+f K7o5FB1GbSyzM8rsFGoYd7YFO/4JgnVhQikMxZAUEMxDQG9FVpC+pyCYYpGuvvCeao4C HCQhvto9QzAUJELtJolrSH/1JLt1OXxF5Wziq7Zfvp534VseLXrh3DFOiFPzZOIcFKoT BkPg2WNjBBxvEBXYKroZ4BNFVxU+2rYiy40fPpqSsstwx8ESbzQIqnPrJK2+tWb0ds3U xmaEoF26K/mK2Eo//Tq0xiRzCDfczM7X+m8BBjLStwC6QHWE/aXOVJdz718d1h6Qkhvn TEAQ== X-Gm-Message-State: AMCzsaVAPy+CdT7qTTpfG/vhPzhW1OkR3XZlRIr3A3hpElmetbRXCvx0 jbW1YhnWmxoI/UTCFfvrlZY= X-Google-Smtp-Source: ABhQp+RD4TQ6QV1LOpY2StLIuzwQNcCmN8rJcEkJDhYLnjtCRQhtnkB5mQ95QNA7gfS1Fc8OK4AD9A== X-Received: by 10.223.186.140 with SMTP id p12mr856257wrg.235.1508167162791; Mon, 16 Oct 2017 08:19:22 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id d1sm2036436wre.85.2017.10.16.08.19.20 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:22 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:20 +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 06/15] PCI: endpoint: make config_item_type const Date: Mon, 16 Oct 2017 17:18:45 +0200 Message-Id: <1508167134-6243-7-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make config_item_type structures const as they are either passed to a function having the argument as const or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal Acked-by: Bjorn Helgaas --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/pci/endpoint/pci-ep-cfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c index 424fdd6..4f74386 100644 --- a/drivers/pci/endpoint/pci-ep-cfs.c +++ b/drivers/pci/endpoint/pci-ep-cfs.c @@ -150,7 +150,7 @@ static void pci_epc_epf_unlink(struct config_item *epc_item, .drop_link = pci_epc_epf_unlink, }; -static struct config_item_type pci_epc_type = { +static const struct config_item_type pci_epc_type = { .ct_item_ops = &pci_epc_item_ops, .ct_attrs = pci_epc_attrs, .ct_owner = THIS_MODULE, @@ -361,7 +361,7 @@ static void pci_epf_release(struct config_item *item) .release = pci_epf_release, }; -static struct config_item_type pci_epf_type = { +static const struct config_item_type pci_epf_type = { .ct_item_ops = &pci_epf_ops, .ct_attrs = pci_epf_attrs, .ct_owner = THIS_MODULE, @@ -400,7 +400,7 @@ static void pci_epf_drop(struct config_group *group, struct config_item *item) .drop_item = &pci_epf_drop, }; -static struct config_item_type pci_epf_group_type = { +static const struct config_item_type pci_epf_group_type = { .ct_group_ops = &pci_epf_group_ops, .ct_owner = THIS_MODULE, }; @@ -428,15 +428,15 @@ void pci_ep_cfs_remove_epf_group(struct config_group *group) } EXPORT_SYMBOL(pci_ep_cfs_remove_epf_group); -static struct config_item_type pci_functions_type = { +static const struct config_item_type pci_functions_type = { .ct_owner = THIS_MODULE, }; -static struct config_item_type pci_controllers_type = { +static const struct config_item_type pci_controllers_type = { .ct_owner = THIS_MODULE, }; -static struct config_item_type pci_ep_type = { +static const struct config_item_type pci_ep_type = { .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y79xK9F8"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2Dd46gRz9t3w for ; Tue, 17 Oct 2017 02:24:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752490AbdJPPYB (ORCPT ); Mon, 16 Oct 2017 11:24:01 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:47510 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753804AbdJPPT3 (ORCPT ); Mon, 16 Oct 2017 11:19:29 -0400 Received: by mail-wm0-f68.google.com with SMTP id t69so4459137wmt.2; Mon, 16 Oct 2017 08:19:27 -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=jJ+8RfSotZKPLt3Jm4JT+bvvytcaMEj/vmqLTDP2S+8=; b=Y79xK9F8sw+/ujmk41HW9c8Gcrho11qVr9Z7GKmYvPweijMwGi5inOb1L0aZQejlZv sFrY2YZiRH4Wppsdrg78Ziyc+aaWVyTvbKZuzDMENuUVqvmP0CMxbkXFew8ckjjtpoOy Dk+kJDmgness7L+NW9MqxiQJDShqotdCllEODRMM2g4WhZVHE70//zcJb6dofBcPKfHr nWWyRzQBFKtIMcHygqsDoWm9rpG1Bd/cnYH9MlsZePQ834v5hG5ZiNc4DiQJw+ZXc3PS AffDRocBsUoY9uzkarQbVQLQuCCRmERgP4087VUwSAzyifGJiKTfXfJtv9Tu+2bBy1Og /inQ== 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=jJ+8RfSotZKPLt3Jm4JT+bvvytcaMEj/vmqLTDP2S+8=; b=tI6Xbp2N5WPnsT4fVRSoa+KVpyFvxsaYmNY/I/680dsyJO4qNuAp/BKlpGXLoAlzzT V5ZARdE/15UCC5QpM/0uUt0awW8jON5Jo1L+dU2ONwhieWqLmZSJ6/gTrMMMLoUcMaDU PHxQcNL50NJmu+NL3fBxX2QeJ/1yYllq+0MGsIJut8QSYZCA2G0haYa+5kjGGKW0OPYO 5kdBzNWPb98rALhxkZhQ2ECkqksNSV2bjLS4+2/ownhDE9iurJlxbavnSvHKF+k/5kAn PBXoji2je+ZWIfw9s0FuszU4zJwo02xp6ze8i4Vvl9ANHvVFRIAvtMCZmqE+MewkDx5M 0LFg== X-Gm-Message-State: AMCzsaWglxkkaTTtqIFxQQ+cEoFpzx6EOvpFEbilCGpXIWESZbCWkjk8 CJYFHw3I7LGIG/ruWvq0RmQ= X-Google-Smtp-Source: ABhQp+Q8Tzc+m7unIaQL6sSe3QT+P+ZUBwiiufFSrKh0BskF5JEyoVrDgE0NhsSFaFP5sTgcH82aYQ== X-Received: by 10.28.69.8 with SMTP id s8mr1052847wma.65.1508167165399; Mon, 16 Oct 2017 08:19:25 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id i16sm13329597wrf.19.2017.10.16.08.19.23 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:24 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:23 +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 07/15] usb: gadget: configfs: make config_item_type const Date: Mon, 16 Oct 2017 17:18:46 +0200 Message-Id: <1508167134-6243-8-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make config_item_type structures const as they are either passed to a function having the argument as const or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal Acked-by: Felipe Balbi --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/usb/gadget/configfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index aeb9f3c..9d18b99 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -505,13 +505,13 @@ static ssize_t gadget_config_desc_bmAttributes_store(struct config_item *item, NULL, }; -static struct config_item_type gadget_config_type = { +static const struct config_item_type gadget_config_type = { .ct_item_ops = &gadget_config_item_ops, .ct_attrs = gadget_config_attrs, .ct_owner = THIS_MODULE, }; -static struct config_item_type gadget_root_type = { +static const struct config_item_type gadget_root_type = { .ct_item_ops = &gadget_root_item_ops, .ct_attrs = gadget_root_attrs, .ct_owner = THIS_MODULE, @@ -593,7 +593,7 @@ static void function_drop( .drop_item = &function_drop, }; -static struct config_item_type functions_type = { +static const struct config_item_type functions_type = { .ct_group_ops = &functions_ops, .ct_owner = THIS_MODULE, }; @@ -694,7 +694,7 @@ static void config_desc_drop( .drop_item = &config_desc_drop, }; -static struct config_item_type config_desc_type = { +static const struct config_item_type config_desc_type = { .ct_group_ops = &config_desc_ops, .ct_owner = THIS_MODULE, }; @@ -1476,7 +1476,7 @@ static void gadgets_drop(struct config_group *group, struct config_item *item) .drop_item = &gadgets_drop, }; -static struct config_item_type gadgets_type = { +static const struct config_item_type gadgets_type = { .ct_group_ops = &gadgets_ops, .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Kgj/4Ann"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2Cm6QxRz9t3w for ; Tue, 17 Oct 2017 02:23:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753950AbdJPPXZ (ORCPT ); Mon, 16 Oct 2017 11:23:25 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:49042 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753821AbdJPPTb (ORCPT ); Mon, 16 Oct 2017 11:19:31 -0400 Received: by mail-wm0-f68.google.com with SMTP id i124so4405575wmf.3; Mon, 16 Oct 2017 08:19:29 -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=m2mTkeflinGWSxDP4kcTFh51STbx1Z1woq7uvhqkFOM=; b=Kgj/4AnndjfJjpiDLuTHMbOziCvwSDOinLidIG6Ce1zbJLEiIAFXr+AQwo12mNcbJC 3Ia1cNjgXAhif7RonvfGMwTFFXDLwnaZtGZv4AXgSBTrtIGuMFOr8Qd1NilG3cVQ7JkN busYMR7vLSm13m51ZjpzPDQqNMBOKR0Sz5ycQ07D25BTtOuP8TWlybCEUuzvTsM/ykEG F4LAwZH6TwI5pqxxqvKze9hBMr0FK/mhtBlA0vbEh6yLLeWWJDruR+atz6tq1AVtgX7Y Xnxeduu+wpIYS9JC5qvppO4oz502wuEH2ROtisoBo8dVZAHKiBTTK+OeGB1cZK5PRODm g3gg== 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=m2mTkeflinGWSxDP4kcTFh51STbx1Z1woq7uvhqkFOM=; b=mPfu5QMvGMSp6R67cOwNZIEXO6OXll4kPd0xUmVrP/ocWcOBp7IyVqv47nhpiPX8vQ UaR5QSM5MCMbQOqiEePOzgNS6huj6FU58jaBlvlEIupHj5W1yDuFtlIu3u2e48+U9MrG VDmPNji6g67rG1qRFz5gpj6mlRB0GBcUu7VhHaxgHIlwPfGZXdwDhvaC/Tt7fUc4+NNU 74Hbo0eIrxxIfDkdHY6bt4rR+D1fIYxKxLcww1oKEi7QUnIT59x237q7OnsjlFYAsOm0 X2afcF0cGF5RJlFZ+SvoRlw3On7g9QRtUC2fpYM0Nw8Xe9NPGy8D+V7Rstt5v91EaMI1 KS9g== X-Gm-Message-State: AMCzsaUWtmIrtDuHaL2agRSktARMIxSuDCMd8AmHEvBG751QL5s5q+a2 QJdvuk+k1nbwC/B70U9P52g= X-Google-Smtp-Source: ABhQp+QWkfAo73J2cIjiyIkohdlTpwV6N2VJzQ1HWLD1fJV8GjLSW5RCg+WOKt0PlGY9D07AnJLfdg== X-Received: by 10.223.134.250 with SMTP id 55mr971366wry.249.1508167168452; Mon, 16 Oct 2017 08:19:28 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id 188sm6149773wmg.45.2017.10.16.08.19.25 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:27 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:25 +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 08/15] nvmet: make config_item_type const Date: Mon, 16 Oct 2017 17:18:47 +0200 Message-Id: <1508167134-6243-9-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make config_item_type structures const as they are either passed to a function having the argument as const or used inside an if statement or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle Signed-off-by: Bhumika Goyal Acked-by: Sagi Grimberg --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/nvme/target/configfs.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index b6aeb1d..e6b2d2a 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c @@ -20,8 +20,8 @@ #include "nvmet.h" -static struct config_item_type nvmet_host_type; -static struct config_item_type nvmet_subsys_type; +static const struct config_item_type nvmet_host_type; +static const struct config_item_type nvmet_subsys_type; /* * nvmet_port Generic ConfigFS definitions. @@ -425,7 +425,7 @@ static void nvmet_ns_release(struct config_item *item) .release = nvmet_ns_release, }; -static struct config_item_type nvmet_ns_type = { +static const struct config_item_type nvmet_ns_type = { .ct_item_ops = &nvmet_ns_item_ops, .ct_attrs = nvmet_ns_attrs, .ct_owner = THIS_MODULE, @@ -464,7 +464,7 @@ static struct config_group *nvmet_ns_make(struct config_group *group, .make_group = nvmet_ns_make, }; -static struct config_item_type nvmet_namespaces_type = { +static const struct config_item_type nvmet_namespaces_type = { .ct_group_ops = &nvmet_namespaces_group_ops, .ct_owner = THIS_MODULE, }; @@ -540,7 +540,7 @@ static void nvmet_port_subsys_drop_link(struct config_item *parent, .drop_link = nvmet_port_subsys_drop_link, }; -static struct config_item_type nvmet_port_subsys_type = { +static const struct config_item_type nvmet_port_subsys_type = { .ct_item_ops = &nvmet_port_subsys_item_ops, .ct_owner = THIS_MODULE, }; @@ -613,7 +613,7 @@ static void nvmet_allowed_hosts_drop_link(struct config_item *parent, .drop_link = nvmet_allowed_hosts_drop_link, }; -static struct config_item_type nvmet_allowed_hosts_type = { +static const struct config_item_type nvmet_allowed_hosts_type = { .ct_item_ops = &nvmet_allowed_hosts_item_ops, .ct_owner = THIS_MODULE, }; @@ -729,7 +729,7 @@ static void nvmet_subsys_release(struct config_item *item) .release = nvmet_subsys_release, }; -static struct config_item_type nvmet_subsys_type = { +static const struct config_item_type nvmet_subsys_type = { .ct_item_ops = &nvmet_subsys_item_ops, .ct_attrs = nvmet_subsys_attrs, .ct_owner = THIS_MODULE, @@ -767,7 +767,7 @@ static struct config_group *nvmet_subsys_make(struct config_group *group, .make_group = nvmet_subsys_make, }; -static struct config_item_type nvmet_subsystems_type = { +static const struct config_item_type nvmet_subsystems_type = { .ct_group_ops = &nvmet_subsystems_group_ops, .ct_owner = THIS_MODULE, }; @@ -827,7 +827,7 @@ static void nvmet_referral_release(struct config_item *item) .release = nvmet_referral_release, }; -static struct config_item_type nvmet_referral_type = { +static const struct config_item_type nvmet_referral_type = { .ct_owner = THIS_MODULE, .ct_attrs = nvmet_referral_attrs, .ct_item_ops = &nvmet_referral_item_ops, @@ -852,7 +852,7 @@ static struct config_group *nvmet_referral_make( .make_group = nvmet_referral_make, }; -static struct config_item_type nvmet_referrals_type = { +static const struct config_item_type nvmet_referrals_type = { .ct_owner = THIS_MODULE, .ct_group_ops = &nvmet_referral_group_ops, }; @@ -880,7 +880,7 @@ static void nvmet_port_release(struct config_item *item) .release = nvmet_port_release, }; -static struct config_item_type nvmet_port_type = { +static const struct config_item_type nvmet_port_type = { .ct_attrs = nvmet_port_attrs, .ct_item_ops = &nvmet_port_item_ops, .ct_owner = THIS_MODULE, @@ -921,7 +921,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group, .make_group = nvmet_ports_make, }; -static struct config_item_type nvmet_ports_type = { +static const struct config_item_type nvmet_ports_type = { .ct_group_ops = &nvmet_ports_group_ops, .ct_owner = THIS_MODULE, }; @@ -940,7 +940,7 @@ static void nvmet_host_release(struct config_item *item) .release = nvmet_host_release, }; -static struct config_item_type nvmet_host_type = { +static const struct config_item_type nvmet_host_type = { .ct_item_ops = &nvmet_host_item_ops, .ct_owner = THIS_MODULE, }; @@ -963,14 +963,14 @@ static struct config_group *nvmet_hosts_make_group(struct config_group *group, .make_group = nvmet_hosts_make_group, }; -static struct config_item_type nvmet_hosts_type = { +static const struct config_item_type nvmet_hosts_type = { .ct_group_ops = &nvmet_hosts_group_ops, .ct_owner = THIS_MODULE, }; static struct config_group nvmet_hosts_group; -static struct config_item_type nvmet_root_type = { +static const struct config_item_type nvmet_root_type = { .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l/dRlc3P"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2CF2Vnbz9rvt for ; Tue, 17 Oct 2017 02:23:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753878AbdJPPWy (ORCPT ); Mon, 16 Oct 2017 11:22:54 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:49629 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753856AbdJPPTd (ORCPT ); Mon, 16 Oct 2017 11:19:33 -0400 Received: by mail-wm0-f65.google.com with SMTP id b189so4388253wmd.4; Mon, 16 Oct 2017 08:19:31 -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=vNbhovj+ZgchOjK9zepAXY42xEC4uAg1IujriqlgIYo=; b=l/dRlc3P5GwgNj7knLWoEmRqpk5Olt19K5bT6f8VfjwO3J/2Gx2b3XvtHii42cYHsp oZYRwSJqm5tm3QwIMm0hAw+4PvgnzoI3u4MdNEHWW7yZFg4ovZrtUQG+9BkmYLccKwjI WCv7pT0awpWTRpE0zAVCvdVY8BBJ0IZ4MEm/I6M34+OgOeW4hfIvD8vHr6I5YVsvbowj x3MoAxzfPVaDdxePhkwGtNfd2bWoRsVAfKHTNuPCGFydkMV0/vu8cMyeMkYJ26gsYQFy YHJuHDwlNzxT4xBghGTr2saZC7Hg2Kho0jtopCzno/X/0MC+78UJApwewM96Hqqg3255 u2UQ== 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=vNbhovj+ZgchOjK9zepAXY42xEC4uAg1IujriqlgIYo=; b=EB/FqHRUuYfsNVFM9JE79U6s6IQWPdqyneSgFaFh0GsWrCBVFLRK2cbIAlcDdCf6g5 5RSClC0MjhoNeI2RYRjWfk2Hi3X92AJlQXqH/SLzR3adw7PObzTgHc5v+EKKtklRjWtY y3XjCV0wcAKar29ZdxO9PFhZQqrlJT/M0RiVPVSvgw8FDbyxQd2EjASG96IHU3VrdWGk SG52t30CdftNmclHYJnge/4tKInU6+ZHLAHv+Lty+H2EcbwVygFsbGGvMOEF8LPReWAY YjgaFUKOgigDxpts/9GoanM3DpT6YGKEhFQDv0iLWkqc9PNdNJqPNzKiQtsSgJCHy08M 5UcA== X-Gm-Message-State: AMCzsaX9h2LeKJ87w+I0QTB7rcO3Z4+i+5bauLCDqIfRPfJhRlHtl9Y9 7Hqh9tTwRtFk4589RdA1CEM= X-Google-Smtp-Source: ABhQp+TUYq1m60Tkx8LcOwsxaKcRvhUy1Oz+pUIQ1CZ2AOdRcIxMklz0V/PWYTPQ5z121GeJzlWTOg== X-Received: by 10.223.197.17 with SMTP id q17mr906064wrf.270.1508167171130; Mon, 16 Oct 2017 08:19:31 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id f192sm3846750wmg.6.2017.10.16.08.19.28 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:30 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:29 +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 09/15] ACPI: configfs: make config_item_type const Date: Mon, 16 Oct 2017 17:18:48 +0200 Message-Id: <1508167134-6243-10-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make these structures const as they are either passed to the functions having the argument as const or stored as a reference in the "ci_type" const field of a config_item structure. Done using Coccienlle. Signed-off-by: Bhumika Goyal Acked-by: Rafael J. Wysocki --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/acpi/acpi_configfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c index 853bc7f..b588503 100644 --- a/drivers/acpi/acpi_configfs.c +++ b/drivers/acpi/acpi_configfs.c @@ -204,7 +204,7 @@ struct configfs_attribute *acpi_table_attrs[] = { NULL, }; -static struct config_item_type acpi_table_type = { +static const struct config_item_type acpi_table_type = { .ct_owner = THIS_MODULE, .ct_bin_attrs = acpi_table_bin_attrs, .ct_attrs = acpi_table_attrs, @@ -237,12 +237,12 @@ struct configfs_group_operations acpi_table_group_ops = { .drop_item = acpi_table_drop_item, }; -static struct config_item_type acpi_tables_type = { +static const struct config_item_type acpi_tables_type = { .ct_owner = THIS_MODULE, .ct_group_ops = &acpi_table_group_ops, }; -static struct config_item_type acpi_root_group_type = { +static const struct config_item_type acpi_root_group_type = { .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BPJisOJY"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2Bm2cNLz9rvt for ; Tue, 17 Oct 2017 02:22:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753620AbdJPPWX (ORCPT ); Mon, 16 Oct 2017 11:22:23 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52449 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774AbdJPPTg (ORCPT ); Mon, 16 Oct 2017 11:19:36 -0400 Received: by mail-wm0-f67.google.com with SMTP id k4so4486247wmc.1; Mon, 16 Oct 2017 08:19:34 -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=sEffZ+lNae14fRGRadV9cb7iTK0/4epStOyWUSJHIEY=; b=BPJisOJYEbw9LWBXgvT4kgKUTXMswOxmKpqFLPrY7pqTiWt4W2U3LMqlMzT3YURUCn VY60XKD2Jq2GwZaNc7oCKop+6D1r+SSpurHRhJNfsdL/1zNDXAxddKjUWb6Vm+dBwGFw EnEYDldKwOLMgiL98/OLDhzUCxBX/gunqrGicFuw6uRIhjLQp1wkMXNYFkXnfFSLet8E BXO7ZZP+IFeyJJK0106jlmfY0iHTT1HM3WBV1uQj6VK/XUj3YKWDHAHPd4HmvgqJAhpm m2vHJTUY/gJuH1VbFqZh5RhxicrYonR+SXZsNbaDDwyuf8PaX76WwJrtY48HZMxnB9wQ X+bQ== 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=sEffZ+lNae14fRGRadV9cb7iTK0/4epStOyWUSJHIEY=; b=Ymp39UTw2pZ3PDWZ7JGsKY/EuEKugn3jUQdVByfWvBLiEzHQmxxbk6po09SsBI+xZq jJUki6HNO/t0fmymTs45YGEGAKZ4zQVTjPZObWOsuBPntuCMt3rGIXTLFFd208EXzRRM JcTKHCp7CK3BWBtN11Dv9LnwfJbquLf601xFLbNBnujfboc44uOujGThdxess907UElw 6jas0iZhwTDCNIPHiLICH/ImlgUg8MvtAktNd3Taje0rG5HdF2s/+hCdUd3cCaLROIyB jlzxf+GzUpaSabPiHfc0WxM5L0mm7V37aCRb1liArtZ4IKy1Lyau8v+J+hTtVEZ7KitJ aprA== X-Gm-Message-State: AMCzsaW9L+xcmXhC9B7zuYckmzfMR7JplJnyo1Vw5Fop2CWxPCpqbqmp WQEv96MdLVit/LYhhegR+2A= X-Google-Smtp-Source: ABhQp+SX1BCtJKJjo7NmeE4LuZMw+O9+41tyecMgHIQCSQ4aUbvRrUr6ehqZXHRelQqTaJE66j5+nQ== X-Received: by 10.28.51.19 with SMTP id z19mr1123215wmz.18.1508167173997; Mon, 16 Oct 2017 08:19:33 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id g16sm6612925wrd.72.2017.10.16.08.19.31 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:33 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:31 +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 10/15] nullb: make config_item_type const Date: Mon, 16 Oct 2017 17:18:49 +0200 Message-Id: <1508167134-6243-11-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make these structures const as they are either passed to the functions having the argument as const or stored as a reference in the "ci_type" const field of a config_item structure. Done using Coccienlle. Signed-off-by: Bhumika Goyal --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/block/null_blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index bf2c8ca..46b6008 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -480,7 +480,7 @@ static void nullb_device_release(struct config_item *item) .release = nullb_device_release, }; -static struct config_item_type nullb_device_type = { +static const struct config_item_type nullb_device_type = { .ct_item_ops = &nullb_device_ops, .ct_attrs = nullb_device_attrs, .ct_owner = THIS_MODULE, @@ -532,7 +532,7 @@ static ssize_t memb_group_features_show(struct config_item *item, char *page) .drop_item = nullb_group_drop_item, }; -static struct config_item_type nullb_group_type = { +static const struct config_item_type nullb_group_type = { .ct_group_ops = &nullb_group_ops, .ct_attrs = nullb_group_attrs, .ct_owner = THIS_MODULE, From patchwork Mon Oct 16 15:18:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h2Pn7r2H"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG29N5wCGz9t3w for ; Tue, 17 Oct 2017 02:21:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753713AbdJPPTn (ORCPT ); Mon, 16 Oct 2017 11:19:43 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:57262 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753877AbdJPPTj (ORCPT ); Mon, 16 Oct 2017 11:19:39 -0400 Received: by mail-wm0-f68.google.com with SMTP id l68so4434355wmd.5; Mon, 16 Oct 2017 08:19:37 -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=XOOZFt79zgAN+U/r/9AY1uKAfp/G9ydbuJYZFFJLpw0=; b=h2Pn7r2Hzcsek9Od1Qm6H5aruKq/RH+aG85V/mRRKk56bVzamw4oBr/H+ALyDppuyk VaykSM8gdG+/qfj8U+GcfkWEf7u3K2aWhSPp59s8ibp9VkQkdT6Qaf/gQP8g50RxQa3Y zBjDRXul/gIvhYoceCapxXCjPd2AUFJiA25zYq5uubNBKzQFPvy0yuIaP3UhrYwM2+R2 BHwCDCarUDzyPhomTNq4LOPSmS1HEBLF/hCu5GCXyU9RwBRARmT85PduJsE5KU5XG+ob b4DlHYfAjp8ZX6kvYd5PxPJAeh7u3QxBoV7Eh+Tk9TvoMiHEVlm8t1/OrTl5XZMmULJn rd8Q== 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=XOOZFt79zgAN+U/r/9AY1uKAfp/G9ydbuJYZFFJLpw0=; b=XIzxBQpsYUTr5dGNswDXP2XQGinTkv2JPkyz8BFgorPL1H4c++LSSwX5TkWadmJ7qJ uoJil8c/rY9vbbkhRrh7EEblIzrQdnvUgkpeHwHheRk8sOduyILbIpMHcJGa4wzv4NNb 0L+gOD1ST5UGxM3yj6A4rvWtICjLNQzcPbft3w2KO0Kz7ZXvDxc85y3XFyoTepBEC7PN qCPqHINUozsrvq5ZFVeVATqsaE2+16OaqoDIIombyrrDBpCwR8G8YExM1jh47gBVW73t sz3AASeSa5ZpmBUpbL87XXOhuHlesNTam00kAZ75CBKmgm6QPJI65FiImPgIRxH3dyPB XEHg== X-Gm-Message-State: AMCzsaU9rfY0ysndL5MK1mvjeHuVxhAksWzlCxTHJUUztJgoyMUJxV5o 88saP8c3rZI41jC36qjVtn8= X-Google-Smtp-Source: ABhQp+S3GektJhYq8cEWN/OQN33btZFqx/YAL4e+BYONqEnVyAHXyoj0s+ounBUFxGrd5ySdYrii0w== X-Received: by 10.223.130.42 with SMTP id 39mr986866wrb.241.1508167176809; Mon, 16 Oct 2017 08:19:36 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id p20sm8610734wma.0.2017.10.16.08.19.34 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:36 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:34 +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 11/15] stm class: make config_item_type const Date: Mon, 16 Oct 2017 17:18:50 +0200 Message-Id: <1508167134-6243-12-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make config_item_type structures const as they are either passed to a function having the argument as const or used inside a if statement or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal Acked-by: Greg Kroah-Hartman --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/hwtracing/stm/policy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c index 6c0ae29..33e9a1b 100644 --- a/drivers/hwtracing/stm/policy.c +++ b/drivers/hwtracing/stm/policy.c @@ -187,8 +187,8 @@ static void stp_policy_node_release(struct config_item *item) NULL, }; -static struct config_item_type stp_policy_type; -static struct config_item_type stp_policy_node_type; +static const struct config_item_type stp_policy_type; +static const struct config_item_type stp_policy_node_type; static struct config_group * stp_policy_node_make(struct config_group *group, const char *name) @@ -236,7 +236,7 @@ static void stp_policy_node_release(struct config_item *item) .drop_item = stp_policy_node_drop, }; -static struct config_item_type stp_policy_node_type = { +static const struct config_item_type stp_policy_node_type = { .ct_item_ops = &stp_policy_node_item_ops, .ct_group_ops = &stp_policy_node_group_ops, .ct_attrs = stp_policy_node_attrs, @@ -311,7 +311,7 @@ static void stp_policy_release(struct config_item *item) .make_group = stp_policy_node_make, }; -static struct config_item_type stp_policy_type = { +static const struct config_item_type stp_policy_type = { .ct_item_ops = &stp_policy_item_ops, .ct_group_ops = &stp_policy_group_ops, .ct_attrs = stp_policy_attrs, @@ -380,7 +380,7 @@ static void stp_policy_release(struct config_item *item) .make_group = stp_policies_make, }; -static struct config_item_type stp_policies_type = { +static const struct config_item_type stp_policies_type = { .ct_group_ops = &stp_policies_group_ops, .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rdqESS9D"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG29x3Pc9z9rvt for ; Tue, 17 Oct 2017 02:22:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753656AbdJPPVr (ORCPT ); Mon, 16 Oct 2017 11:21:47 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:47589 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752950AbdJPPTn (ORCPT ); Mon, 16 Oct 2017 11:19:43 -0400 Received: by mail-wm0-f66.google.com with SMTP id t69so4461636wmt.2; Mon, 16 Oct 2017 08:19:41 -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=oAjYTux5fn0KTlQxYrzyy3ythPqqKA906lfvKKC6NGc=; b=rdqESS9D2sLsYr/fo1S3T3u9rxtH/ft77SeHYMq0K2G/jcB/TwRlRQdRPWr1jVvtyt KV/hwJlSGQFEtUCqGG9dBpz2GS5ZjCr8zDqq8JXmeHWgSyoPpKXrSjPKdunPZ1LhzkxK jjz+QCpPGgSFOAs9bGrN0ldX6tYTd5mx4i0vFJWQywt079REIeTWbZzg5wGHfdTOejyM TUYA9mcb0P4hmMUCNGjjzgjme4FdmDPwkFDsgEMMX2TLjIUfCjk/QYSqiXzXrNGHSOwh 2wmoleo+0Uve5B27f9gFq0qQhn0Ld0xFbWPl+skI26Y//NPHsI3TxOUz4ZG2J3W+aybv nmhA== 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=oAjYTux5fn0KTlQxYrzyy3ythPqqKA906lfvKKC6NGc=; b=NTWJd1EyqNUTbGMJVlpZeKCHBvHtPrhDVq4Dkbk9Hs4+LK1IRTdWHlE8Hx1Isg90hs zD+xNAXYn//ycRyilaVPrInJYN1TQ/LJ5Bzqrw20brRp2XUE+9aO8GAlRirnAhQVpeHR V3AfmX6Hsx6+JafNBUwHQ3cIa+GLv46rZRDcePgeze2akyaoKI0cig69vzMOJozS0qlG vw9bZReSlvNFxDuT7M+YpgIH0zW8rz9DX+gBXxbdUKunbrq/InfBKcBnYXDtlA/mhzXH g3XiT1BboBscZOOpO3n0hh9wMvCFfaS4CGaJjt7Oc0ppNukuGReAE5p7P1yye0i1fLJG Q2uQ== X-Gm-Message-State: AMCzsaUbWznDaQnJiwhQbn7cqQCYF/JL3fTjw+pYdvhK7rGzzRpGDN87 EGmawfMg68BAiO+eKD3P4HM= X-Google-Smtp-Source: ABhQp+TzhUonQTTNc+ZXyhGX1M6frQsZMvLG7F3aiU45pBH3BkXXfVA9Bn0oUXgGF9o8+WvYPMDUKg== X-Received: by 10.28.150.194 with SMTP id y185mr1115432wmd.54.1508167179957; Mon, 16 Oct 2017 08:19:39 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id j2sm7435106wrj.82.2017.10.16.08.19.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:39 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:37 +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 12/15] RDMA/cma: make config_item_type const Date: Mon, 16 Oct 2017 17:18:51 +0200 Message-Id: <1508167134-6243-13-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make these structures const as they are either passed to the functions having the argument as const or stored as a reference in the "ci_type" const field of a config_item structure. Signed-off-by: Bhumika Goyal Reviewed-by: Leon Romanovsky Acked-by: Doug Ledford --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/infiniband/core/cma_configfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c index 54076a3..31dfee0 100644 --- a/drivers/infiniband/core/cma_configfs.c +++ b/drivers/infiniband/core/cma_configfs.c @@ -186,7 +186,7 @@ static ssize_t default_roce_tos_store(struct config_item *item, NULL, }; -static struct config_item_type cma_port_group_type = { +static const struct config_item_type cma_port_group_type = { .ct_attrs = cma_configfs_attributes, .ct_owner = THIS_MODULE }; @@ -263,7 +263,7 @@ static void release_cma_ports_group(struct config_item *item) .release = release_cma_ports_group }; -static struct config_item_type cma_ports_group_type = { +static const struct config_item_type cma_ports_group_type = { .ct_item_ops = &cma_ports_item_ops, .ct_owner = THIS_MODULE }; @@ -272,7 +272,7 @@ static void release_cma_ports_group(struct config_item *item) .release = release_cma_dev }; -static struct config_item_type cma_device_group_type = { +static const struct config_item_type cma_device_group_type = { .ct_item_ops = &cma_device_item_ops, .ct_owner = THIS_MODULE }; @@ -323,7 +323,7 @@ static struct config_group *make_cma_dev(struct config_group *group, .make_group = make_cma_dev, }; -static struct config_item_type cma_subsys_type = { +static const struct config_item_type cma_subsys_type = { .ct_group_ops = &cma_subsys_group_ops, .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WgBdYv1k"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG28q4GClz9rvt for ; Tue, 17 Oct 2017 02:21:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914AbdJPPTv (ORCPT ); Mon, 16 Oct 2017 11:19:51 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:49126 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753895AbdJPPTr (ORCPT ); Mon, 16 Oct 2017 11:19:47 -0400 Received: by mail-wm0-f66.google.com with SMTP id i124so4408239wmf.3; Mon, 16 Oct 2017 08:19:45 -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=Y4DWk3A6K60MvgtU+tTEycFymvs6gbmutR0qbNgv04o=; b=WgBdYv1kEn6wXOrP5SIZJaKMKXogRTboy+cK5lTH4n5tXaeTYjnJU6M0iebmEp6xat UQmabogB/3HWdmQbYl4d1q1qPNhxPgqcKNs0kTtuaL9NM7MNckZBocbgyrgUHg3FHZRT BWHJv69XNf1KJZtx+NRODKHzfN7MkturSAC/s2FvEU3X2ig1sA/PB8XMM2DF1FbfYtCj JLncux2gKxFQQJi2rMM2r/5wRNxgcx0c7N440PVRPN2/rf891MISxlLCSMR8KMWi5JBa YOP9BsEQad7jYDY60oDTsMxSAhhFle08ZQ1macQBogMWA7SXbPtdetOdgjmOou28VXQx dSZg== 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=Y4DWk3A6K60MvgtU+tTEycFymvs6gbmutR0qbNgv04o=; b=n7uv1pjBuY0T8DNAst9LIlxsbmM1Dis5pNJMmOlCJjYJ+/NkuabRZe35vwaDW7NPAn wsGU7J2w1CfgVNfhE7Tf0nxhEG2ULuO49GrM6KaVh0QF33w4+NWPyGA94JrX0gO0EF1l 4aIBUilZq0KHoSogrYc1+2Lz9BLZn/3vd+6l0uSN92VY6986wux9k+/5CixGfY3RNr0l luLWJA5g1abTUsMHGbZ9uMJtZDLhUAylttXdb1kx2mQqaMmm51XZ03ClyZccKJK0yu9s oJuQP88cDhMYQ84Ydneh90YUdMIeb8KxDCD54KFCErR+B0P1SDlUu3WZQ1SjLeiz/JMG NAYw== X-Gm-Message-State: AMCzsaWdpq1ooH3iiXwDlwdLPIJhAyLt5Bj++gYYUCyG5haTalpSh+gS /SVWr1hVZJ00dKs92u87bFY= X-Google-Smtp-Source: ABhQp+SHWH+rqU/npMqxkT6Z9+XnnXO4uxPhBccweoeUe/nyDEfABqIbdzOwkJ9ACjKdm9LoKSOSRw== X-Received: by 10.223.179.1 with SMTP id j1mr971887wrd.105.1508167184918; Mon, 16 Oct 2017 08:19:44 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id p78sm10046923wma.11.2017.10.16.08.19.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:44 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:40 +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 13/15] netconsole: make config_item_type const Date: Mon, 16 Oct 2017 17:18:52 +0200 Message-Id: <1508167134-6243-14-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make these structures const as they are either passed to the functions having the argument as const or stored as a reference in the "ci_type" const field of a config_item structure. Done using Coccienlle. Signed-off-by: Bhumika Goyal --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/net/netconsole.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 0e27920..be9aa36 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -616,7 +616,7 @@ static void netconsole_target_release(struct config_item *item) .release = netconsole_target_release, }; -static struct config_item_type netconsole_target_type = { +static const struct config_item_type netconsole_target_type = { .ct_attrs = netconsole_target_attrs, .ct_item_ops = &netconsole_target_item_ops, .ct_owner = THIS_MODULE, @@ -682,7 +682,7 @@ static void drop_netconsole_target(struct config_group *group, .drop_item = drop_netconsole_target, }; -static struct config_item_type netconsole_subsys_type = { +static const struct config_item_type netconsole_subsys_type = { .ct_group_ops = &netconsole_subsys_group_ops, .ct_owner = THIS_MODULE, }; From patchwork Mon Oct 16 15:18:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nxnEfRSI"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG28l2FjVz9rvt for ; Tue, 17 Oct 2017 02:21:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbdJPPUq (ORCPT ); Mon, 16 Oct 2017 11:20:46 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:47631 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466AbdJPPTv (ORCPT ); Mon, 16 Oct 2017 11:19:51 -0400 Received: by mail-wm0-f68.google.com with SMTP id t69so4462988wmt.2; Mon, 16 Oct 2017 08:19:49 -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=A9dPiZ+fQ32jhNQ5UKark0PSddny0jl+eND9l93P4RI=; b=nxnEfRSIK/wGCpsUjSDCUo5NkApssNY1fcrC4Dah8uLy7YeuwqS6VvovbmiVrk/fTu 4L2xiTh5FggOF80DteMrbiDybiZKf19R7pZa0eY29ps1wSI9BS03uuk//cnbSNC+MysJ lQqE+s+Yh8PbjNGSxJlB89v29d1VbhPIS2mLLdlhFknkqaFEigg5Q00dajaP/U41tG9g kJ+sfwcLumpU+R3MfhTsc99WJosrSfb/zhWhR9yk7xCe/jOFSzUvC3VD/LXT7k1n/k4n W0OVF6NqAljd4mRekZDk/1fHPY44/uth9OE3kBgPn4fODRJVmk9gNytpxtDv3z6D5z+h qsFg== 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=A9dPiZ+fQ32jhNQ5UKark0PSddny0jl+eND9l93P4RI=; b=UF0XrFHw6wcb7RBO7xTmO4hnPjYfYBA3LQPMLQTlTS9CbNbMBmIwzxjx5bDym8iGOa s2AqbysHaJCPVaepbKlAWQWaLE/WhhAO/fnhBjV9ByoOI0DfoKM3yEoBkhqvM9SSPrVP GnojARc+nazC57LbiIO89scL2k5TuLgbYABHo/rlsLfixR3sGbVjBT339O6aOEXJk8xu uXg6OLpDJj82em/+OHobaVP4OPfPAkkvdBC3A+pLx3sCnmA+iq/jOZIIzmO8GN9okBz5 EcMqwKTcqs8XYjWVSW2JEKWJua3CcnIj+Hrt3WocHpBniAFMBXOAkrfnQOdqojScCYOi 5Qgg== X-Gm-Message-State: AMCzsaWzawF4LDaw4ATD9A6fsDyGXRBkjH9wQRriq1+rRze+rNOg7VcD pMTKMFy5xg8dwSxVSpmUc1I= X-Google-Smtp-Source: ABhQp+SRavBMl8/pxWnUcEdTzM/JNNq2kcse9SX6hhLCivpkWZVWPaEjHVi8LwfxpUmrTyXlAkQqgQ== X-Received: by 10.223.160.141 with SMTP id m13mr848488wrm.35.1508167188338; Mon, 16 Oct 2017 08:19:48 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id s70sm8167553wrc.83.2017.10.16.08.19.45 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:47 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:45 +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 14/15] dlm: make config_item_type const Date: Mon, 16 Oct 2017 17:18:53 +0200 Message-Id: <1508167134-6243-15-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make config_item_type structures const as they are either passed to a function having the argument as const or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal --- * Changes in v2- Combine all the followup patches and the constification patches into a series. fs/dlm/config.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 7211e82..1270551 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c @@ -282,44 +282,44 @@ struct dlm_node { .release = release_node, }; -static struct config_item_type clusters_type = { +static const struct config_item_type clusters_type = { .ct_group_ops = &clusters_ops, .ct_owner = THIS_MODULE, }; -static struct config_item_type cluster_type = { +static const struct config_item_type cluster_type = { .ct_item_ops = &cluster_ops, .ct_attrs = cluster_attrs, .ct_owner = THIS_MODULE, }; -static struct config_item_type spaces_type = { +static const struct config_item_type spaces_type = { .ct_group_ops = &spaces_ops, .ct_owner = THIS_MODULE, }; -static struct config_item_type space_type = { +static const struct config_item_type space_type = { .ct_item_ops = &space_ops, .ct_owner = THIS_MODULE, }; -static struct config_item_type comms_type = { +static const struct config_item_type comms_type = { .ct_group_ops = &comms_ops, .ct_owner = THIS_MODULE, }; -static struct config_item_type comm_type = { +static const struct config_item_type comm_type = { .ct_item_ops = &comm_ops, .ct_attrs = comm_attrs, .ct_owner = THIS_MODULE, }; -static struct config_item_type nodes_type = { +static const struct config_item_type nodes_type = { .ct_group_ops = &nodes_ops, .ct_owner = THIS_MODULE, }; -static struct config_item_type node_type = { +static const struct config_item_type node_type = { .ct_item_ops = &node_ops, .ct_attrs = node_attrs, .ct_owner = THIS_MODULE, From patchwork Mon Oct 16 15:18:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OYt4dVF5"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2822tNFz9t44 for ; Tue, 17 Oct 2017 02:20:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbdJPPUB (ORCPT ); Mon, 16 Oct 2017 11:20:01 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53711 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753925AbdJPPTx (ORCPT ); Mon, 16 Oct 2017 11:19:53 -0400 Received: by mail-wm0-f65.google.com with SMTP id q132so4474584wmd.2; Mon, 16 Oct 2017 08:19:52 -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=6RKMVDMsZG+Evl146TMZ/PixowFtCvzQjA0/ebFsUPU=; b=OYt4dVF5K0h1ismtqr3jkAf521AsvGz4WXa5wu3GPQv4hN4Ng6Paa3RTmWYjBo9Coi io55i+2xFbUzLMiObRhhPeIG+LYsHZvNMyIHBZc19nMXZFoP88D+X1aqtuE2js6V/8J6 aeNRefXYSNC0QsazvrITSz8ih+n4WfvphNF7W5CYRgfYv+afxZ3gU7696kiW11UJezNf WTtyUosDx0F1VEKHqnIwpK6DtHacCOumgGCy9GsAjHId3byxNdBN1EOUO2vjYWPV5CTl 69o4HYMmIzuIELCY0RhfZEgD6Nq1vCimIVmqGTJyU2NP/V11inwu6vhU25rxzf3qkt8T wuVg== 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=6RKMVDMsZG+Evl146TMZ/PixowFtCvzQjA0/ebFsUPU=; b=WCjapu/sbQvxHY5Te67H3t9eQqGtkSu130HehxGjOkBYPDo2nmnwc04lWShhSbvc+z GpgCfN8J0BUElkPB46GDGHyKj4F4MfP/03F7bEPNuQISyUNvoxWSaF5+85kiBs8IJGgZ Ik9952Av2jvsdiZl3L7k+qdCzmWqL42FNxKHm8oR5oRyvB6jJCE4wplLf0DPTqcr2PTx NtaVR9SaQp69Nifl2R3cszdR9QQT9NiZfCV8xk95cUJ22OAuS9YlEXQJGVygJwgL7GtY 1EvyGzXXrzLG43bbsQfH6QclOeiygirint/c7PMpUFVEiM66g83tQd4dxanCJN3K3Eup S4fw== X-Gm-Message-State: AMCzsaUCmTYClihQQyAhrz13PiAkiKNzF2Rs5EzSGlYxti4dQE+lVkrF t4iPrtLtdqQxMGKy3hNMYYI= X-Google-Smtp-Source: ABhQp+RsDuLQ5O2k1CZCS6e1rt1z+xCQedhGLAovejxo3dc/CLU6j/lEv5iWWJJYr9zdiuDYf1FhVg== X-Received: by 10.28.56.70 with SMTP id f67mr728481wma.62.1508167191295; Mon, 16 Oct 2017 08:19:51 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id v23sm3532661wmv.0.2017.10.16.08.19.48 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:50 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:48 +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 15/15] configfs: make config_item_type const Date: Mon, 16 Oct 2017 17:18:54 +0200 Message-Id: <1508167134-6243-16-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Make config_item_type structures const as they are either passed to a function having the argument as const or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal --- * Changes in v2- Combine all the followup patches and the constification patches into a series. samples/configfs/configfs_sample.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/configfs/configfs_sample.c b/samples/configfs/configfs_sample.c index 1ea3311..004a4e2 100644 --- a/samples/configfs/configfs_sample.c +++ b/samples/configfs/configfs_sample.c @@ -115,7 +115,7 @@ static ssize_t childless_description_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type childless_type = { +static const struct config_item_type childless_type = { .ct_attrs = childless_attrs, .ct_owner = THIS_MODULE, }; @@ -193,7 +193,7 @@ static void simple_child_release(struct config_item *item) .release = simple_child_release, }; -static struct config_item_type simple_child_type = { +static const struct config_item_type simple_child_type = { .ct_item_ops = &simple_child_item_ops, .ct_attrs = simple_child_attrs, .ct_owner = THIS_MODULE, @@ -261,7 +261,7 @@ static void simple_children_release(struct config_item *item) .make_item = simple_children_make_item, }; -static struct config_item_type simple_children_type = { +static const struct config_item_type simple_children_type = { .ct_item_ops = &simple_children_item_ops, .ct_group_ops = &simple_children_group_ops, .ct_attrs = simple_children_attrs, @@ -331,7 +331,7 @@ static ssize_t group_children_description_show(struct config_item *item, .make_group = group_children_make_group, }; -static struct config_item_type group_children_type = { +static const struct config_item_type group_children_type = { .ct_group_ops = &group_children_group_ops, .ct_attrs = group_children_attrs, .ct_owner = THIS_MODULE,