From 3a6b8fb9a7fa637b4de20d25892d8277f894926d Mon Sep 17 00:00:00 2001 From: liujie_answer Date: Thu, 12 Dec 2024 14:01:55 +0800 Subject: [PATCH] scsi: Solve the problem of duplicate definition of first_online_pgdat and next_online_pgdat functions in ps3stor and other modules category: bugfix Rename first_online_pgdat to ps3_first_online_pgdat Rename next_online_pgdat to ps3_next_online_pgdat Add for_each_ps3_online_pgdat definition to replace for_each_online_pgdat Verified on x86 and arm64 Signed-off-by: liujie5@linkdatatechnology.com --- drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.c | 6 +++--- drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.h | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.c b/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.c index 2d7c1548ccca..3916188b4010 100644 --- a/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.c +++ b/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.c @@ -450,12 +450,12 @@ static inline bool ps3_pgdat_is_empty(pg_data_t *pgdat) return !pgdat->node_start_pfn && !pgdat->node_spanned_pages; } -struct pglist_data *first_online_pgdat(void) +struct pglist_data *ps3_first_online_pgdat(void) { return NODE_DATA(first_online_node); } -struct pglist_data *next_online_pgdat(struct pglist_data *pgdat) +struct pglist_data *ps3_next_online_pgdat(struct pglist_data *pgdat) { int nid = next_online_node(pgdat->node_id); if (nid == MAX_NUMNODES) { @@ -499,7 +499,7 @@ static void ps3_get_all_numa_mem_addr(struct ps3_instance *instance) if (ps3_get_numa_mem_addr(instance)) { goto l_out; } - for_each_online_pgdat(pgdata) { + for_each_ps3_online_pgdat(pgdata) { if (ps3_pgdat_is_empty(pgdata)) { continue; } diff --git a/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.h b/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.h index 026537ce793f..8bd6a820d32a 100644 --- a/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.h +++ b/drivers/scsi/linkdata/ps3stor/ps3_ioc_manager.h @@ -802,8 +802,13 @@ Bool ps3_feature_support_reg_get(struct ps3_instance *instance); void ps3_ioc_scsi_cmd_send(struct ps3_instance *instance, struct PS3CmdWord *cmd_word); -struct pglist_data *first_online_pgdat(void); +struct pglist_data *ps3_first_online_pgdat(void); -struct pglist_data *next_online_pgdat(struct pglist_data *pgdat); +struct pglist_data *ps3_next_online_pgdat(struct pglist_data *pgdat); + +#define for_each_ps3_online_pgdat(pgdat) \ + for (pgdat = ps3_first_online_pgdat(); \ + pgdat; \ + pgdat = ps3_next_online_pgdat(pgdat)) #endif -- Gitee