linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ehea: replace with page_shift() in ehea_is_hugepage()
@ 2019-11-05 11:30 Yunfeng Ye
  2019-11-06 18:23 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Yunfeng Ye @ 2019-11-05 11:30 UTC (permalink / raw)
  To: dougmill, davem; +Cc: netdev, linux-kernel, hushiyuan, linfeilong

The function page_shift() is supported after the commit 94ad9338109f
("mm: introduce page_shift()").

So replace with page_shift() in ehea_is_hugepage() for readability.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
---
 drivers/net/ethernet/ibm/ehea/ehea_qmr.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
index 6e70658d50c4..db45373ea31c 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
@@ -670,13 +670,10 @@ int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages)

 static int ehea_is_hugepage(unsigned long pfn)
 {
-	int page_order;
-
 	if (pfn & EHEA_HUGEPAGE_PFN_MASK)
 		return 0;

-	page_order = compound_order(pfn_to_page(pfn));
-	if (page_order + PAGE_SHIFT != EHEA_HUGEPAGESHIFT)
+	if (page_shift(pfn_to_page(pfn)) != EHEA_HUGEPAGESHIFT)
 		return 0;

 	return 1;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ehea: replace with page_shift() in ehea_is_hugepage()
  2019-11-05 11:30 [PATCH] ehea: replace with page_shift() in ehea_is_hugepage() Yunfeng Ye
@ 2019-11-06 18:23 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-06 18:23 UTC (permalink / raw)
  To: yeyunfeng; +Cc: dougmill, netdev, linux-kernel, hushiyuan, linfeilong

From: Yunfeng Ye <yeyunfeng@huawei.com>
Date: Tue, 5 Nov 2019 19:30:45 +0800

> The function page_shift() is supported after the commit 94ad9338109f
> ("mm: introduce page_shift()").
> 
> So replace with page_shift() in ehea_is_hugepage() for readability.
> 
> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>

Applied to net-next.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-06 18:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 11:30 [PATCH] ehea: replace with page_shift() in ehea_is_hugepage() Yunfeng Ye
2019-11-06 18:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).