Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbcDPOUF (ORCPT ); Sat, 16 Apr 2016 10:20:05 -0400 Received: from mail-qg0-f47.google.com ([209.85.192.47]:34042 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbcDPOUC (ORCPT ); Sat, 16 Apr 2016 10:20:02 -0400 Subject: Re: [PATCH 1/2] lightnvm: rename nvm_targets to nvm_tgt_type To: "Simon A. F. Lund" , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1460549734-844-1-git-send-email-slund@cnexlabs.com> <1460549734-844-2-git-send-email-slund@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <57124A05.8070005@lightnvm.io> Date: Sat, 16 Apr 2016 16:19:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1460549734-844-2-git-send-email-slund@cnexlabs.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3858 Lines: 118 On 04/13/2016 02:15 PM, Simon A. F. Lund wrote: > The functions nvm_register_target(), nvm_unregister_target() and > associated list refers to a target type that is being registered by a > target type module. Rename nvm_*_targets() to nvm_*_tgt_type(), so that > the intension is clear. > > This enables target instances to use the _nvm_*_targets() naming. > > Signed-off-by: Simon A. F. Lund > --- > drivers/lightnvm/core.c | 16 ++++++++-------- > drivers/lightnvm/rrpc.c | 4 ++-- > include/linux/lightnvm.h | 4 ++-- > 3 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c > index 74fb049..240b473 100644 > --- a/drivers/lightnvm/core.c > +++ b/drivers/lightnvm/core.c > @@ -30,7 +30,7 @@ > #include > #include > > -static LIST_HEAD(nvm_targets); > +static LIST_HEAD(nvm_tgt_types); > static LIST_HEAD(nvm_mgrs); > static LIST_HEAD(nvm_devices); > static DECLARE_RWSEM(nvm_lock); > @@ -39,14 +39,14 @@ static struct nvm_tgt_type *nvm_find_target_type(const char *name) > { > struct nvm_tgt_type *tt; > > - list_for_each_entry(tt, &nvm_targets, list) > + list_for_each_entry(tt, &nvm_tgt_types, list) > if (!strcmp(name, tt->name)) > return tt; > > return NULL; > } > > -int nvm_register_target(struct nvm_tgt_type *tt) > +int nvm_register_tgt_type(struct nvm_tgt_type *tt) > { > int ret = 0; > > @@ -54,14 +54,14 @@ int nvm_register_target(struct nvm_tgt_type *tt) > if (nvm_find_target_type(tt->name)) > ret = -EEXIST; > else > - list_add(&tt->list, &nvm_targets); > + list_add(&tt->list, &nvm_tgt_types); > up_write(&nvm_lock); > > return ret; > } > -EXPORT_SYMBOL(nvm_register_target); > +EXPORT_SYMBOL(nvm_register_tgt_type); > > -void nvm_unregister_target(struct nvm_tgt_type *tt) > +void nvm_unregister_tgt_type(struct nvm_tgt_type *tt) > { > if (!tt) > return; > @@ -70,7 +70,7 @@ void nvm_unregister_target(struct nvm_tgt_type *tt) > list_del(&tt->list); > up_write(&nvm_lock); > } > -EXPORT_SYMBOL(nvm_unregister_target); > +EXPORT_SYMBOL(nvm_unregister_tgt_type); > > void *nvm_dev_dma_alloc(struct nvm_dev *dev, gfp_t mem_flags, > dma_addr_t *dma_handler) > @@ -1020,7 +1020,7 @@ static long nvm_ioctl_info(struct file *file, void __user *arg) > info->version[2] = NVM_VERSION_PATCH; > > down_write(&nvm_lock); > - list_for_each_entry(tt, &nvm_targets, list) { > + list_for_each_entry(tt, &nvm_tgt_types, list) { > struct nvm_ioctl_info_tgt *tgt = &info->tgts[tgt_iter]; > > tgt->version[0] = tt->version[0]; > diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c > index 3ab6495..4625e9c 100644 > --- a/drivers/lightnvm/rrpc.c > +++ b/drivers/lightnvm/rrpc.c > @@ -1468,12 +1468,12 @@ static struct nvm_tgt_type tt_rrpc = { > > static int __init rrpc_module_init(void) > { > - return nvm_register_target(&tt_rrpc); > + return nvm_register_tgt_type(&tt_rrpc); > } > > static void rrpc_module_exit(void) > { > - nvm_unregister_target(&tt_rrpc); > + nvm_unregister_tgt_type(&tt_rrpc); > } > > module_init(rrpc_module_init); > diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h > index dacaa28..497da91 100644 > --- a/include/linux/lightnvm.h > +++ b/include/linux/lightnvm.h > @@ -453,8 +453,8 @@ struct nvm_tgt_type { > struct list_head list; > }; > > -extern int nvm_register_target(struct nvm_tgt_type *); > -extern void nvm_unregister_target(struct nvm_tgt_type *); > +extern int nvm_register_tgt_type(struct nvm_tgt_type *); > +extern void nvm_unregister_tgt_type(struct nvm_tgt_type *); > > extern void *nvm_dev_dma_alloc(struct nvm_dev *, gfp_t, dma_addr_t *); > extern void nvm_dev_dma_free(struct nvm_dev *, void *, dma_addr_t); > Thanks Simon. Applied for 4.7.