Re: [Possible BUG] count_lim_atomic.c fails on POWER8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018/10/26 08:58:30 +0800, Junchang Wang wrote:
[...]
> 
> BTW, I found I'm not good in writing C macro (e.g., cmpxchg). Do you
> know some specification/document on writing C macro functions in
> Linux?

Although I'm not qualified as a kernel developer,
Linux kernel's "coding style" has a section on this. See:

https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl

In that regard, macros I added in commit b2acf6239a95
("count: Tweak counttorture.h to avoid segfault") do not meet
the style guide in a couple of ways:

    1) Inline functions are preferable to macros resembling functions
    2) Macros with multiple statements should be enclosed in a do - while block
    3) ...

Any idea for improving them is more than welcome!

        Thanks, Akira 

> 
> Thanks,
> --Junchang
> 
[...]



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux