Skip to contentSkip to conversation

linux-next: build warning after merge of the mm tree

DISCUSSION Stephen Rothwell 3 participants 4 messages Jun 22, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the mm tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

mm/hugetlb.c: In function 'hugetlb_mask_last_page':
mm/hugetlb.c:6908:23: warning: unused variable 'hp_size' [-Wunused-variable]

 6908 |         unsigned long hp_size = huge_page_size(h);
      |                       ^~~~~~~

Introduced by commit

76005bedbc32 ("hugetlb: do not update address in huge_pmd_unshare")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi all,

Quoted 4 lines · On Wed, 22 Jun 2022 15:54:08 +1000 Stephen Rothwell <[email protected]>…

After merging the mm tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

Quoted 8 lines

mm/hugetlb.c: In function 'hugetlb_mask_last_page':
mm/hugetlb.c:6908:23: warning: unused variable 'hp_size' [-Wunused-variable]

 6908 |         unsigned long hp_size = huge_page_size(h);
      |                       ^~~~~~~

Introduced by commit

76005bedbc32 ("hugetlb: do not update address in huge_pmd_unshare")

This became a build failure in my powerpc allyesconfig build, so I applied this patch:

From: Stephen Rothwell <[email protected]>
Date: Wed, 22 Jun 2022 17:04:46 +1000
Subject: [PATCH] hugetlb: fix an unused variable warning/error

---
 mm/hugetlb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/hugetlb.c +1 -3
index 2e4a92cebd9c..f338640fbe4a 100644
@@ -6905,10 +6905,8 @@ unsigned long hugetlb_mask_last_page(struct hstate *h)
 /* See description above.  Architectures can provide their own version. */
 __weak unsigned long hugetlb_mask_last_page(struct hstate *h)
 {
-	unsigned long hp_size = huge_page_size(h);
-
 #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
-	if (hp_size == PMD_SIZE)
+	if (huge_page_size(h) == PMD_SIZE)
 		return PUD_SIZE - PMD_SIZE;
 #endif
 	return 0UL;
Signature · 5 lines
2.35.1

-- 
Cheers,
Stephen Rothwell
#2 lore raw
Quoted 35 lines · Stephen Rothwell

Hi all,

Quoted 4 lines · On Wed, 22 Jun 2022 15:54:08 +1000 Stephen Rothwell <[email protected]>…

After merging the mm tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

Quoted 8 lines

mm/hugetlb.c: In function 'hugetlb_mask_last_page':
mm/hugetlb.c:6908:23: warning: unused variable 'hp_size' [-Wunused-variable]

 6908 |         unsigned long hp_size = huge_page_size(h);
      |                       ^~~~~~~

Introduced by commit

76005bedbc32 ("hugetlb: do not update address in huge_pmd_unshare")

This became a build failure in my powerpc allyesconfig build, so I applied this patch:

From: Stephen Rothwell <[email protected]>
Date: Wed, 22 Jun 2022 17:04:46 +1000
Subject: [PATCH] hugetlb: fix an unused variable warning/error

---
 mm/hugetlb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/hugetlb.c +0 -0
index 2e4a92cebd9c..f338640fbe4a 100644
@@ -6905,10 +6905,8 @@ unsigned long hugetlb_mask_last_page(struct hstate *h)
 /* See description above.  Architectures can provide their own version. */

mm/hugetlb.c unsigned long hugetlb_mask_last_page(struct hstate *h) · line 6912

Quoted 10 lines
mm/hugetlb.c +1 -3
 __weak unsigned long hugetlb_mask_last_page(struct hstate *h)
 {
-	unsigned long hp_size = huge_page_size(h);
-
 #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
-	if (hp_size == PMD_SIZE)
+	if (huge_page_size(h) == PMD_SIZE)
 		return PUD_SIZE - PMD_SIZE;
 #endif
 	return 0UL;

Thanks Stephen, my bad for not building !CONFIG_ARCH_WANT_HUGE_PMD_SHARE and, the error is pretty obvious. :(

Andrew, do you want me to send an updated version of the patch? Or, would you prefer to include Stephen's fix?

Signature · 1 line
Mike Kravetz
maintainer
#3 lore raw
Quoted 19 lines · On Wed, 22 Jun 2022 09:39:46 -0700 Mike Kravetz <[email protected]> wrote:
Quoted 5 lines
mm/hugetlb.c +0 -0
@@ -6905,10 +6905,8 @@ unsigned long hugetlb_mask_last_page(struct hstate *h)
 /* See description above.  Architectures can provide their own version. */

mm/hugetlb.c unsigned long hugetlb_mask_last_page(struct hstate *h) · line 6912

Quoted 10 lines
mm/hugetlb.c +1 -3
 __weak unsigned long hugetlb_mask_last_page(struct hstate *h)
 {
-	unsigned long hp_size = huge_page_size(h);
-
 #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
-	if (hp_size == PMD_SIZE)
+	if (huge_page_size(h) == PMD_SIZE)
 		return PUD_SIZE - PMD_SIZE;
 #endif
 	return 0UL;

Thanks Stephen, my bad for not building !CONFIG_ARCH_WANT_HUGE_PMD_SHARE and, the error is pretty obvious. :(

Quoted 2 lines

Andrew, do you want me to send an updated version of the patch? Or, would you prefer to include Stephen's fix?

I added Stephen's fix, thanks.