Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1511898 > unrolled thread

[PATCH 1/3] lightnvm: make core.c explicitly non-modular

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2016-10-29 22:50 +0200
Last post2016-10-30 00:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] lightnvm: make core.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-10-29 22:50 +0200
    Re: [PATCH 1/3] lightnvm: make core.c explicitly non-modular kbuild test robot <lkp@intel.com> - 2016-10-30 00:10 +0200
      Re: [PATCH 1/3] lightnvm: make core.c explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-10-30 00:40 +0200

#1511898 — [PATCH 1/3] lightnvm: make core.c explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-10-29 22:50 +0200
Subject[PATCH 1/3] lightnvm: make core.c explicitly non-modular
Message-ID<sxIJI-32B-11@gated-at.bofh.it>
The Kconfig currently controlling compilation of this code is:

drivers/lightnvm/Kconfig:menuconfig NVM
drivers/lightnvm/Kconfig:       bool "Open-Channel SSD target support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_misc_driver translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

We replace module.h with moduleparam.h because this file still uses
module params to control behaviour.

Also note that MODULE_ALIAS is a no-op for non-modular code.

Cc: Matias Bjorling <mb@lightnvm.io>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/lightnvm/core.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 1cac0f8bc0dc..2329f050ff82 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -22,7 +22,7 @@
 #include <linux/types.h>
 #include <linux/sem.h>
 #include <linux/bitmap.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/miscdevice.h>
 #include <linux/lightnvm.h>
 #include <linux/sched/sysctl.h>
@@ -889,6 +889,10 @@ static const struct kernel_param_ops nvm_configure_by_str_event_param_ops = {
 	.get	= nvm_configure_get,
 };
 
+/*
+ * Not available as modular, but easiest way to remain compatible with
+ * existing boot arg behaviour is to continue using module param here.
+ */
 #undef MODULE_PARAM_PREFIX
 #define MODULE_PARAM_PREFIX	"lnvm."
 
@@ -1162,10 +1166,4 @@ static struct miscdevice _nvm_misc = {
 	.nodename	= "lightnvm/control",
 	.fops		= &_ctl_fops,
 };
-module_misc_device(_nvm_misc);
-
-MODULE_ALIAS_MISCDEV(MISC_DYNAMIC_MINOR);
-
-MODULE_AUTHOR("Matias Bjorling <m@bjorling.me>");
-MODULE_LICENSE("GPL v2");
-MODULE_VERSION("0.1");
+builtin_misc_device(_nvm_misc);
-- 
2.10.1

[toc] | [next] | [standalone]


#1511924

Fromkbuild test robot <lkp@intel.com>
Date2016-10-30 00:10 +0200
Message-ID<sxJZ7-4dG-3@gated-at.bofh.it>
In reply to#1511898

[Multipart message — attachments visible in raw view] — view raw

Hi Paul,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.9-rc3 next-20161028]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Paul-Gortmaker/lightnvm-make-core-c-explicitly-non-modular/20161030-044459
config: i386-randconfig-x073-201644 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

>> drivers/lightnvm/core.c:1169:1: warning: data definition has no type or storage class
    builtin_misc_device(_nvm_misc);
    ^~~~~~~~~~~~~~~~~~~
>> drivers/lightnvm/core.c:1169:1: error: type defaults to 'int' in declaration of 'builtin_misc_device' [-Werror=implicit-int]
>> drivers/lightnvm/core.c:1169:1: warning: parameter names (without types) in function declaration
>> drivers/lightnvm/core.c:1163:26: warning: '_nvm_misc' defined but not used [-Wunused-variable]
    static struct miscdevice _nvm_misc = {
                             ^~~~~~~~~
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
   Cyclomatic Complexity 1 include/linux/list.h:__list_add
   Cyclomatic Complexity 1 include/linux/list.h:list_add
   Cyclomatic Complexity 1 include/linux/list.h:__list_del
   Cyclomatic Complexity 1 include/linux/list.h:list_del
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
   Cyclomatic Complexity 1 include/linux/slab.h:__kmalloc_node
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 3 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_node
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc_node
   Cyclomatic Complexity 1 include/linux/lightnvm.h:generic_to_dev_addr
   Cyclomatic Complexity 1 include/linux/lightnvm.h:dev_to_generic_addr
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_dev_dma_alloc
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_dev_dma_free
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_get_blk
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_put_blk
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_mark_blk
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_submit_io
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_erase_blk
   Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_addr_to_generic_mode
   Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_generic_to_addr_mode
   Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_free_rqd_ppalist
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_end_io
   Cyclomatic Complexity 5 drivers/lightnvm/core.c:nvm_bb_tbl_fold
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_get_bb_tbl
   Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_free_mgr
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_alloc_dev
   Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_find_mgr_type
   Cyclomatic Complexity 5 drivers/lightnvm/core.c:nvm_find_target_type
   Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_register_tgt_type
   Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_unregister_tgt_type
   Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_unregister_mgr
   Cyclomatic Complexity 3 include/linux/err.h:IS_ERR_OR_NULL
   Cyclomatic Complexity 8 drivers/lightnvm/core.c:nvm_init_mgr
   Cyclomatic Complexity 4 drivers/lightnvm/core.c:nvm_register_mgr
   Cyclomatic Complexity 9 drivers/lightnvm/core.c:nvm_set_rqd_ppalist
   Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_erase_ppa
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_end_io_sync
   Cyclomatic Complexity 1 include/linux/completion.h:init_completion
   Cyclomatic Complexity 5 drivers/lightnvm/core.c:__nvm_submit_ppa
   Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_submit_ppa_list
   Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_submit_ppa
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc_array
   Cyclomatic Complexity 1 include/linux/slab.h:kcalloc
   Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_init_slc_tbl
   Cyclomatic Complexity 5 drivers/lightnvm/core.c:nvm_init_mlc_tbl
   Cyclomatic Complexity 9 drivers/lightnvm/core.c:nvm_core_init
   Cyclomatic Complexity 7 drivers/lightnvm/core.c:nvm_init
   Cyclomatic Complexity 10 drivers/lightnvm/core.c:nvm_register
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_exit
   Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_unregister
   Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_free
   cc1: some warnings being treated as errors

vim +1169 drivers/lightnvm/core.c

  1157		.open = nonseekable_open,
  1158		.unlocked_ioctl = nvm_ctl_ioctl,
  1159		.owner = THIS_MODULE,
  1160		.llseek  = noop_llseek,
  1161	};
  1162	
> 1163	static struct miscdevice _nvm_misc = {
  1164		.minor		= MISC_DYNAMIC_MINOR,
  1165		.name		= "lightnvm",
  1166		.nodename	= "lightnvm/control",
  1167		.fops		= &_ctl_fops,
  1168	};
> 1169	builtin_misc_device(_nvm_misc);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1511927

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-10-30 00:40 +0200
Message-ID<sxKs9-4rn-3@gated-at.bofh.it>
In reply to#1511924
[Re: [PATCH 1/3] lightnvm: make core.c explicitly non-modular] On 30/10/2016 (Sun 06:01) kbuild test robot wrote:

> Hi Paul,
> 
> [auto build test ERROR on linus/master]
> [also build test ERROR on v4.9-rc3 next-20161028]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

As per the 0/3 mail, these commits are specific to Greg's char-misc
tree, and it was known they would fail on current "master".

> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]

Does the above apply to _any_ tree on kernel.org?  Or just commits
merged into mainline already?  Since the base here is only in Greg's
repo and maybe also in some linux-next trees.

Thanks,
Paul.
--

> [Check https://git-scm.com/docs/git-format-patch for more information]
> 
> url:    https://github.com/0day-ci/linux/commits/Paul-Gortmaker/lightnvm-make-core-c-explicitly-non-modular/20161030-044459
> config: i386-randconfig-x073-201644 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All error/warnings (new ones prefixed by >>):
> 
> >> drivers/lightnvm/core.c:1169:1: warning: data definition has no type or storage class
>     builtin_misc_device(_nvm_misc);
>     ^~~~~~~~~~~~~~~~~~~
> >> drivers/lightnvm/core.c:1169:1: error: type defaults to 'int' in declaration of 'builtin_misc_device' [-Werror=implicit-int]
> >> drivers/lightnvm/core.c:1169:1: warning: parameter names (without types) in function declaration
> >> drivers/lightnvm/core.c:1163:26: warning: '_nvm_misc' defined but not used [-Wunused-variable]
>     static struct miscdevice _nvm_misc = {
>                              ^~~~~~~~~
>    Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
>    Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
>    Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
>    Cyclomatic Complexity 1 include/linux/list.h:__list_add
>    Cyclomatic Complexity 1 include/linux/list.h:list_add
>    Cyclomatic Complexity 1 include/linux/list.h:__list_del
>    Cyclomatic Complexity 1 include/linux/list.h:list_del
>    Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
>    Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
>    Cyclomatic Complexity 1 include/linux/slab.h:__kmalloc_node
>    Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
>    Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
>    Cyclomatic Complexity 3 include/linux/slab.h:kmalloc
>    Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_node
>    Cyclomatic Complexity 1 include/linux/slab.h:kzalloc_node
>    Cyclomatic Complexity 1 include/linux/lightnvm.h:generic_to_dev_addr
>    Cyclomatic Complexity 1 include/linux/lightnvm.h:dev_to_generic_addr
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_dev_dma_alloc
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_dev_dma_free
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_get_blk
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_put_blk
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_mark_blk
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_submit_io
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_erase_blk
>    Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_addr_to_generic_mode
>    Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_generic_to_addr_mode
>    Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_free_rqd_ppalist
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_end_io
>    Cyclomatic Complexity 5 drivers/lightnvm/core.c:nvm_bb_tbl_fold
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_get_bb_tbl
>    Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_free_mgr
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_alloc_dev
>    Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_find_mgr_type
>    Cyclomatic Complexity 5 drivers/lightnvm/core.c:nvm_find_target_type
>    Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_register_tgt_type
>    Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_unregister_tgt_type
>    Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_unregister_mgr
>    Cyclomatic Complexity 3 include/linux/err.h:IS_ERR_OR_NULL
>    Cyclomatic Complexity 8 drivers/lightnvm/core.c:nvm_init_mgr
>    Cyclomatic Complexity 4 drivers/lightnvm/core.c:nvm_register_mgr
>    Cyclomatic Complexity 9 drivers/lightnvm/core.c:nvm_set_rqd_ppalist
>    Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_erase_ppa
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_end_io_sync
>    Cyclomatic Complexity 1 include/linux/completion.h:init_completion
>    Cyclomatic Complexity 5 drivers/lightnvm/core.c:__nvm_submit_ppa
>    Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_submit_ppa_list
>    Cyclomatic Complexity 2 drivers/lightnvm/core.c:nvm_submit_ppa
>    Cyclomatic Complexity 5 include/linux/slab.h:kmalloc_array
>    Cyclomatic Complexity 1 include/linux/slab.h:kcalloc
>    Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_init_slc_tbl
>    Cyclomatic Complexity 5 drivers/lightnvm/core.c:nvm_init_mlc_tbl
>    Cyclomatic Complexity 9 drivers/lightnvm/core.c:nvm_core_init
>    Cyclomatic Complexity 7 drivers/lightnvm/core.c:nvm_init
>    Cyclomatic Complexity 10 drivers/lightnvm/core.c:nvm_register
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_exit
>    Cyclomatic Complexity 1 drivers/lightnvm/core.c:nvm_unregister
>    Cyclomatic Complexity 3 drivers/lightnvm/core.c:nvm_free
>    cc1: some warnings being treated as errors
> 
> vim +1169 drivers/lightnvm/core.c
> 
>   1157		.open = nonseekable_open,
>   1158		.unlocked_ioctl = nvm_ctl_ioctl,
>   1159		.owner = THIS_MODULE,
>   1160		.llseek  = noop_llseek,
>   1161	};
>   1162	
> > 1163	static struct miscdevice _nvm_misc = {
>   1164		.minor		= MISC_DYNAMIC_MINOR,
>   1165		.name		= "lightnvm",
>   1166		.nodename	= "lightnvm/control",
>   1167		.fops		= &_ctl_fops,
>   1168	};
> > 1169	builtin_misc_device(_nvm_misc);
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web