lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080722134045.7f09ff29.akpm@linux-foundation.org>
Date:	Tue, 22 Jul 2008 13:40:45 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Greg Kroah-Hartman <gregkh@...e.de>
Cc:	linux-kernel@...r.kernel.org, andi@...stfloor.org,
	ak@...ux.intel.com, gregkh@...e.de, Ingo Molnar <mingo@...e.hu>,
	Takashi Iwai <tiwai@...e.de>
Subject: Re: [PATCH 72/79] sysdev: Pass the attribute to the low level
 sysdev show/store function

On Mon, 21 Jul 2008 22:19:36 -0700
Greg Kroah-Hartman <gregkh@...e.de> wrote:

> From: Andi Kleen <andi@...stfloor.org>
> 
> This allow to dynamically generate attributes and share show/store
> functions between attributes. Right now most attributes are generated
> by special macros and lots of duplicated code. With the attribute
> passed it's instead possible to attach some data to the attribute
> and then use that in shared low level functions to do different things.
> 
> I need this for the dynamically generated bank attributes in the x86
> machine check code, but it'll allow some further cleanups.
> 
> I converted all users in tree to the new show/store prototype. It's a single
> huge patch to avoid unbisectable sections.
> 
> Runtime tested: x86-32, x86-64
> Compiled only: ia64, powerpc
> Not compile tested/only grep converted: sh, arm, avr32
> 
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
>
> ...
>
>  kernel/sched.c                            |    8 ++++-

This wrecks use-sysdev_class-in-schedc.patch (below), which I merged a
week ago and will now drop.

Why did this patch from Andi just turn up in linux-next now, halfway
through the merge window?  It has a commit date of July 1 yet it has
never before been sighted in linux-next.




From: Takashi Iwai <tiwai@...e.de>

The power_saving* attributes are really sysdev_class stuff, so we must
create them via sysdev_class_create_file().  The parameters of callback
functions must be also fixed.

Signed-off-by: Takashi Iwai <tiwai@...e.de>
Cc: <Valdis.Kletnieks@...edu>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---

 kernel/sched.c |   28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff -puN kernel/sched.c~use-sysdev_class-in-schedc kernel/sched.c
--- a/kernel/sched.c~use-sysdev_class-in-schedc
+++ a/kernel/sched.c
@@ -7732,31 +7732,35 @@ static ssize_t sched_power_savings_store
 }
 
 #ifdef CONFIG_SCHED_MC
-static ssize_t sched_mc_power_savings_show(struct sys_device *dev, char *page)
+static ssize_t sched_mc_power_savings_show(struct sysdev_class *cls,
+					   char *page)
 {
 	return sprintf(page, "%u\n", sched_mc_power_savings);
 }
-static ssize_t sched_mc_power_savings_store(struct sys_device *dev,
+static ssize_t sched_mc_power_savings_store(struct sysdev_class *cls,
 					    const char *buf, size_t count)
 {
 	return sched_power_savings_store(buf, count, 0);
 }
-static SYSDEV_ATTR(sched_mc_power_savings, 0644, sched_mc_power_savings_show,
-		   sched_mc_power_savings_store);
+static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644,
+			 sched_mc_power_savings_show,
+			 sched_mc_power_savings_store);
 #endif
 
 #ifdef CONFIG_SCHED_SMT
-static ssize_t sched_smt_power_savings_show(struct sys_device *dev, char *page)
+static ssize_t sched_smt_power_savings_show(struct sysdev_class *cls,
+					    char *page)
 {
 	return sprintf(page, "%u\n", sched_smt_power_savings);
 }
-static ssize_t sched_smt_power_savings_store(struct sys_device *dev,
+static ssize_t sched_smt_power_savings_store(struct sysdv_class *cls,
 					     const char *buf, size_t count)
 {
 	return sched_power_savings_store(buf, count, 1);
 }
-static SYSDEV_ATTR(sched_smt_power_savings, 0644, sched_smt_power_savings_show,
-		   sched_smt_power_savings_store);
+static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644,
+			 sched_smt_power_savings_show,
+			 sched_smt_power_savings_store);
 #endif
 
 int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls)
@@ -7765,13 +7769,13 @@ int sched_create_sysfs_power_savings_ent
 
 #ifdef CONFIG_SCHED_SMT
 	if (smt_capable())
-		err = sysfs_create_file(&cls->kset.kobj,
-					&attr_sched_smt_power_savings.attr);
+		err = sysdev_class_create_file(cls,
+					       &attr_sched_smt_power_savings);
 #endif
 #ifdef CONFIG_SCHED_MC
 	if (!err && mc_capable())
-		err = sysfs_create_file(&cls->kset.kobj,
-					&attr_sched_mc_power_savings.attr);
+		err = sysdev_class_create_file(cls,
+					       &attr_sched_mc_power_savings);
 #endif
 	return err;
 }
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ