From: Wei Yongjun <weiyj.lk@gmail.com>
To: lars@metafoo.de
Cc: gregkh@linuxfoundation.org, jic23@cam.ac.uk, wfp5p@virginia.edu,
yongjun_wei@trendmicro.com.cn, linux-iio@vger.kernel.org,
devel@driverdev.osuosl.org
Subject: Re: [PATCH] staging:iio:ad7291: add missing .driver_module to struct iio_info
Date: Fri, 5 Jul 2013 21:10:39 +0800 [thread overview]
Message-ID: <CAPgLHd-Wrx7AK7Z2kgJ4nmKmL5Nafc458NH3_UeXUiLSbVxoSQ@mail.gmail.com> (raw)
In-Reply-To: <51D6981B.8090001@metafoo.de>
On 07/05/2013 05:55 PM, Lars-Peter Clausen wrote:
> On 07/04/2013 06:01 PM, Greg KH wrote:
>> On Thu, Jul 04, 2013 at 09:46:34PM +0800, Wei Yongjun wrote:
>> That's a hint that the register function should be changed so that no module ever has to set this value. Look at how PCI and USB do their driver registration function for how to do this properly.
> I don't think that the same approach as used for PCI, USB and others works
> as nicely here. For one we do not have a registration function for the info
> struct, it would probably be possible to rework things a bit, but not
> without some code churn. And secondly we'd also have to make all the
> iio_info structs non-const, which is something I don't like. And thirdly we
> do have the proper tools to auto-detect such missing initializations (e.g.
> using coccinelle), so we can catch these errors early on and they won't show
> up in new drivers.
Agree, with the follow coccinelle script, we can found this easily.
@r__iio_info@
identifier nm;
position p;
@@
struct iio_info nm@p = {
...,
.driver_module = THIS_MODULE,
...
};
@@
identifier nm;
position p != {r__iio_info.p};
@@
struct iio_info nm@p = {
...,
+ .driver_module = THIS_MODULE,
};
next prev parent reply other threads:[~2013-07-05 13:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-04 13:46 [PATCH] staging:iio:ad7291: add missing .driver_module to struct iio_info Wei Yongjun
2013-07-04 16:01 ` Greg KH
2013-07-05 9:55 ` Lars-Peter Clausen
2013-07-05 13:10 ` Wei Yongjun [this message]
2013-07-06 9:40 ` Jonathan Cameron
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=CAPgLHd-Wrx7AK7Z2kgJ4nmKmL5Nafc458NH3_UeXUiLSbVxoSQ@mail.gmail.com \
--to=weiyj.lk@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@cam.ac.uk \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=wfp5p@virginia.edu \
--cc=yongjun_wei@trendmicro.com.cn \
/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).