Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390: convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Yangtao Li and committed by
Martin Schwidefsky
ca92b93d 5b39fc04

+3 -28
+1 -14
drivers/s390/block/dasd.c
··· 1192 1192 return rc; 1193 1193 } 1194 1194 1195 - static int dasd_hosts_open(struct inode *inode, struct file *file) 1196 - { 1197 - struct dasd_device *device = inode->i_private; 1198 - 1199 - return single_open(file, dasd_hosts_show, device); 1200 - } 1201 - 1202 - static const struct file_operations dasd_hosts_fops = { 1203 - .owner = THIS_MODULE, 1204 - .open = dasd_hosts_open, 1205 - .read = seq_read, 1206 - .llseek = seq_lseek, 1207 - .release = single_release, 1208 - }; 1195 + DEFINE_SHOW_ATTRIBUTE(dasd_hosts); 1209 1196 1210 1197 static void dasd_hosts_exit(struct dasd_device *device) 1211 1198 {
+2 -14
drivers/s390/cio/qdio_debug.c
··· 190 190 return 0; 191 191 } 192 192 193 - static int qstat_seq_open(struct inode *inode, struct file *filp) 194 - { 195 - return single_open(filp, qstat_show, 196 - file_inode(filp)->i_private); 197 - } 198 - 199 - static const struct file_operations debugfs_fops = { 200 - .owner = THIS_MODULE, 201 - .open = qstat_seq_open, 202 - .read = seq_read, 203 - .llseek = seq_lseek, 204 - .release = single_release, 205 - }; 193 + DEFINE_SHOW_ATTRIBUTE(qstat); 206 194 207 195 static char *qperf_names[] = { 208 196 "Assumed adapter interrupts", ··· 294 306 q->is_input_q ? "input" : "output", 295 307 q->nr); 296 308 q->debugfs_q = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, 297 - q->irq_ptr->debugfs_dev, q, &debugfs_fops); 309 + q->irq_ptr->debugfs_dev, q, &qstat_fops); 298 310 if (IS_ERR(q->debugfs_q)) 299 311 q->debugfs_q = NULL; 300 312 }