Re: [PATCH 2/2] bcache: add undef for macro in function

From: Coly Li
Date: Tue Aug 14 2018 - 12:25:40 EST


On 2018/8/14 10:59 PM, cdbdyx@xxxxxxx wrote:
> Hi Colyï
> The three macros is only locally used in func "__cached_dev"ïI think
> they should be undefined before leaving the func.
>

Hi Dongbo,

It is worthy to do this if there is a potential conflict. But they are
defined in sysfs.c and not exported to anywhere else, I guess there
won't be any symbol conflict. Then we don't need to worry about this.

Coly Li


> ---Original---
> *From:* "Coly Li"<colyli@xxxxxxx>
> *Date:* Tue, Aug 14, 2018 20:16 PM
> *To:* "Dongbo Cao"<cdbdyx@xxxxxxx>;
> *Cc:*
> "linux-kernel"<linux-kernel@xxxxxxxxxxxxxxx>;"linux-bcache"<linux-bcache@xxxxxxxxxxxxxxx>;"kent.overstreet"<kent.overstreet@xxxxxxxxx>;
> *Subject:* Re: [PATCH 2/2] bcache: add undef for macro in function
>
> OnÂ2018/8/14Â4:16ÂPM,ÂDongboÂCaoÂwrote:
>>ÂaddÂundefÂforÂmacroÂd_strtoul,d_strtoul_nonzeroÂandÂd_strtoi_h
>
>>ÂSigned-off-by:ÂDongboÂCaoÂ
>>Â---
>>ÂÂdrivers/md/bcache/sysfs.cÂ|Â3Â+++
>>ÂÂ1ÂfileÂchanged,Â3Âinsertions(+)
>
>>ÂdiffÂ--gitÂa/drivers/md/bcache/sysfs.cÂb/drivers/md/bcache/sysfs.c
>>ÂindexÂ225b15aa..ed67a290Â100644
>>Â---Âa/drivers/md/bcache/sysfs.c
>>Â+++Âb/drivers/md/bcache/sysfs.c
>>Â@@Â-349,6Â+349,9Â@@ÂSTORE(__cached_dev)
>>ÂÂ ifÂ(attrÂ==Â&sysfs_stop)
>>ÂÂ bcache_device_stop(&dc->disk);
>>ÂÂ
>>Â+#undefÂd_strtoul
>>Â+#undefÂd_strtoul_nonzero
>>Â+#undefÂd_strtoi_h
>>ÂÂ returnÂsize;
>>ÂÂ}
>>ÂÂ
>
>
> HiÂDongbo,
>
> CouldÂyouÂpleaseÂtoÂprovideÂtheÂmotivationÂwhyÂyouÂmakeÂthisÂchangeÂ?
>
> Thanks.
>
> ColyÂLi