Skip to contentSkip to conversation

crypto: hisilicon/qm - Convert to DEFINE_SHOW_ATTRIBUTE

PATCH In review Qinglang Miao 2 participants 2 messages Sep 18, 2020 – Sep 25, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 crypto: hisilicon/qm - Convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
v2: based on linux-next(20200917), and can be applied to
mainline cleanly now.

 drivers/crypto/hisilicon/qm.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/crypto/hisilicon/qm.c +1 -11
index 07efc5283..1923f153d 100644
@@ -1050,17 +1050,7 @@ static int qm_regs_show(struct seq_file *s, void *unused)
 	return 0;
 }
 
-static int qm_regs_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, qm_regs_show, inode->i_private);
-}
-
-static const struct file_operations qm_regs_fops = {
-	.owner = THIS_MODULE,
-	.open = qm_regs_open,
-	.read = seq_read,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(qm_regs);
 
 static ssize_t qm_cmd_read(struct file *filp, char __user *buffer,
 			   size_t count, loff_t *pos)
Signature · 1 line
2.23.0
maintainer
#1 lore raw
Quoted 9 lines · Qinglang Miao

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
v2: based on linux-next(20200917), and can be applied to
mainline cleanly now.

 drivers/crypto/hisilicon/qm.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt