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
This commit is contained in:
liujie_answer 2024-12-12 14:01:55 +08:00 committed by Jianping Liu
parent dd8418c96c
commit 9b08da6364
2 changed files with 10 additions and 5 deletions

View File

@ -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;
}

View File

@ -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