From: Zhang Rui <rui.zhang@intel.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Len Brown <lenb@kernel.org>,
"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: build warnings in Linus' tree
Date: Mon, 30 Aug 2010 14:08:02 +0800 [thread overview]
Message-ID: <1283148482.3707.167.camel@rui> (raw)
In-Reply-To: <20100830114222.3a1f53e6.sfr@canb.auug.org.au>
On Mon, 2010-08-30 at 09:42 +0800, Stephen Rothwell wrote:
> Hi Len,
>
> On Tue, 17 Aug 2010 11:24:39 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next build (x86_64 allmodconfig) produced these warnings:
> >
> > drivers/acpi/sysfs.c:152: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> > drivers/acpi/sysfs.c:152: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> > drivers/acpi/sysfs.c:152: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> > drivers/acpi/sysfs.c:152: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> > drivers/acpi/sysfs.c:154: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> > drivers/acpi/sysfs.c:154: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> > drivers/acpi/sysfs.c:154: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> > drivers/acpi/sysfs.c:154: warning: passing argument 1 of '__check_old_set_param' from incompatible pointer type
> > include/linux/moduleparam.h:165: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
> >
> > Introduced by commit 1c8fce27e275fd7c6b75bc6455745f02d3903ee6 ("ACPI:
> > introduce drivers/acpi/sysfs.c") interacting with commit
> > 9bbb9e5a33109b2832e2e63dcc7a132924ab374b ("param: use ops in struct
> > kernel_param, rather than get and set fns directly").
>
> Can we have this fixed, please?
patch attached. :)
Use module_param_cb instead of the obsoleted module_param_call to fix a build warning.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/sysfs.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
Index: linux-2.6/drivers/acpi/sysfs.c
===================================================================
--- linux-2.6.orig/drivers/acpi/sysfs.c
+++ linux-2.6/drivers/acpi/sysfs.c
@@ -100,7 +100,7 @@ static const struct acpi_dlevel acpi_deb
ACPI_DEBUG_INIT(ACPI_LV_EVENTS),
};
-static int param_get_debug_layer(char *buffer, struct kernel_param *kp)
+static int param_get_debug_layer(char *buffer, const struct kernel_param *kp)
{
int result = 0;
int i;
@@ -128,7 +128,7 @@ static int param_get_debug_layer(char *b
return result;
}
-static int param_get_debug_level(char *buffer, struct kernel_param *kp)
+static int param_get_debug_level(char *buffer, const struct kernel_param *kp)
{
int result = 0;
int i;
@@ -149,10 +149,18 @@ static int param_get_debug_level(char *b
return result;
}
-module_param_call(debug_layer, param_set_uint, param_get_debug_layer,
- &acpi_dbg_layer, 0644);
-module_param_call(debug_level, param_set_uint, param_get_debug_level,
- &acpi_dbg_level, 0644);
+static struct kernel_param_ops param_ops_debug_layer = {
+ .set = param_set_uint,
+ .get = param_get_debug_layer,
+};
+
+static struct kernel_param_ops param_ops_debug_level = {
+ .set = param_set_uint,
+ .get = param_get_debug_level,
+};
+
+module_param_cb(debug_layer, ¶m_ops_debug_layer, &acpi_dbg_layer, 0644);
+module_param_cb(debug_level, ¶m_ops_debug_level, &acpi_dbg_level, 0644);
static char trace_method_name[6];
module_param_string(trace_method_name, trace_method_name, 6, 0644);
next prev parent reply other threads:[~2010-08-30 6:04 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 1:24 linux-next: build warnings in Linus' tree Stephen Rothwell
2010-08-30 1:42 ` Stephen Rothwell
2010-08-30 6:08 ` Zhang Rui [this message]
2010-09-03 2:01 ` Stephen Rothwell
2010-09-03 2:36 ` Len Brown
2010-09-17 4:26 ` Stephen Rothwell
2010-09-27 13:31 ` Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2022-06-14 6:57 Stephen Rothwell
2022-05-26 7:21 Stephen Rothwell
2022-01-27 4:30 Stephen Rothwell
2022-01-27 6:01 ` Christoph Hellwig
2022-01-27 16:44 ` Stephen Rothwell
2022-01-27 4:24 Stephen Rothwell
2021-11-22 22:44 Stephen Rothwell
2021-11-23 7:04 ` Borislav Petkov
2021-11-05 5:03 Stephen Rothwell
2021-10-12 10:56 Stephen Rothwell
2021-10-12 20:13 ` Randy Dunlap
2021-10-08 5:47 Stephen Rothwell
2021-10-10 21:27 ` Stephen Rothwell
2021-10-11 20:42 ` Rob Herring
2021-10-12 14:39 ` Arnd Bergmann
2021-10-13 22:12 ` Anatolij Gustschin
2021-10-13 22:17 ` Rob Herring
2021-10-13 22:28 ` Anatolij Gustschin
2021-10-13 23:22 ` Rob Herring
2021-10-14 8:44 ` Arnd Bergmann
2021-10-14 12:24 ` Anatolij Gustschin
2020-09-07 23:11 Stephen Rothwell
2020-09-08 13:14 ` Josh Poimboeuf
2020-09-09 0:15 ` Stephen Rothwell
2020-04-03 22:19 Stephen Rothwell
2020-04-03 23:16 ` Rob Herring
2020-04-03 23:31 ` Nicolas Saenz Julienne
2017-11-13 21:52 Stephen Rothwell
2017-11-13 22:03 ` Linus Torvalds
2013-07-04 4:58 Stephen Rothwell
2013-07-09 21:48 ` Nikolova, Tatyana E
2011-08-15 1:57 Stephen Rothwell
2011-05-23 1:25 Stephen Rothwell
2011-05-23 2:31 ` Eduardo Silva
2011-01-14 0:17 Stephen Rothwell
2011-01-14 0:09 Stephen Rothwell
2011-01-14 0:17 ` Andrew Morton
2011-01-14 1:06 ` Greg KH
2010-08-07 2:21 Stephen Rothwell
2010-08-07 8:13 ` Vikas Chaudhary
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=1283148482.3707.167.camel@rui \
--to=rui.zhang@intel.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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).