From: fengsheng fengsheng5@huawei.com
driver inclusion category: cleanup bugzilla: NA CVE: NA
1. sfc cleancode
Signed-off-by: fengsheng fengsheng5@huawei.com Reviewed-by: zhangmu zhangmu1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/mtd/hisilicon/sfc/hrd_common.h | 54 +++++++++++++-------------- drivers/mtd/hisilicon/sfc/hrd_sfc_driver.c | 4 +- drivers/mtd/hisilicon/sfc/hrd_sflash_core.c | 12 ++---- drivers/mtd/hisilicon/sfc/hrd_sflash_core.h | 2 + drivers/mtd/hisilicon/sfc/hrd_sflash_driver.h | 6 +-- drivers/mtd/hisilicon/sfc/hrd_sflash_hal.c | 5 +-- drivers/mtd/hisilicon/sfc/hrd_sflash_hal.h | 1 + drivers/mtd/hisilicon/sfc/hrd_sflash_spec.h | 4 +- 8 files changed, 42 insertions(+), 46 deletions(-)
diff --git a/drivers/mtd/hisilicon/sfc/hrd_common.h b/drivers/mtd/hisilicon/sfc/hrd_common.h index d36a7a3..71dcaa9 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_common.h +++ b/drivers/mtd/hisilicon/sfc/hrd_common.h @@ -40,39 +40,39 @@ #define HRD_COMMON_ERR_RES_NOT_EXIST (int)(HRD_COMMON_ERR_BASE - 13)
/* 16 bit nibble swap. example 0x1234 -> 0x2143 */ -#define HRD_NIBBLE_SWAP_16BIT(X) ((((X)&0xf) << 4) | \ - (((X)&0xF0) >> 4) | \ - (((X)&0xF00) << 4) | \ - (((X)&0xF000) >> 4)) +#define HRD_NIBBLE_SWAP_16BIT(X) ((((X) & 0xf) << 4) | \ + (((X) & 0xF0) >> 4) | \ + (((X) & 0xF00) << 4) | \ + (((X) & 0xF000) >> 4))
/* 32 bit nibble swap. example 0x12345678 -> 0x21436587 */ -#define HRD_NIBBLE_SWAP_32BIT(X) (((X&0xF) << 4) | \ - (((X)&0xF0) >> 4) | \ - (((X)&0xF00) << 4) | \ - (((X)&0xF000) >> 4) | \ - (((X)&0xF0000) << 4) | \ - (((X)&0xF00000) >> 4) | \ - (((X)&0xF000000) << 4) | \ - (((X)&0xF0000000) >> 4)) +#define HRD_NIBBLE_SWAP_32BIT(X) ((((X) & 0xF) << 4) | \ + (((X) & 0xF0) >> 4) | \ + (((X) & 0xF00) << 4) | \ + (((X) & 0xF000) >> 4) | \ + (((X) & 0xF0000) << 4) | \ + (((X) & 0xF00000) >> 4) | \ + (((X) & 0xF000000) << 4) | \ + (((X) & 0xF0000000) >> 4))
/* 16 bit byte swap. example 0x1234->0x3412 */ -#define HRD_BYTE_SWAP_16BIT(X) ((((X)&0xFF)<<8) | (((X)&0xFF00)>>8)) +#define HRD_BYTE_SWAP_16BIT(X) ((((X) & 0xFF) << 8) | (((X) & 0xFF00) >> 8))
/* 32 bit byte swap. example 0x12345678->0x78563412 */ -#define HRD_BYTE_SWAP_32BIT(X) ((((X)&0xFF)<<24) | \ - (((X)&0xFF00)<<8) | \ - (((X)&0xFF0000)>>8) | \ - (((X)&0xFF000000)>>24)) +#define HRD_BYTE_SWAP_32BIT(X) ((((X) & 0xFF) << 24) | \ + (((X) & 0xFF00) << 8) | \ + (((X) & 0xFF0000) >> 8) | \ + (((X) & 0xFF000000) >> 24))
/* 64 bit byte swap. example 0x11223344.55667788 -> 0x88776655.44332211 */ -#define HRD_BYTE_SWAP_64BIT(X) ((l64) ((((X)&0xFFULL)<<56) | \ - (((X)&0xFF00ULL)<<40) | \ - (((X)&0xFF0000ULL)<<24) | \ - (((X)&0xFF000000ULL)<<8) | \ - (((X)&0xFF00000000ULL)>>8) | \ - (((X)&0xFF0000000000ULL)>>24) | \ - (((X)&0xFF000000000000ULL)>>40) | \ - (((X)&0xFF00000000000000ULL)>>56))) +#define HRD_BYTE_SWAP_64BIT(X) ((l64) ((((X) & 0xFFULL) << 56) | \ + (((X) & 0xFF00ULL) << 40) | \ + (((X) & 0xFF0000ULL) << 24) | \ + (((X) & 0xFF000000ULL) << 8) | \ + (((X) & 0xFF00000000ULL) >> 8) | \ + (((X) & 0xFF0000000000ULL) >> 24) | \ + (((X) & 0xFF000000000000ULL) >> 40) | \ + (((X) & 0xFF00000000000000ULL) >> 56)))
/* -- Endianess macros. */ #ifdef HRD_ENDNESS_BIGEND @@ -91,10 +91,8 @@ #define HRD_64BIT_BE(X) HRD_BYTE_SWAP_64BIT(X) #endif
-#define VOID void - #ifndef NULL -#define NULL ((VOID *)0) +#define NULL ((void *)0) #endif
#define MTD_FLASH_MAP_DEBUG diff --git a/drivers/mtd/hisilicon/sfc/hrd_sfc_driver.c b/drivers/mtd/hisilicon/sfc/hrd_sfc_driver.c index 6a10106..8935263 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_sfc_driver.c +++ b/drivers/mtd/hisilicon/sfc/hrd_sfc_driver.c @@ -26,9 +26,9 @@ #include "hrd_common.h" #include "hrd_sflash_driver.h"
-#define SFC_DRIVER_VERSION "1.8.15.0" +#define SFC_DRIVER_VERSION "1.9.39.0"
-static const char *g_sflashMtdList[] = { "sflash", NULL }; +static const char *g_sflashMtdList[] = {"sflash", NULL};
static unsigned int hrd_flash_info_fill(struct maps_init_info *maps, struct resource *flash_iores, struct platform_device *pdev) diff --git a/drivers/mtd/hisilicon/sfc/hrd_sflash_core.c b/drivers/mtd/hisilicon/sfc/hrd_sflash_core.c index 7341f9e..68547d8 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_sflash_core.c +++ b/drivers/mtd/hisilicon/sfc/hrd_sflash_core.c @@ -28,7 +28,6 @@ #include <linux/signal.h> #include <linux/types.h> #include "hrd_common.h" -#include "hrd_sflash_driver.h" #include "hrd_sflash_spec.h" #include "hrd_sflash_core.h"
@@ -205,7 +204,6 @@ s32 SFC_ClearStatus(struct SFC_SFLASH_INFO *sflash) (void)SFC_ClearInt(sflash->sfc_reg_base);
if (sflash->manufacturerId == HISI_SPANSION_MANF_ID) { - /* 30 for spansion , clear status */ SFC_RegisterWrite(sflash->sfc_reg_base + CMD_INS, 0x30);
@@ -234,7 +232,6 @@ void SFC_CheckErr(struct SFC_SFLASH_INFO *sflash) unsigned long delay_us = 50; /* delay 50us */
if (sflash->manufacturerId == HISI_SPANSION_MANF_ID) { - ulRegValue = SFC_ReadStatus(sflash); if (ulRegValue == WAIT_TIME_OUT) { pr_err("[SFC] [%s %d]: SFC_ReadStatus time out\n", @@ -362,7 +359,7 @@ s32 SFC_RegWordAlignRead(struct SFC_SFLASH_INFO *sflash, u32 ulRegValue; s32 ulRet;
- if (!ulReadLen || ulReadLen > SFC_HARD_BUF_LEN || (ulReadLen&0x3)) { + if (!ulReadLen || ulReadLen > SFC_HARD_BUF_LEN || (ulReadLen & 0x3)) { pr_err("[SFC] [%s %d]: len=%u err\n", __func__, __LINE__, ulReadLen); return HRD_ERR; } @@ -379,7 +376,7 @@ s32 SFC_RegWordAlignRead(struct SFC_SFLASH_INFO *sflash, ulRegValue = SFC_RegisterRead(sflash->sfc_reg_base + CMD_CONFIG); ulRegValue &= (~(0xff << DATA_CNT) & (~(1 << SEL_CS))); ulRegValue |= - ((ulReadLen-1) << DATA_CNT) | (1 << ADDR_EN) | (1 << DATA_EN) | (1 << RW_DATA) + ((ulReadLen - 1) << DATA_CNT) | (1 << ADDR_EN) | (1 << DATA_EN) | (1 << RW_DATA) | (SFC_CHIP_CS << SEL_CS) | (0x1 << START);
wmb(); @@ -398,7 +395,6 @@ s32 SFC_RegWordAlignRead(struct SFC_SFLASH_INFO *sflash, pulData[i] = SFC_RegisterRead(sflash->sfc_reg_base + DATABUFFER1 + (u32)(0x4 * i));
return ulRet; - }
s32 SFC_RegByteRead(struct SFC_SFLASH_INFO *sflash, @@ -448,7 +444,7 @@ s32 SFC_RegWordAlignWrite(struct SFC_SFLASH_INFO *sflash, s32 ulRet;
ulRet = SFC_WriteEnable(sflash); - if (!ulWriteLen || ulWriteLen > SFC_HARD_BUF_LEN || (ulWriteLen&0x3)) { + if ((!ulWriteLen) || (ulWriteLen > SFC_HARD_BUF_LEN) || (ulWriteLen & 0x3)) { pr_err("[SFC] [%s %d]: len=%u err\n", __func__, __LINE__, ulWriteLen); ulRet = HRD_ERR; goto rel; @@ -471,7 +467,7 @@ s32 SFC_RegWordAlignWrite(struct SFC_SFLASH_INFO *sflash, ulRegValue = SFC_RegisterRead(sflash->sfc_reg_base + CMD_CONFIG); ulRegValue &= (~(0xff << DATA_CNT)) & (~(1 << RW_DATA) & (~(1 << SEL_CS))); - ulRegValue |= ((ulWriteLen-1) << DATA_CNT) | (1 << ADDR_EN) | (1 << DATA_EN) + ulRegValue |= ((ulWriteLen - 1) << DATA_CNT) | (1 << ADDR_EN) | (1 << DATA_EN) | (SFC_CHIP_CS << SEL_CS) | (0x1 << START);
wmb(); diff --git a/drivers/mtd/hisilicon/sfc/hrd_sflash_core.h b/drivers/mtd/hisilicon/sfc/hrd_sflash_core.h index 9002c3e..56c4417 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_sflash_core.h +++ b/drivers/mtd/hisilicon/sfc/hrd_sflash_core.h @@ -17,6 +17,8 @@ #ifndef __HRD_SFLASH_CORE_H__ #define __HRD_SFLASH_CORE_H__
+#include "hrd_sflash_driver.h" + #define SFC_HARD_BUF_LEN (256)
#define SPI_CMD_SR_WIP 1 /* Write in Progress bit in status register position */ diff --git a/drivers/mtd/hisilicon/sfc/hrd_sflash_driver.h b/drivers/mtd/hisilicon/sfc/hrd_sflash_driver.h index 3494787..f659758 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_sflash_driver.h +++ b/drivers/mtd/hisilicon/sfc/hrd_sflash_driver.h @@ -14,8 +14,8 @@ * */
-#ifndef _HRD_SLASH_DRIVER_H -#define _HRD_SLASH_DRIVER_H +#ifndef _HRD_SFLASH_DRIVER_H +#define _HRD_SFLASH_DRIVER_H
#include <linux/mtd/map.h>
@@ -102,4 +102,4 @@ struct SFC_SFLASH_INFO { extern struct mtd_info *sflash_probe(struct map_info *map, struct resource *sfc_regres); extern void sflash_destroy(struct mtd_info *mtd);
-#endif /* _HRD_SLASH_DRIVER_H */ +#endif /* _HRD_SLASH_DRIVER_H */ diff --git a/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.c b/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.c index 8f5b387..ec9887a7 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.c +++ b/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.c @@ -700,7 +700,6 @@ s32 SFC_BlockErase(struct SFC_SFLASH_INFO *sflash, u32 ulAddr, u32 ErCmd) rel: SFC_FlashUnlock(sflash); return ulRet; - }
static s32 _SFC_RegModeWrite(struct SFC_SFLASH_INFO *sflash, @@ -727,7 +726,7 @@ static s32 _SFC_RegModeWrite(struct SFC_SFLASH_INFO *sflash, }
if (ulRemain >= 0x4) { - slRet = SFC_RegWordAlignWrite(sflash, (const u32 *)(pucSrc + i), offset + i, ulRemain&(~0x3)); + slRet = SFC_RegWordAlignWrite(sflash, (const u32 *)(pucSrc + i), offset + i, ulRemain & (~0x3)); if (slRet != HRD_OK) { pr_err("[SFC] [%s %d]: SFC_RegWordAlignWrite fail\n", __func__, __LINE__); return slRet; @@ -805,7 +804,7 @@ s32 SFC_RegModeRead(struct SFC_SFLASH_INFO *sflash, }
if (ulRemain >= 0x4) { - ret = SFC_RegWordAlignRead(sflash, offset + i, (u32 *) (pucDest + i), ulRemain&(~0x3)); + ret = SFC_RegWordAlignRead(sflash, offset + i, (u32 *) (pucDest + i), ulRemain & (~0x3)); if (ret != HRD_OK) { pr_err("[SFC] [%s %d]: SFC_RegWordAlignRead fail\n", __func__, __LINE__); return ret; diff --git a/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.h b/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.h index 78c921c..f612731 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.h +++ b/drivers/mtd/hisilicon/sfc/hrd_sflash_hal.h @@ -16,6 +16,7 @@
#ifndef __HRD_SFLASH_HAL_H__ #define __HRD_SFLASH_HAL_H__ +#include "hrd_sflash_driver.h"
extern void SFC_CheckErr(struct SFC_SFLASH_INFO *sflash); extern s32 SFC_RegModeRead(struct SFC_SFLASH_INFO *sflash, u32 offset, diff --git a/drivers/mtd/hisilicon/sfc/hrd_sflash_spec.h b/drivers/mtd/hisilicon/sfc/hrd_sflash_spec.h index a59965b..151957d 100644 --- a/drivers/mtd/hisilicon/sfc/hrd_sflash_spec.h +++ b/drivers/mtd/hisilicon/sfc/hrd_sflash_spec.h @@ -14,8 +14,8 @@ * */
-#ifndef __SPI_FLASH_SPEC_H__ -#define __SPI_FLASH_SPEC_H__ +#ifndef __HRD_SFLASH_SPEC_H__ +#define __HRD_SFLASH_SPEC_H__
#define SFLASH_DEFAULT_RDID_OPCD 0x9F /* Default Read ID */ #define SFLASH_DEFAULT_WREN_OPCD 0x06 /* Default Write Enable */
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 {
From: fengsheng fengsheng5@huawei.com
driver inclusion category: cleanup bugzilla: NA CVE: NA
1. localbus 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/lbc/hs_lbc_pltfm.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c b/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c index 2b3543b..c188cd3 100644 --- a/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c +++ b/drivers/soc/hisilicon/lbc/hs_lbc_pltfm.c @@ -29,7 +29,7 @@
#include "hs_lbc_pltfm.h"
-#define LBC_DRIVER_VERSION "1.9.30.0" +#define LBC_DRIVER_VERSION "1.9.39.0"
struct hisi_lbc_dev g_lbc_dev = {0};
@@ -127,7 +127,6 @@ static int hisi_lbc_para_check(unsigned int index, unsigned int offset, unsigned /* width check */ if ((type == LBC_RWDATA_WIDTH_16) || (type == LBC_RWDATA_WIDTH_32)) { - if (offset % (type * 0x2)) return -EINVAL; } @@ -153,7 +152,6 @@ static unsigned int lbc_read(unsigned int index, unsigned int offset, unsigned i spin_unlock_irqrestore(&g_lbc_dev.cs[index].lock, flags);
return value; - }
static unsigned int lbc_read_unlock(unsigned int index, unsigned int offset, unsigned int type) @@ -169,7 +167,6 @@ static unsigned int lbc_read_unlock(unsigned int index, unsigned int offset, uns value = readl(base_addr + offset) & 0xffffffff;
return value; - }
static int lbc_write(unsigned int index, unsigned int offset, unsigned int type, unsigned int data) @@ -290,7 +287,6 @@ int lbc_write8_nolock(unsigned int index, unsigned int offset, unsigned char dat
int lbc_write16(unsigned int index, unsigned int offset, unsigned short data) { - /* para check */ if (hisi_lbc_para_check(index, offset, LBC_RWDATA_WIDTH_16)) { pr_err("Lbc para check failed\n"); @@ -302,7 +298,6 @@ int lbc_write16(unsigned int index, unsigned int offset, unsigned short data)
int lbc_write32(unsigned int index, unsigned int offset, unsigned int data) { - /* para check */ if (hisi_lbc_para_check(index, offset, LBC_RWDATA_WIDTH_32)) { pr_err("Lbc para check failed\n"); @@ -374,7 +369,6 @@ static int hisi_lbc_cs_init(struct platform_device *pdev) g_lbc_dev.cs[index].shift = shift;
lbc_set_cs_data_offset(index, shift); - }
return 0; @@ -398,7 +392,6 @@ static int hisi_lbc_probe(struct platform_device *pdev) regs_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!g_lbc_dev.is_reg_remaped) { - g_lbc_dev.regs_base = devm_ioremap_resource(&pdev->dev, regs_base); g_lbc_dev.is_reg_remaped = 1; }