From: Ajay Singh <ajay.kathat@microchip.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <devel@driverdev.osuosl.org>, <venkateswara.kaja@microchip.com>,
<gregkh@linuxfoundation.org>, <linux-wireless@vger.kernel.org>,
<ganesh.krishna@microchip.com>, <adham.abozaeid@microchip.com>,
<aditya.shankar@microchip.com>
Subject: Re: [PATCH] staging: wilc1000: fix undefined reference to `__this_module' compilation error
Date: Thu, 9 Aug 2018 16:27:46 +0530 [thread overview]
Message-ID: <20180809162746.0ed9a02c@ajaysk-VirtualBox> (raw)
In-Reply-To: <20180809100838.pduj5s5lvbpjuljn@mwanda>
Hi Dan,
On Thu, 9 Aug 2018 13:08:38 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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@intel.com>
>
> 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.
Thanks for your inputs.
I will update this commit descriptor and resubmit the patch with
correct Fixes tag.
>
> > -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.
>
Sure, I will also include these changes.
Regards,
Ajay
prev parent reply other threads:[~2018-08-09 13:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-09 6:43 [PATCH] staging: wilc1000: fix undefined reference to `__this_module' compilation error Ajay Singh
2018-08-09 10:08 ` Dan Carpenter
2018-08-09 10:43 ` Dan Carpenter
2018-08-09 11:00 ` Ajay Singh
2018-08-09 12:13 ` Greg KH
2018-08-09 12:51 ` Dan Carpenter
2018-08-09 13:18 ` Greg KH
2018-08-09 10:57 ` Ajay Singh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180809162746.0ed9a02c@ajaysk-VirtualBox \
--to=ajay.kathat@microchip.com \
--cc=adham.abozaeid@microchip.com \
--cc=aditya.shankar@microchip.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=ganesh.krishna@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
--cc=venkateswara.kaja@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).