Re: [PATCH trivial] include/linux/gfp.h: Improve the coding styles

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

 



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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]