diff mbox series

[1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0)

Message ID 20221018215755.33566-1-giulio.benetti@benettiengineering.com
State Accepted
Commit 9256dac0c67ac2a47221f9409f2016ff5d1ddd78
Headers show
Series [1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) | expand

Commit Message

Giulio Benetti Oct. 18, 2022, 9:57 p.m. UTC
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(-)

Comments

Christoph Hellwig Oct. 19, 2022, 11 a.m. UTC | #1
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.
Giulio Benetti Oct. 19, 2022, 1:19 p.m. UTC | #2
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
Mark Brown Oct. 19, 2022, 2:56 p.m. UTC | #3
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
Giulio Benetti Oct. 19, 2022, 4:12 p.m. UTC | #4
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
Rafael J. Wysocki Nov. 3, 2022, 6:53 p.m. UTC | #5
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!
diff mbox series

Patch

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";