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-next>] [day] [month] [year] [list]
Message-Id: <20181106143227.8287-1-tiny.windzz@gmail.com>
Date:   Tue,  6 Nov 2018 09:32:27 -0500
From:   Yangtao Li <tiny.windzz@...il.com>
To:     john.johansen@...onical.com, jmorris@...ei.org, serge@...lyn.com
Cc:     linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org, Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH] apparmor: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
 security/apparmor/apparmorfs.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index e09fe4d7307c..0e80ea4a3f6b 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -977,7 +977,7 @@ static const struct file_operations aa_sfs_access = {
 	.llseek		= generic_file_llseek,
 };
 
-static int aa_sfs_seq_show(struct seq_file *seq, void *v)
+static int aa_sfs_seq_file_show(struct seq_file *seq, void *v)
 {
 	struct aa_sfs_entry *fs_file = seq->private;
 
@@ -1002,18 +1002,7 @@ static int aa_sfs_seq_show(struct seq_file *seq, void *v)
 	return 0;
 }
 
-static int aa_sfs_seq_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, aa_sfs_seq_show, inode->i_private);
-}
-
-const struct file_operations aa_sfs_seq_file_ops = {
-	.owner		= THIS_MODULE,
-	.open		= aa_sfs_seq_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(aa_sfs_seq_file);
 
 /*
  * profile based file operations
-- 
2.17.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ