diff mbox series

PM / QoS: Change to use DEFINE_SHOW_ATTRIBUTE macro

Message ID 20181106143806.8551-1-tiny.windzz@gmail.com (mailing list archive)
State Mainlined
Delegated to: Rafael Wysocki
Headers show
Series PM / QoS: Change to use DEFINE_SHOW_ATTRIBUTE macro | expand

Commit Message

Yangtao Li Nov. 6, 2018, 2:38 p.m. UTC
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 kernel/power/qos.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

Comments

Pavel Machek Nov. 11, 2018, 11:29 a.m. UTC | #1
On Tue 2018-11-06 09:38:06, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>
Rafael J. Wysocki Dec. 11, 2018, 10:44 a.m. UTC | #2
On Sunday, November 11, 2018 12:29:55 PM CET Pavel Machek wrote:
> 
> --V88s5gaDVPzZ0KCq
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
> 
> On Tue 2018-11-06 09:38:06, Yangtao Li wrote:
> > Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> >=20
> > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>

Patch applied, thanks!
diff mbox series

Patch

diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index 86d72ffb811b..b7a82502857a 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -184,7 +184,7 @@  static inline void pm_qos_set_value(struct pm_qos_constraints *c, s32 value)
 	c->target_value = value;
 }
 
-static int pm_qos_dbg_show_requests(struct seq_file *s, void *unused)
+static int pm_qos_debug_show(struct seq_file *s, void *unused)
 {
 	struct pm_qos_object *qos = (struct pm_qos_object *)s->private;
 	struct pm_qos_constraints *c;
@@ -245,18 +245,7 @@  static int pm_qos_dbg_show_requests(struct seq_file *s, void *unused)
 	return 0;
 }
 
-static int pm_qos_dbg_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, pm_qos_dbg_show_requests,
-			   inode->i_private);
-}
-
-static const struct file_operations pm_qos_debug_fops = {
-	.open           = pm_qos_dbg_open,
-	.read           = seq_read,
-	.llseek         = seq_lseek,
-	.release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(pm_qos_debug);
 
 /**
  * pm_qos_update_target - manages the constraints list and calls the notifiers