Re: [PATCH] staging: wilc1000: fix undefined reference to `__this_module' compilation error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 09, 2018 at 12:13:06PM +0530, Ajay Singh wrote:
> wilc_debug.o object file is included for both SDIO and SPI module. When
> anyone(either SDIO or SPI) module is compiled as loaded module and another
> as buildin module then below compilation error occurs.
> 
> "drivers/staging/wilc1000/wilc_debugfs.o:(.data+0x10): undefined
> reference to `__this_module'"
> 
> Moved the declaration of file_operation variable in SDIO/SPI files and
> pass this as parameter to wilc_debugfs_init().
> Refactor wilc_debugfs_init() as its not required to maintain
> 'wilc_debugfs_info_t' in debugfs_info[] array. Also modified file
> permission from 0666 to 0600 & use 'data' field as 'NULL' in
> debugfs_create_file() call.
> 
> Fixes: 9abc44ba4e2f("staging: wilc1000: fix TODO to compile spi and sdio
> components in single module")
> 
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>

I don't think you need to resend, but the Fixes tag format isn't
right.

1) Don't line wrap it.  (Maybe checkpatch complains?  Ignore checkpatch).
2) Put a space between the git hash and the '('.
3) No blank line between the Fixes and the Reported-by.

> -int wilc_debugfs_init(void)
> +int wilc_debugfs_init(const struct file_operations *fops)

You may as well make wilc_debugfs_init() void since no one checks it.

>  {
> -	int i;
> -	struct wilc_debugfs_info_t *info;
> -
>  	wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
> -	for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) {
> -		info = &debugfs_info[i];
> -		debugfs_create_file(info->name,
> -				    info->perm,
> -				    wilc_dir,
> -				    &info->data,
> -				    &info->fops);
> +	if (IS_ERR_OR_NULL(wilc_dir)) {
> +		pr_err("Error creating debugfs\n");
> +		return -EFAULT;
>  	}

Just check for NULL.  If someone builds without debugfs enabled in their
.config, that's their choice.  No need to print a warning.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux