Message ID | 20221018215755.33566-3-giulio.benetti@benettiengineering.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) | expand |
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.
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
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
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
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(-)