LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] include/linux/swap.h: Remove unused leftovers
@ 2026-06-11  3:09 Ritesh Harjani (IBM)
  2026-06-11  3:18 ` Chris Li
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ritesh Harjani (IBM) @ 2026-06-11  3:09 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Chris Li, Kairui Song, Kemeng Shi, Nhat Pham,
	Baoquan He, Barry Song, Youngjun Park, David Hildenbrand,
	linuxppc-dev, linux-kernel, Sayali Patil, Ritesh Harjani (IBM)

This removed unused leftovers, most of them are forward structure
declarations. Also removes SWAP_BATCH macro which isn't used any
where in the code.

Found these during manual code review.

Reviewed-by: Barry Song <baohua@kernel.org>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
RFC -> v2:
- separated from the rest of the series (enable thp swap on PowerPC Book3s64)
- RB from Barry
[RFC]: https://lore.kernel.org/linuxppc-dev/cover.1781000840.git.ritesh.list@gmail.com/

 include/linux/swap.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/include/linux/swap.h b/include/linux/swap.h
index 8f0f68e245ba..46c25523d7b8 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -16,10 +16,6 @@
 #include <uapi/linux/mempolicy.h>
 #include <asm/page.h>

-struct notifier_block;
-
-struct bio;
-
 #define SWAP_FLAG_PREFER	0x8000	/* set if swap priority specified */
 #define SWAP_FLAG_PRIO_MASK	0x7fff
 #define SWAP_FLAG_DISCARD	0x10000 /* enable discard for swap */
@@ -29,7 +25,6 @@ struct bio;
 #define SWAP_FLAGS_VALID	(SWAP_FLAG_PRIO_MASK | SWAP_FLAG_PREFER | \
 				 SWAP_FLAG_DISCARD | SWAP_FLAG_DISCARD_ONCE | \
 				 SWAP_FLAG_DISCARD_PAGES)
-#define SWAP_BATCH 64

 static inline int current_is_kswapd(void)
 {
@@ -175,7 +170,6 @@ static inline void mm_account_reclaimed_pages(unsigned long pages)

 struct address_space;
 struct sysinfo;
-struct writeback_control;
 struct zone;

 /*
@@ -442,7 +436,6 @@ extern sector_t swapdev_block(int, pgoff_t);
 extern int __swap_count(swp_entry_t entry);
 extern bool swap_entry_swapped(struct swap_info_struct *si, swp_entry_t entry);
 extern int swp_swapcount(swp_entry_t entry);
-struct backing_dev_info;
 extern struct swap_info_struct *get_swap_device(swp_entry_t entry);
 sector_t swap_folio_sector(struct folio *folio);

--
2.39.5



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

* Re: [PATCH v2] include/linux/swap.h: Remove unused leftovers
  2026-06-11  3:09 [PATCH v2] include/linux/swap.h: Remove unused leftovers Ritesh Harjani (IBM)
@ 2026-06-11  3:18 ` Chris Li
  2026-06-11 11:35 ` David Hildenbrand (Arm)
  2026-06-11 14:34 ` Nhat Pham
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Li @ 2026-06-11  3:18 UTC (permalink / raw)
  To: Ritesh Harjani (IBM)
  Cc: linux-mm, Andrew Morton, Kairui Song, Kemeng Shi, Nhat Pham,
	Baoquan He, Barry Song, Youngjun Park, David Hildenbrand,
	linuxppc-dev, linux-kernel, Sayali Patil

On Wed, Jun 10, 2026 at 8:09 PM Ritesh Harjani (IBM)
<ritesh.list@gmail.com> wrote:
>
> This removed unused leftovers, most of them are forward structure
> declarations. Also removes SWAP_BATCH macro which isn't used any
> where in the code.
>
> Found these during manual code review.
>
> Reviewed-by: Barry Song <baohua@kernel.org>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Acked-by: Chris Li <chrisl@kernel.org>

Chris

> ---
> RFC -> v2:
> - separated from the rest of the series (enable thp swap on PowerPC Book3s64)
> - RB from Barry
> [RFC]: https://lore.kernel.org/linuxppc-dev/cover.1781000840.git.ritesh.list@gmail.com/
>
>  include/linux/swap.h | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/include/linux/swap.h b/include/linux/swap.h
> index 8f0f68e245ba..46c25523d7b8 100644
> --- a/include/linux/swap.h
> +++ b/include/linux/swap.h
> @@ -16,10 +16,6 @@
>  #include <uapi/linux/mempolicy.h>
>  #include <asm/page.h>
>
> -struct notifier_block;
> -
> -struct bio;
> -
>  #define SWAP_FLAG_PREFER       0x8000  /* set if swap priority specified */
>  #define SWAP_FLAG_PRIO_MASK    0x7fff
>  #define SWAP_FLAG_DISCARD      0x10000 /* enable discard for swap */
> @@ -29,7 +25,6 @@ struct bio;
>  #define SWAP_FLAGS_VALID       (SWAP_FLAG_PRIO_MASK | SWAP_FLAG_PREFER | \
>                                  SWAP_FLAG_DISCARD | SWAP_FLAG_DISCARD_ONCE | \
>                                  SWAP_FLAG_DISCARD_PAGES)
> -#define SWAP_BATCH 64
>
>  static inline int current_is_kswapd(void)
>  {
> @@ -175,7 +170,6 @@ static inline void mm_account_reclaimed_pages(unsigned long pages)
>
>  struct address_space;
>  struct sysinfo;
> -struct writeback_control;
>  struct zone;
>
>  /*
> @@ -442,7 +436,6 @@ extern sector_t swapdev_block(int, pgoff_t);
>  extern int __swap_count(swp_entry_t entry);
>  extern bool swap_entry_swapped(struct swap_info_struct *si, swp_entry_t entry);
>  extern int swp_swapcount(swp_entry_t entry);
> -struct backing_dev_info;
>  extern struct swap_info_struct *get_swap_device(swp_entry_t entry);
>  sector_t swap_folio_sector(struct folio *folio);
>
> --
> 2.39.5
>


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

* Re: [PATCH v2] include/linux/swap.h: Remove unused leftovers
  2026-06-11  3:09 [PATCH v2] include/linux/swap.h: Remove unused leftovers Ritesh Harjani (IBM)
  2026-06-11  3:18 ` Chris Li
@ 2026-06-11 11:35 ` David Hildenbrand (Arm)
  2026-06-11 14:34 ` Nhat Pham
  2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand (Arm) @ 2026-06-11 11:35 UTC (permalink / raw)
  To: Ritesh Harjani (IBM), linux-mm
  Cc: Andrew Morton, Chris Li, Kairui Song, Kemeng Shi, Nhat Pham,
	Baoquan He, Barry Song, Youngjun Park, linuxppc-dev, linux-kernel,
	Sayali Patil

On 6/11/26 05:09, Ritesh Harjani (IBM) wrote:
> This removed unused leftovers, most of them are forward structure
> declarations. Also removes SWAP_BATCH macro which isn't used any
> where in the code.
> 
> Found these during manual code review.
> 
> Reviewed-by: Barry Song <baohua@kernel.org>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
> ---

If it compiles we're good :)

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

-- 
Cheers,

David


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

* Re: [PATCH v2] include/linux/swap.h: Remove unused leftovers
  2026-06-11  3:09 [PATCH v2] include/linux/swap.h: Remove unused leftovers Ritesh Harjani (IBM)
  2026-06-11  3:18 ` Chris Li
  2026-06-11 11:35 ` David Hildenbrand (Arm)
@ 2026-06-11 14:34 ` Nhat Pham
  2 siblings, 0 replies; 4+ messages in thread
From: Nhat Pham @ 2026-06-11 14:34 UTC (permalink / raw)
  To: Ritesh Harjani (IBM)
  Cc: linux-mm, Andrew Morton, Chris Li, Kairui Song, Kemeng Shi,
	Baoquan He, Barry Song, Youngjun Park, David Hildenbrand,
	linuxppc-dev, linux-kernel, Sayali Patil

On Wed, Jun 10, 2026 at 8:09 PM Ritesh Harjani (IBM)
<ritesh.list@gmail.com> wrote:
>
> This removed unused leftovers, most of them are forward structure
> declarations. Also removes SWAP_BATCH macro which isn't used any
> where in the code.
>
> Found these during manual code review.
>
> Reviewed-by: Barry Song <baohua@kernel.org>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Reviewed-by: Nhat Pham <nphamcs@gmail.com>


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

end of thread, other threads:[~2026-06-11 14:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  3:09 [PATCH v2] include/linux/swap.h: Remove unused leftovers Ritesh Harjani (IBM)
2026-06-11  3:18 ` Chris Li
2026-06-11 11:35 ` David Hildenbrand (Arm)
2026-06-11 14:34 ` Nhat Pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox