Re: [PATCH] mm/hugetlb.c: remove dead store in demote_size_show()

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

 



On Sun, Oct 03, 2021 at 06:41:13PM +0700, Nghia Le wrote:
>  {
>  	struct hstate *h;
> -	unsigned long demote_size;
>  	int nid;
>  
>  	h = kobj_to_hstate(kobj, &nid);
> -	demote_size = h->demote_order;
>  
>  	return sysfs_emit(buf, "%lukB\n",
>  			(unsigned long)(PAGE_SIZE << h->demote_order) / SZ_1K);

I'd suggest this function would look better written as:

	int nid;
	struct hstate *h = kobj_to_hstate(kobj, &nid);
	unsigned long demote_size = (PAGE_SIZE << h->demote_order) / SZ_1K;

	return sysfs_emit(buf, "%lukB\n", demote_size);



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux