[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56CF7D5D.1020609@emindsoft.com.cn>
Date: Fri, 26 Feb 2016 06:17:01 +0800
From: Chen Gang <chengang@...ndsoft.com.cn>
To: Michal Hocko <mhocko@...nel.org>
CC: trivial@...nel.org, akpm@...ux-foundation.org, vbabka@...e.cz,
rientjes@...gle.com, linux-kernel@...r.kernel.org,
hannes@...xchg.org, mgorman@...hsingularity.net,
vdavydov@...tuozzo.com, dan.j.williams@...el.com,
linux-mm@...ck.org
Subject: Re: [PATCH trivial] include/linux/gfp.h: Improve the coding styles
On 2/25/16 22:47, Michal Hocko wrote:
>>
>> For the "comment placement" the common way is below, but still make git
>> grep harder:
>
> if you did git grep ZONE_MOVABLE you would get less information
>
OK.
>>
>> -#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */
>> +/* ZONE_MOVABLE allowed */
>> +#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE)
>>
>> Then how about:
>>
>> -#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */
>> +#define __GFP_MOVABLE \
>> ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */
>>
>> or:
>>
>> -#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */
>> +#define __GFP_MOVABLE /* ZONE_MOVABLE allowed */ \
>> ((__force gfp_t)___GFP_MOVABLE)
>
> Now looks worse then other, really. Please try to think what would be
> a benefit of such change. As Mel already pointed out git blame would
> take an additional step to get back to the patch which has introduced
> them. And what is the advantage? Make 80 characters-per-line rule happy?
> I just do not think this is worth changes at all.
>
For 80 column limitation:
- I often use vsp (vertical split window) in vim to reading code in the
2 files, 80 columns limitation can avoid the line wrap, which will
let code reading better.
- Sometimes we need copy/past the code to a pdf files (e.g. print the
interface header file contents to a new document as appendix), or
print the code to a physical paper (e.g. write a book).
For worth or worthless:
The shared header files (e.g. in our case), have more chances to be
read or printed than the normal source code files. So for me, we need
take more care about the coding styles of them.
For git-blame:
- It really a good feature! Originally, I did not know about it :-).
- Can it instead of sending trivial patch? (I guess not).
Thanks.
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
Powered by blists - more mailing lists