Re: [PATCH] proc: remove '##' usage



On Mon, Nov 10, 2008 at 01:35:42AM +0300, Alexey Dobriyan wrote:
+#define DIR(NAME, MODE, iops, fops) \
+ NOD(NAME, (S_IFDIR|(MODE)), &iops, &fops, {} )

This macro certainly doesn't help with readability, adding just
and S_IFDIR to the passed in arguments.

+#define LNK(NAME, get_link) \
NOD(NAME, (S_IFLNK|S_IRWXUGO), \
&proc_pid_link_inode_operations, NULL, \
+ { .proc_get_link = get_link } )
+#define REG(NAME, MODE, fops) \
+ NOD(NAME, (S_IFREG|(MODE)), NULL, &fops, {})
+#define INF(NAME, MODE, read) \
NOD(NAME, (S_IFREG|(MODE)), \
NULL, &proc_info_file_operations, \
+ { .proc_read = read } )
+#define ONE(NAME, MODE, show) \
NOD(NAME, (S_IFREG|(MODE)), \
NULL, &proc_single_file_operations, \
+ { .proc_show = show } )

And even for these I would argue just opencoding them would be
a lot cleaner.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: too many self
    ... One just has to be consistent within each function. ... >> Some would argue that this is actually less readable, however, ... >> to the obvious detriment of readability, ... > This doesn't take a complicated statement to make it really clumsy. ...
    (comp.lang.python)
  • Re: How do like this macros ?
    ... reason I postbone and postbone... ... Readability, or better: Visibility is of **major** ... My macros was more like a Delphi overlap. ... But the Button.Get macro is just one macro, ...
    (alt.lang.asm)
  • Re: Reformulating a macro to use argument just once
    ... where p is a pointer ot unsigned char. ... You probably really shouldn't be using a macro here. ... The inner parentheses aren't necessary there,and I would omit them. ... parentheses harm readability, and the outer ones don't have any ...
    (comp.lang.c)
  • [PATCH 07/26] kconfig: make lxdialog/menubox.c more readable
    ... Utilising a small macro for print_item made wonders for readability ... Prev by Date: ...
    (Linux-Kernel)
  • Re: A challenge for RosAsm
    ... :A good example is the HLA stdout.put macro: ... :I'd argue that this code is a *bit* easier to read and determine what ... Perhaps if you would give us an example of how this macro is actually used, ... immediate reaction is that a typical non-macro example would be simply: ...
    (alt.lang.asm)