All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0)
@ 2022-10-18 21:57 Giulio Benetti
  2022-10-18 21:57 ` [PATCH 2/3] spi: fsl-cpm: " Giulio Benetti
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Giulio Benetti @ 2022-10-18 21:57 UTC (permalink / raw)
  To: Arnd Bergmann, linux-acpi, linux-kernel, linux-spi, linux-raid
  Cc: Rafael J . Wysocki, Len Brown, Mark Brown, Song Liu, Giulio Benetti

Not all zero page implementations use empty_zero_page global pointer so
let's substitute empty_zero_page occurence with helper ZERO_PAGE(0).

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 drivers/acpi/scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 558664d169fc..4d2d274cc8ad 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -30,7 +30,7 @@ extern struct acpi_device *acpi_root;
 #define ACPI_BUS_HID			"LNXSYBUS"
 #define ACPI_BUS_DEVICE_NAME		"System Bus"
 
-#define INVALID_ACPI_HANDLE	((acpi_handle)empty_zero_page)
+#define INVALID_ACPI_HANDLE	((acpi_handle)ZERO_PAGE(0))
 
 static const char *dummy_hid = "device";
 
-- 
2.34.1


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

* [PATCH 2/3] spi: fsl-cpm: substitute empty_zero_page with helper ZERO_PAGE(0)
  2022-10-18 21:57 [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
@ 2022-10-18 21:57 ` Giulio Benetti
  2022-10-18 21:57 ` [PATCH 3/3] raid: " Giulio Benetti
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Giulio Benetti @ 2022-10-18 21:57 UTC (permalink / raw)
  To: Arnd Bergmann, linux-acpi, linux-kernel, linux-spi, linux-raid
  Cc: Rafael J . Wysocki, Len Brown, Mark Brown, Song Liu, Giulio Benetti

Not all zero page implementations use empty_zero_page global pointer so
let's substitute empty_zero_page occurence with helper ZERO_PAGE(0).

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 drivers/spi/spi-fsl-cpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-cpm.c b/drivers/spi/spi-fsl-cpm.c
index ee905880769e..17a44d4f5021 100644
--- a/drivers/spi/spi-fsl-cpm.c
+++ b/drivers/spi/spi-fsl-cpm.c
@@ -333,7 +333,7 @@ int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi)
 		goto err_bds;
 	}
 
-	mspi->dma_dummy_tx = dma_map_single(dev, empty_zero_page, PAGE_SIZE,
+	mspi->dma_dummy_tx = dma_map_single(dev, ZERO_PAGE(0), PAGE_SIZE,
 					    DMA_TO_DEVICE);
 	if (dma_mapping_error(dev, mspi->dma_dummy_tx)) {
 		dev_err(dev, "unable to map dummy tx buffer\n");
-- 
2.34.1


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

* [PATCH 3/3] raid: substitute empty_zero_page with helper ZERO_PAGE(0)
  2022-10-18 21:57 [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
  2022-10-18 21:57 ` [PATCH 2/3] spi: fsl-cpm: " Giulio Benetti
@ 2022-10-18 21:57 ` Giulio Benetti
  2022-10-19 11:00   ` Christoph Hellwig
  2022-10-19 14:56 ` (subset) [PATCH 1/3] ACPI: scan: " Mark Brown
  2022-11-03 18:53 ` Rafael J. Wysocki
  3 siblings, 1 reply; 11+ messages in thread
From: Giulio Benetti @ 2022-10-18 21:57 UTC (permalink / raw)
  To: Arnd Bergmann, linux-acpi, linux-kernel, linux-spi, linux-raid
  Cc: Rafael J . Wysocki, Len Brown, Mark Brown, Song Liu, Giulio Benetti

Not all zero page implementations use empty_zero_page global pointer so
let's substitute empty_zero_page occurence with helper ZERO_PAGE(0).

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 include/linux/raid/pq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index d6e5a1feb947..2dd46f4c7318 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -17,7 +17,7 @@
 /* We need a pre-zeroed page... if we don't want to use the kernel-provided
    one define it here */
 #if RAID6_USE_EMPTY_ZERO_PAGE
-# define raid6_empty_zero_page empty_zero_page
+# define raid6_empty_zero_page ZERO_PAGE(0)
 #else
 extern const char raid6_empty_zero_page[PAGE_SIZE];
 #endif
-- 
2.34.1


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

* Re: [PATCH 3/3] raid: substitute empty_zero_page with helper ZERO_PAGE(0)
  2022-10-18 21:57 ` [PATCH 3/3] raid: " Giulio Benetti
@ 2022-10-19 11:00   ` Christoph Hellwig
  2022-10-19 13:19     ` Giulio Benetti
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Christoph Hellwig @ 2022-10-19 11:00 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Arnd Bergmann, linux-acpi, linux-kernel, linux-spi, linux-raid,
	Rafael J . Wysocki, Len Brown, Mark Brown, Song Liu

On Tue, Oct 18, 2022 at 11:57:55PM +0200, Giulio Benetti wrote:
>  #if RAID6_USE_EMPTY_ZERO_PAGE
> -# define raid6_empty_zero_page empty_zero_page
> +# define raid6_empty_zero_page ZERO_PAGE(0)
>  #else
>  extern const char raid6_empty_zero_page[PAGE_SIZE];

RAID6_USE_EMPTY_ZERO_PAGE is never set to a non-zero value.  So this
is dead code and we can just remove all code related to the
RAID6_USE_EMPTY_ZERO_PAGE case.

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

* Re: [PATCH 3/3] raid: substitute empty_zero_page with helper ZERO_PAGE(0)
  2022-10-19 11:00   ` Christoph Hellwig
@ 2022-10-19 13:19     ` Giulio Benetti
  2022-10-19 16:04     ` [PATCH] lib/raid6: drop RAID6_USE_EMPTY_ZERO_PAGE Giulio Benetti
  2022-10-19 16:12     ` [PATCH 3/3] raid: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
  2 siblings, 0 replies; 11+ messages in thread
From: Giulio Benetti @ 2022-10-19 13:19 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Arnd Bergmann, linux-acpi, linux-kernel, linux-spi, linux-raid,
	Rafael J . Wysocki, Len Brown, Mark Brown, Song Liu

Hi Cristoph,

On 19/10/22 13:00, Christoph Hellwig wrote:
> On Tue, Oct 18, 2022 at 11:57:55PM +0200, Giulio Benetti wrote:
>>   #if RAID6_USE_EMPTY_ZERO_PAGE
>> -# define raid6_empty_zero_page empty_zero_page
>> +# define raid6_empty_zero_page ZERO_PAGE(0)
>>   #else
>>   extern const char raid6_empty_zero_page[PAGE_SIZE];
> 
> RAID6_USE_EMPTY_ZERO_PAGE is never set to a non-zero value.  So this
> is dead code and we can just remove all code related to the
> RAID6_USE_EMPTY_ZERO_PAGE case.

thank you for taking a look.
Should I send a patch for removing the code in this v2 patchset?

Best regards
-- 
Giulio Benetti
CEO/CTO@Benetti Engineering sas

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

* Re: (subset) [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0)
  2022-10-18 21:57 [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
  2022-10-18 21:57 ` [PATCH 2/3] spi: fsl-cpm: " Giulio Benetti
  2022-10-18 21:57 ` [PATCH 3/3] raid: " Giulio Benetti
@ 2022-10-19 14:56 ` Mark Brown
  2022-11-03 18:53 ` Rafael J. Wysocki
  3 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2022-10-19 14:56 UTC (permalink / raw)
  To: linux-acpi, linux-kernel, Giulio Benetti, linux-raid, linux-spi,
	Arnd Bergmann
  Cc: Song Liu, Rafael J . Wysocki, Len Brown

On Tue, 18 Oct 2022 23:57:53 +0200, Giulio Benetti wrote:
> Not all zero page implementations use empty_zero_page global pointer so
> let's substitute empty_zero_page occurence with helper ZERO_PAGE(0).
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[2/3] spi: fsl-cpm: substitute empty_zero_page with helper ZERO_PAGE(0)
      commit: 3be6acda8241352c57d47b4d7d9968cadcb954ea

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* [PATCH] lib/raid6: drop RAID6_USE_EMPTY_ZERO_PAGE
  2022-10-19 11:00   ` Christoph Hellwig
  2022-10-19 13:19     ` Giulio Benetti
@ 2022-10-19 16:04     ` Giulio Benetti
  2022-10-19 16:10       ` Christoph Hellwig
  2022-10-19 16:12     ` [PATCH 3/3] raid: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
  2 siblings, 1 reply; 11+ messages in thread
From: Giulio Benetti @ 2022-10-19 16:04 UTC (permalink / raw)
  To: linux-raid, linux-kernel
  Cc: Song Liu, Dirk Müller, Paul Menzel, Giulio Benetti,
	Christoph Hellwig

RAID6_USE_EMPTY_ZERO_PAGE is unused and hardcoded to 0, so let's drop it.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 include/linux/raid/pq.h | 8 --------
 lib/raid6/algos.c       | 2 --
 2 files changed, 10 deletions(-)

diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index d6e5a1feb947..f29aaaf2eb21 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -10,17 +10,9 @@
 
 #ifdef __KERNEL__
 
-/* Set to 1 to use kernel-wide empty_zero_page */
-#define RAID6_USE_EMPTY_ZERO_PAGE 0
 #include <linux/blkdev.h>
 
-/* We need a pre-zeroed page... if we don't want to use the kernel-provided
-   one define it here */
-#if RAID6_USE_EMPTY_ZERO_PAGE
-# define raid6_empty_zero_page empty_zero_page
-#else
 extern const char raid6_empty_zero_page[PAGE_SIZE];
-#endif
 
 #else /* ! __KERNEL__ */
 /* Used for testing in user space */
diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
index 39b74221f4a7..a22a05c9af8a 100644
--- a/lib/raid6/algos.c
+++ b/lib/raid6/algos.c
@@ -18,12 +18,10 @@
 #else
 #include <linux/module.h>
 #include <linux/gfp.h>
-#if !RAID6_USE_EMPTY_ZERO_PAGE
 /* In .bss so it's zeroed */
 const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
 EXPORT_SYMBOL(raid6_empty_zero_page);
 #endif
-#endif
 
 struct raid6_calls raid6_call;
 EXPORT_SYMBOL_GPL(raid6_call);
-- 
2.34.1


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

* Re: [PATCH] lib/raid6: drop RAID6_USE_EMPTY_ZERO_PAGE
  2022-10-19 16:04     ` [PATCH] lib/raid6: drop RAID6_USE_EMPTY_ZERO_PAGE Giulio Benetti
@ 2022-10-19 16:10       ` Christoph Hellwig
  2022-10-20 18:21         ` Song Liu
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2022-10-19 16:10 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: linux-raid, linux-kernel, Song Liu, Dirk Müller,
	Paul Menzel, Christoph Hellwig

On Wed, Oct 19, 2022 at 06:04:07PM +0200, Giulio Benetti wrote:
> RAID6_USE_EMPTY_ZERO_PAGE is unused and hardcoded to 0, so let's drop it.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 3/3] raid: substitute empty_zero_page with helper ZERO_PAGE(0)
  2022-10-19 11:00   ` Christoph Hellwig
  2022-10-19 13:19     ` Giulio Benetti
  2022-10-19 16:04     ` [PATCH] lib/raid6: drop RAID6_USE_EMPTY_ZERO_PAGE Giulio Benetti
@ 2022-10-19 16:12     ` Giulio Benetti
  2 siblings, 0 replies; 11+ messages in thread
From: Giulio Benetti @ 2022-10-19 16:12 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Arnd Bergmann, linux-acpi, linux-kernel, linux-spi, linux-raid,
	Rafael J . Wysocki, Len Brown, Mark Brown, Song Liu

Hi Christoph, All,

On 19/10/22 13:00, Christoph Hellwig wrote:
> On Tue, Oct 18, 2022 at 11:57:55PM +0200, Giulio Benetti wrote:
>>   #if RAID6_USE_EMPTY_ZERO_PAGE
>> -# define raid6_empty_zero_page empty_zero_page
>> +# define raid6_empty_zero_page ZERO_PAGE(0)
>>   #else
>>   extern const char raid6_empty_zero_page[PAGE_SIZE];
> 
> RAID6_USE_EMPTY_ZERO_PAGE is never set to a non-zero value.  So this
> is dead code and we can just remove all code related to the
> RAID6_USE_EMPTY_ZERO_PAGE case.

Here is a patch that removes that unused code:
https://lore.kernel.org/all/20221019160407.7550-1-giulio.benetti@benettiengineering.com/T/#u

and then makes this one useless so I ask to drop it please.

Thank you!

Best regards
-- 
Giulio Benetti
CEO/CTO@Benetti Engineering sas

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

* Re: [PATCH] lib/raid6: drop RAID6_USE_EMPTY_ZERO_PAGE
  2022-10-19 16:10       ` Christoph Hellwig
@ 2022-10-20 18:21         ` Song Liu
  0 siblings, 0 replies; 11+ messages in thread
From: Song Liu @ 2022-10-20 18:21 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Giulio Benetti, linux-raid, linux-kernel, Dirk Müller, Paul Menzel

On Wed, Oct 19, 2022 at 9:10 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Wed, Oct 19, 2022 at 06:04:07PM +0200, Giulio Benetti wrote:
> > RAID6_USE_EMPTY_ZERO_PAGE is unused and hardcoded to 0, so let's drop it.
>
> Looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Applied to md-next. Thanks!

Song

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

* Re: [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0)
  2022-10-18 21:57 [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
                   ` (2 preceding siblings ...)
  2022-10-19 14:56 ` (subset) [PATCH 1/3] ACPI: scan: " Mark Brown
@ 2022-11-03 18:53 ` Rafael J. Wysocki
  3 siblings, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2022-11-03 18:53 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Arnd Bergmann, linux-acpi, linux-kernel, linux-spi, linux-raid,
	Rafael J . Wysocki, Len Brown, Mark Brown, Song Liu

On Tue, Oct 18, 2022 at 11:59 PM Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
>
> Not all zero page implementations use empty_zero_page global pointer so
> let's substitute empty_zero_page occurence with helper ZERO_PAGE(0).
>
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  drivers/acpi/scan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 558664d169fc..4d2d274cc8ad 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -30,7 +30,7 @@ extern struct acpi_device *acpi_root;
>  #define ACPI_BUS_HID                   "LNXSYBUS"
>  #define ACPI_BUS_DEVICE_NAME           "System Bus"
>
> -#define INVALID_ACPI_HANDLE    ((acpi_handle)empty_zero_page)
> +#define INVALID_ACPI_HANDLE    ((acpi_handle)ZERO_PAGE(0))
>
>  static const char *dummy_hid = "device";
>
> --

Applied as 6.2 material, thanks!

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

end of thread, other threads:[~2022-11-03 18:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18 21:57 [PATCH 1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
2022-10-18 21:57 ` [PATCH 2/3] spi: fsl-cpm: " Giulio Benetti
2022-10-18 21:57 ` [PATCH 3/3] raid: " Giulio Benetti
2022-10-19 11:00   ` Christoph Hellwig
2022-10-19 13:19     ` Giulio Benetti
2022-10-19 16:04     ` [PATCH] lib/raid6: drop RAID6_USE_EMPTY_ZERO_PAGE Giulio Benetti
2022-10-19 16:10       ` Christoph Hellwig
2022-10-20 18:21         ` Song Liu
2022-10-19 16:12     ` [PATCH 3/3] raid: substitute empty_zero_page with helper ZERO_PAGE(0) Giulio Benetti
2022-10-19 14:56 ` (subset) [PATCH 1/3] ACPI: scan: " Mark Brown
2022-11-03 18:53 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.