Messages in this thread |  | | | From | Arnd Bergmann <> | | Subject | Re: [PATCH] seq_file.h: introduce DECLARE_SEQ_FOPS_{RO,RW} | | Date | Mon, 6 Jun 2011 23:26:44 +0200 |
| |
On Monday 06 June 2011 23:19:15 H Hartley Sweeten wrote: > Just an FYI, the exact same thing is being done with DEFINE_SIMPLE_ATTRIBUTE > in fs.h: > > #define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) \ > static int __fops ## _open(struct inode *inode, struct file *file) \ > { \ > __simple_attr_check_format(__fmt, 0ull); \ > return simple_attr_open(inode, file, __get, __set, __fmt); \ > } \ > static const struct file_operations __fops = { \ > .owner = THIS_MODULE, \ > .open = __fops ## _open, \ > .release = simple_attr_release, \ > .read = simple_attr_read, \ > .write = simple_attr_write, \ > .llseek = generic_file_llseek, \ > };
The main difference here is that the arguments to the macro are used directly in the file operations, which makes it possible to grep for them.
Arnd
|  |