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] [day] [month] [year] [list]
Message-ID: <tip-27263e8dc0f6fe27540a843611ec14a000591c41@git.kernel.org>
Date:   Wed, 28 Feb 2018 05:10:43 -0800
From:   tip-bot for Baolin Wang <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, baolin.wang@...aro.org,
        hpa@...or.com, mingo@...nel.org, tglx@...utronix.de
Subject: [tip:timers/core] clocksource: Use ATTRIBUTE_GROUPS

Commit-ID:  27263e8dc0f6fe27540a843611ec14a000591c41
Gitweb:     https://git.kernel.org/tip/27263e8dc0f6fe27540a843611ec14a000591c41
Author:     Baolin Wang <baolin.wang@...aro.org>
AuthorDate: Wed, 17 Jan 2018 14:01:30 +0800
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 28 Feb 2018 14:05:07 +0100

clocksource: Use ATTRIBUTE_GROUPS

Use ATTRIBUTE_GROUPS instead of manually creating the individual device
files.

Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: arnd@...db.de
Cc: sboyd@...eaurora.org
Cc: broonie@...nel.org
Cc: john.stultz@...aro.org
Link: https://lkml.kernel.org/r/d80dccb981dc2461781ebb8d71a32ccdc1b0e6f9.1516167691.git.baolin.wang@linaro.org
---
 kernel/time/clocksource.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 7ce53465782b..0e974cface0b 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -993,6 +993,14 @@ static ssize_t available_clocksource_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(available_clocksource);
 
+static struct attribute *clocksource_attrs[] = {
+	&dev_attr_current_clocksource.attr,
+	&dev_attr_unbind_clocksource.attr,
+	&dev_attr_available_clocksource.attr,
+	NULL
+};
+ATTRIBUTE_GROUPS(clocksource);
+
 static struct bus_type clocksource_subsys = {
 	.name = "clocksource",
 	.dev_name = "clocksource",
@@ -1001,6 +1009,7 @@ static struct bus_type clocksource_subsys = {
 static struct device device_clocksource = {
 	.id	= 0,
 	.bus	= &clocksource_subsys,
+	.groups	= clocksource_groups,
 };
 
 static int __init init_clocksource_sysfs(void)
@@ -1009,17 +1018,7 @@ static int __init init_clocksource_sysfs(void)
 
 	if (!error)
 		error = device_register(&device_clocksource);
-	if (!error)
-		error = device_create_file(
-				&device_clocksource,
-				&dev_attr_current_clocksource);
-	if (!error)
-		error = device_create_file(&device_clocksource,
-					   &dev_attr_unbind_clocksource);
-	if (!error)
-		error = device_create_file(
-				&device_clocksource,
-				&dev_attr_available_clocksource);
+
 	return error;
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ