Christoph Hellwig writes:
>> static inline bool cluster_is_huge(struct swap_cluster_info *info)
>> {
>> -return info->flags & CLUSTER_FLAG_HUGE;
>> +if (IS_ENABLED(CONFIG_THP_SWAP))
>> +return info->flags & CLUSTER_FLAG_HUGE;
>> +else
>> +return false;
>
> Ni
> static inline bool cluster_is_huge(struct swap_cluster_info *info)
> {
> - return info->flags & CLUSTER_FLAG_HUGE;
> + if (IS_ENABLED(CONFIG_THP_SWAP))
> + return info->flags & CLUSTER_FLAG_HUGE;
> + else
> + return false;
Nitpick: no need for an else after
As suggested by Dave, we should unify the code path for normal and
huge swap support if possible to avoid duplicated code, bugs, etc. and
make it easier to review code.
In this patch, the normal/huge code path in swap_page_trans_huge_swapped()
is unified, the added and removed lines are same. And
3 matches
Mail list logo