From: fengsheng fengsheng5@huawei.com
driver inclusion category: cleanup bugzilla: NA CVE: NA
1. sysctl cleancode
Signed-off-by: fengsheng fengsheng5@huawei.com Reviewed-by: zhangmu zhangmu1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/soc/hisilicon/sysctl/dmc_c_union_define.h | 1 - drivers/soc/hisilicon/sysctl/dmc_reg_offset.h | 1 - .../soc/hisilicon/sysctl/hllc_pcs_c_union_define.h | 1 - drivers/soc/hisilicon/sysctl/hllc_pcs_reg_offset.h | 1 - .../soc/hisilicon/sysctl/hllc_ras_c_union_define.h | 6 +- drivers/soc/hisilicon/sysctl/hllc_ras_reg_offset.h | 1 - .../hisilicon/sysctl/hllc_regs_c_union_define.h | 2 - .../soc/hisilicon/sysctl/hllc_regs_reg_offset.h | 1 - drivers/soc/hisilicon/sysctl/pa_c_union_define.h | 1 - drivers/soc/hisilicon/sysctl/pa_reg_offset.h | 1 - drivers/soc/hisilicon/sysctl/rasc_c_union_define.h | 3 - drivers/soc/hisilicon/sysctl/rasc_reg_offset.h | 1 - drivers/soc/hisilicon/sysctl/sysctl_dfx.h | 2 +- drivers/soc/hisilicon/sysctl/sysctl_drv.c | 5 +- drivers/soc/hisilicon/sysctl/sysctl_drv.h | 10 +- drivers/soc/hisilicon/sysctl/sysctl_local_ras.c | 1 - drivers/soc/hisilicon/sysctl/sysctl_local_ras.h | 134 ++++++++++----------- drivers/soc/hisilicon/sysctl/sysctl_pmbus.c | 4 +- drivers/soc/hisilicon/sysctl/sysctl_pmbus.h | 1 - 19 files changed, 76 insertions(+), 101 deletions(-)
diff --git a/drivers/soc/hisilicon/sysctl/dmc_c_union_define.h b/drivers/soc/hisilicon/sysctl/dmc_c_union_define.h index c269cc4..63a5607 100644 --- a/drivers/soc/hisilicon/sysctl/dmc_c_union_define.h +++ b/drivers/soc/hisilicon/sysctl/dmc_c_union_define.h @@ -37,7 +37,6 @@
/* Define an unsigned member */ unsigned int u32; - } dmc_ddrc_u_cfg_ecc;
#endif /* __DMC_C_UNION_DEFINE_H__ */ diff --git a/drivers/soc/hisilicon/sysctl/dmc_reg_offset.h b/drivers/soc/hisilicon/sysctl/dmc_reg_offset.h index 4b0910a..7be5ebf 100644 --- a/drivers/soc/hisilicon/sysctl/dmc_reg_offset.h +++ b/drivers/soc/hisilicon/sysctl/dmc_reg_offset.h @@ -23,7 +23,6 @@ /******************************************************************************/ /* xxx DMC Registers' Definitions */ /******************************************************************************/ - #define DMC_DMC_DDRC_CTRL_SREF_REG (DMC_DMC_BASE + 0x0) #define DMC_DMC_DDRC_CTRL_INIT_REG (DMC_DMC_BASE + 0x4) #define DMC_DMC_DDRC_CTRL_DDRRST_REG (DMC_DMC_BASE + 0x8) diff --git a/drivers/soc/hisilicon/sysctl/hllc_pcs_c_union_define.h b/drivers/soc/hisilicon/sysctl/hllc_pcs_c_union_define.h index c739238..7236363 100644 --- a/drivers/soc/hisilicon/sysctl/hllc_pcs_c_union_define.h +++ b/drivers/soc/hisilicon/sysctl/hllc_pcs_c_union_define.h @@ -40,7 +40,6 @@
/* Define an unsigned member */ unsigned int u32; - } pcs_u_tx_training_sts;
#endif /* __HLLC_PCS_C_UNION_DEFINE_H__ */ diff --git a/drivers/soc/hisilicon/sysctl/hllc_pcs_reg_offset.h b/drivers/soc/hisilicon/sysctl/hllc_pcs_reg_offset.h index fcd9e3b..edef291 100644 --- a/drivers/soc/hisilicon/sysctl/hllc_pcs_reg_offset.h +++ b/drivers/soc/hisilicon/sysctl/hllc_pcs_reg_offset.h @@ -23,7 +23,6 @@ /******************************************************************************/ /* xxx HLLC_PCS Registers' Definitions */ /******************************************************************************/ - #define HLLC_HLLC_PCS_PCS_GLOBAL_CFG_REG (HLLC_HLLC_PCS_BASE + 0x0) #define HLLC_HLLC_PCS_PCS_MISC_CFG_REG (HLLC_HLLC_PCS_BASE + 0x4) #define HLLC_HLLC_PCS_PCS_POLARITY_CFG_REG (HLLC_HLLC_PCS_BASE + 0x8) diff --git a/drivers/soc/hisilicon/sysctl/hllc_ras_c_union_define.h b/drivers/soc/hisilicon/sysctl/hllc_ras_c_union_define.h index 17f733a..c81ab85 100644 --- a/drivers/soc/hisilicon/sysctl/hllc_ras_c_union_define.h +++ b/drivers/soc/hisilicon/sysctl/hllc_ras_c_union_define.h @@ -14,8 +14,8 @@ * */
-#ifndef __C_UNION_DEFINE_HLLC_RAS_H__ -#define __C_UNION_DEFINE_HLLC_RAS_H__ +#ifndef __HLLC_RAS_C_UNION_DEFINE_H__ +#define __HLLC_RAS_C_UNION_DEFINE_H__
/* Define the union hllc_ras_u_err_misc1l */ typedef union { @@ -53,7 +53,6 @@
/* Define an unsigned member */ unsigned int u32; - } hllc_ras_u_err_misc1l;
/* Define the union hllc_ras_u_err_misc1h */ @@ -74,7 +73,6 @@
/* Define an unsigned member */ unsigned int u32; - } hllc_ras_u_err_misc1h;
#endif /* __C_UNION_DEFINE_HLLC_RAS_H__ */ diff --git a/drivers/soc/hisilicon/sysctl/hllc_ras_reg_offset.h b/drivers/soc/hisilicon/sysctl/hllc_ras_reg_offset.h index c09ab1e..efeba88 100644 --- a/drivers/soc/hisilicon/sysctl/hllc_ras_reg_offset.h +++ b/drivers/soc/hisilicon/sysctl/hllc_ras_reg_offset.h @@ -23,7 +23,6 @@ /******************************************************************************/ /* xxx HLLC_RAS Registers' Definitions */ /******************************************************************************/ - #define HLLC_HLLC_RAS_HLLC_ERR_FRL_REG (HLLC_HLLC_RAS_BASE + 0x2000) #define HLLC_HLLC_RAS_HLLC_ERR_FRH_REG (HLLC_HLLC_RAS_BASE + 0x2004) #define HLLC_HLLC_RAS_HLLC_ERR_CTRLL_REG (HLLC_HLLC_RAS_BASE + 0x2008) diff --git a/drivers/soc/hisilicon/sysctl/hllc_regs_c_union_define.h b/drivers/soc/hisilicon/sysctl/hllc_regs_c_union_define.h index 17ce166..34ad887 100644 --- a/drivers/soc/hisilicon/sysctl/hllc_regs_c_union_define.h +++ b/drivers/soc/hisilicon/sysctl/hllc_regs_c_union_define.h @@ -27,7 +27,6 @@
/* Define an unsigned member */ unsigned int u32; - } hllc_regs_u_inject_ecc_type;
/* Define the union hllc_regs_u_inject_ecc_en */ @@ -45,7 +44,6 @@
/* Define an unsigned member */ unsigned int u32; - } hllc_regs_u_inject_ecc_en;
#endif /* __HLLC_REGS_C_UNION_DEFINE_H__ */ diff --git a/drivers/soc/hisilicon/sysctl/hllc_regs_reg_offset.h b/drivers/soc/hisilicon/sysctl/hllc_regs_reg_offset.h index a9a3f59..5208d6a 100644 --- a/drivers/soc/hisilicon/sysctl/hllc_regs_reg_offset.h +++ b/drivers/soc/hisilicon/sysctl/hllc_regs_reg_offset.h @@ -23,7 +23,6 @@ /******************************************************************************/ /* xxx HLLC_REGS Registers' Definitions */ /******************************************************************************/ - #define HLLC_HLLC_REGS_HLLC_HYDRA_RX_AFULL_TH_CFG_REG (HLLC_HLLC_REGS_BASE + 0x0) #define HLLC_HLLC_REGS_HLLC_TOKEN_CFG_REG (HLLC_HLLC_REGS_BASE + 0x100) #define HLLC_HLLC_REGS_HLLC_RETRAINING_CFG0_REG (HLLC_HLLC_REGS_BASE + 0x300) diff --git a/drivers/soc/hisilicon/sysctl/pa_c_union_define.h b/drivers/soc/hisilicon/sysctl/pa_c_union_define.h index 81843d7..b759c47 100644 --- a/drivers/soc/hisilicon/sysctl/pa_c_union_define.h +++ b/drivers/soc/hisilicon/sysctl/pa_c_union_define.h @@ -40,7 +40,6 @@
/* Define an unsigned member */ unsigned int u32; - } pa_u_global_cfg;
#endif /* __PA_C_UNION_DEFINE_H__ */ diff --git a/drivers/soc/hisilicon/sysctl/pa_reg_offset.h b/drivers/soc/hisilicon/sysctl/pa_reg_offset.h index 21c98b2..7ca0fdc 100644 --- a/drivers/soc/hisilicon/sysctl/pa_reg_offset.h +++ b/drivers/soc/hisilicon/sysctl/pa_reg_offset.h @@ -23,7 +23,6 @@ /******************************************************************************/ /* xxx PA Registers' Definitions */ /******************************************************************************/ - #define PA_PA_ID_MAPPING_CFG_REG (PA_PA_BASE + 0x0) #define PA_PA_GLOBAL_CFG_REG (PA_PA_BASE + 0x4) #define PA_PA_LINK_DOWN_CFG_REG (PA_PA_BASE + 0x8) diff --git a/drivers/soc/hisilicon/sysctl/rasc_c_union_define.h b/drivers/soc/hisilicon/sysctl/rasc_c_union_define.h index 8d0e0b9..d4013df 100644 --- a/drivers/soc/hisilicon/sysctl/rasc_c_union_define.h +++ b/drivers/soc/hisilicon/sysctl/rasc_c_union_define.h @@ -36,7 +36,6 @@
/* Define an unsigned member */ unsigned int u32; - } ddrc_rasc_u_cfg_clr;
/* Define the union ddrc_rasc_u_cfg_info_rnk */ @@ -50,7 +49,6 @@
/* Define an unsigned member */ unsigned int u32; - } ddrc_rasc_u_cfg_info_rnk;
/* Define the union ddrc_rasc_u_his_ha_rankcnt_inf */ @@ -63,7 +61,6 @@
/* Define an unsigned member */ unsigned int u32; - } ddrc_rasc_u_his_ha_rankcnt_inf;
#endif /* __RASC_C_UNION_DEFINE_H__ */ diff --git a/drivers/soc/hisilicon/sysctl/rasc_reg_offset.h b/drivers/soc/hisilicon/sysctl/rasc_reg_offset.h index eddcb5c..b65da72 100644 --- a/drivers/soc/hisilicon/sysctl/rasc_reg_offset.h +++ b/drivers/soc/hisilicon/sysctl/rasc_reg_offset.h @@ -23,7 +23,6 @@ /******************************************************************************/ /* xxx RASC Registers' Definitions */ /******************************************************************************/ - #define DDRC_RASC_RASC_CTRL_MODE_REG (DDRC_RASC_BASE + 0x0) #define DDRC_RASC_RASC_CTRL_ADDDC_REG (DDRC_RASC_BASE + 0x4) #define DDRC_RASC_RASC_CTRL_PASCRUB_REG (DDRC_RASC_BASE + 0x8) diff --git a/drivers/soc/hisilicon/sysctl/sysctl_dfx.h b/drivers/soc/hisilicon/sysctl/sysctl_dfx.h index 146750f..cf0ab99 100644 --- a/drivers/soc/hisilicon/sysctl/sysctl_dfx.h +++ b/drivers/soc/hisilicon/sysctl/sysctl_dfx.h @@ -21,4 +21,4 @@ void sysctl_proc_exit(void); void sysctl_dfx_do_ras(struct acpi_hest_generic_data *gdata);
-#endif /*_SYSCTL_DFX_H_*/ +#endif /* _SYSCTL_DFX_H_ */ diff --git a/drivers/soc/hisilicon/sysctl/sysctl_drv.c b/drivers/soc/hisilicon/sysctl/sysctl_drv.c index 660d15a..3899fac 100644 --- a/drivers/soc/hisilicon/sysctl/sysctl_drv.c +++ b/drivers/soc/hisilicon/sysctl/sysctl_drv.c @@ -48,7 +48,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define DEBUG
-#define SYSCTL_DRIVER_VERSION "1.9.38.0" +#define SYSCTL_DRIVER_VERSION "1.9.39.1"
unsigned int g_sysctrl_debug;
@@ -143,7 +143,6 @@ int his_hllc_init(void) if (!g_hip_hllc_priv.ddrc_ta_base[chip_id][ddrc_num]) pr_err("chip=%u,ddr_ch=%u ddrc ta ioremap failed\n", chip_id, ddrc_num); } - }
return SYSCTL_ERR_OK; @@ -757,7 +756,6 @@ int hip_sysctrl_probe(void) int ret;
ret = his_hllc_init(); - if (ret != SYSCTL_ERR_OK) { pr_err("[ERROR] his_hllc_init fail, ret:[0x%x].\n", ret); return ret; @@ -771,7 +769,6 @@ int hip_sysctrl_remove(void) int ret;
ret = his_hllc_deinit(); - if (ret != SYSCTL_ERR_OK) { pr_err("[ERROR] his hllc deinit fail, ret:[0x%x].\n", ret); return ret; diff --git a/drivers/soc/hisilicon/sysctl/sysctl_drv.h b/drivers/soc/hisilicon/sysctl/sysctl_drv.h index 55ced55..ccc3234 100644 --- a/drivers/soc/hisilicon/sysctl/sysctl_drv.h +++ b/drivers/soc/hisilicon/sysctl/sysctl_drv.h @@ -14,10 +14,10 @@ * */
-#ifndef _HIS_SYSCTL_H_ -#define _HIS_SYSCTL_H_ +#ifndef _SYSCTL_DRV_H_ +#define _SYSCTL_DRV_H_
-/********************SYSCTRL ERR********************/ +/* SYSCTRL ERR */ #define SYSCTL_ERR_OK 0 /* Ok */ #define SYSCTL_ERR_PARAM 1 /* Invalid parameter */ #define SYSCTL_ERR_FAILED 2 /* Operation failed */ @@ -99,7 +99,6 @@
/* Define an unsigned member */ unsigned int u32; - } hllc_link_sta_info;
typedef union { @@ -124,7 +123,6 @@
/* Define an unsigned member */ unsigned int u32; - } hllc_mem_ecc_info;
typedef struct { @@ -136,4 +134,4 @@
u64 get_chip_base(void);
-#endif /* _HIS_SYSCTL_H_ */ +#endif /* _SYSCTL_DRV_H_ */ diff --git a/drivers/soc/hisilicon/sysctl/sysctl_local_ras.c b/drivers/soc/hisilicon/sysctl/sysctl_local_ras.c index 0ad5756..803e97f 100644 --- a/drivers/soc/hisilicon/sysctl/sysctl_local_ras.c +++ b/drivers/soc/hisilicon/sysctl/sysctl_local_ras.c @@ -462,7 +462,6 @@ static int sysctl_ghes_proc(struct ghes *sysctl_ghes)
static int sysctl_hisi_error_handler(struct work_struct *work) { - int ret = 0; struct ghes *sysctl_ghes = NULL; (void)work; diff --git a/drivers/soc/hisilicon/sysctl/sysctl_local_ras.h b/drivers/soc/hisilicon/sysctl/sysctl_local_ras.h index 6507799..8f4dd20 100644 --- a/drivers/soc/hisilicon/sysctl/sysctl_local_ras.h +++ b/drivers/soc/hisilicon/sysctl/sysctl_local_ras.h @@ -13,8 +13,8 @@ * GNU General Public License for more details. * */ -#ifndef _RP_INTERRUPT_H -#define _RP_INTERRUPT_H +#ifndef _SYSCTL_LOCAL_RAS_H_ +#define _SYSCTL_LOCAL_RAS_H_
enum { OEM1_SUB_MODULE_USB0 = 0, @@ -174,74 +174,74 @@ struct hisi_oem_type1_err_sec { };
struct hisi_oem_type2_err_sec { - u32 val_bits; - u8 version; - u8 soc_id; - u8 socket_id; - u8 nimbus_id; - u8 module_id; - u8 sub_module_id; - u8 err_severity; - u8 reserv; - u32 err_fr_0; - u32 err_fr_1; - u32 err_ctrl_0; - u32 err_ctrl_1; - u32 err_status_0; - u32 err_status_1; - u32 err_addr_0; - u32 err_addr_1; - u32 err_misc0_0; - u32 err_misc0_1; - u32 err_misc1_0; - u32 err_misc1_1; + u32 val_bits; + u8 version; + u8 soc_id; + u8 socket_id; + u8 nimbus_id; + u8 module_id; + u8 sub_module_id; + u8 err_severity; + u8 reserv; + u32 err_fr_0; + u32 err_fr_1; + u32 err_ctrl_0; + u32 err_ctrl_1; + u32 err_status_0; + u32 err_status_1; + u32 err_addr_0; + u32 err_addr_1; + u32 err_misc0_0; + u32 err_misc0_1; + u32 err_misc1_0; + u32 err_misc1_1; };
struct hisi_pcie_local_err_sec { - uint64_t val_bits; - u8 version; - u8 soc_id; - u8 socket_id; - u8 nimbus_id; - u8 sub_module_id; - u8 core_id; - u8 port_id; - u8 err_severity; - u16 err_type; - u8 reserv[2]; - u32 err_misc_0; - u32 err_misc_1; - u32 err_misc_2; - u32 err_misc_3; - u32 err_misc_4; - u32 err_misc_5; - u32 err_misc_6; - u32 err_misc_7; - u32 err_misc_8; - u32 err_misc_9; - u32 err_misc_10; - u32 err_misc_11; - u32 err_misc_12; - u32 err_misc_13; - u32 err_misc_14; - u32 err_misc_15; - u32 err_misc_16; - u32 err_misc_17; - u32 err_misc_18; - u32 err_misc_19; - u32 err_misc_20; - u32 err_misc_21; - u32 err_misc_22; - u32 err_misc_23; - u32 err_misc_24; - u32 err_misc_25; - u32 err_misc_26; - u32 err_misc_27; - u32 err_misc_28; - u32 err_misc_29; - u32 err_misc_30; - u32 err_misc_31; - u32 err_misc_32; + u64 val_bits; + u8 version; + u8 soc_id; + u8 socket_id; + u8 nimbus_id; + u8 sub_module_id; + u8 core_id; + u8 port_id; + u8 err_severity; + u16 err_type; + u8 reserv[2]; /* reserv 2 bytes */ + u32 err_misc_0; + u32 err_misc_1; + u32 err_misc_2; + u32 err_misc_3; + u32 err_misc_4; + u32 err_misc_5; + u32 err_misc_6; + u32 err_misc_7; + u32 err_misc_8; + u32 err_misc_9; + u32 err_misc_10; + u32 err_misc_11; + u32 err_misc_12; + u32 err_misc_13; + u32 err_misc_14; + u32 err_misc_15; + u32 err_misc_16; + u32 err_misc_17; + u32 err_misc_18; + u32 err_misc_19; + u32 err_misc_20; + u32 err_misc_21; + u32 err_misc_22; + u32 err_misc_23; + u32 err_misc_24; + u32 err_misc_25; + u32 err_misc_26; + u32 err_misc_27; + u32 err_misc_28; + u32 err_misc_29; + u32 err_misc_30; + u32 err_misc_31; + u32 err_misc_32; };
int hip_sysctl_local_ras_init(void); diff --git a/drivers/soc/hisilicon/sysctl/sysctl_pmbus.c b/drivers/soc/hisilicon/sysctl/sysctl_pmbus.c index 2c13343..74d06a8 100644 --- a/drivers/soc/hisilicon/sysctl/sysctl_pmbus.c +++ b/drivers/soc/hisilicon/sysctl/sysctl_pmbus.c @@ -135,7 +135,6 @@ int sysctl_reg_read32(u64 addr, u32 data_len) for (loop = 0; loop < data_len; loop++) { reg_addr = reg_base + loop * 0x4; data = readl(reg_addr); - pr_info("0x%llx: 0x%8.8x\n", addr + (u64)loop * 0x4, data); }
@@ -154,7 +153,6 @@ int sysctl_reg_write32(u64 addr, u32 data) return SYSCTL_ERR_PARAM; }
- reg_base = ioremap(addr, (u64)0x100); if (!reg_base) { pr_err("%s ioremap failed\n", __func__); @@ -557,7 +555,7 @@ int sysctl_cpu_voltage_read(u8 chip_id, u8 loop, u32 slave_addr) static int sysctl_cpu_convert_vol_to_vid(u32 vid_table, u32 value, u32 *vid) { if (vid_table == CPU_VOUT_MODE_VR125) { - *vid = (value/2 - 250) / 5 + 1; /* 2 1 5 and 250 are the number of relationships. */ + *vid = (value / 2 - 250) / 5 + 1; /* 2 1 5 and 250 are the number of relationships. */ } else if (vid_table == CPU_VOUT_MODE_VR120) { *vid = (value - 250) / 5 + 1; /* 1 5 and 250 are the number of relationships. */ } else { diff --git a/drivers/soc/hisilicon/sysctl/sysctl_pmbus.h b/drivers/soc/hisilicon/sysctl/sysctl_pmbus.h index 4001000..e1a4742 100644 --- a/drivers/soc/hisilicon/sysctl/sysctl_pmbus.h +++ b/drivers/soc/hisilicon/sysctl/sysctl_pmbus.h @@ -88,7 +88,6 @@
/* Define an unsigned member */ unsigned int u32; - } pmbus_vout_mode;
enum {