[openeuler:OLK-6.6 2229/2229] drivers/ata/ahci_zhaoxin_sgpio.c:31:5: warning: no previous prototype for function 'ahci_wait_em_reset'

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: baf4f02470215e4f896899f495ff7ac7fbfda979 commit: fb43492008c11fe89e510dd63383a2d37ea3cf8e [2229/2229] ata: ahci: Add support for AHCI SGPIO Enclosure Management config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250516/202505160312.82TOlGtS-lkp@i...) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) rustc: rustc 1.73.0 (cc66ad468 2023-10-03) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250516/202505160312.82TOlGtS-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202505160312.82TOlGtS-lkp@intel.com/ All warnings (new ones prefixed by >>):
drivers/ata/ahci_zhaoxin_sgpio.c:31:5: warning: no previous prototype for function 'ahci_wait_em_reset' [-Wmissing-prototypes] 31 | int ahci_wait_em_reset(struct sgpio_zhaoxin *sgpio_zhaoxin, u32 retry) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:31:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 31 | int ahci_wait_em_reset(struct sgpio_zhaoxin *sgpio_zhaoxin, u32 retry) | ^ | static drivers/ata/ahci_zhaoxin_sgpio.c:55:6: warning: no previous prototype for function 'ahci_zhaoxin_set_em_sgpio' [-Wmissing-prototypes] 55 | void ahci_zhaoxin_set_em_sgpio(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:55:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 55 | void ahci_zhaoxin_set_em_sgpio(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ | static drivers/ata/ahci_zhaoxin_sgpio.c:99:6: warning: no previous prototype for function 'ahci_zhaoxin_set_em_sgpio_gpmode' [-Wmissing-prototypes] 99 | void ahci_zhaoxin_set_em_sgpio_gpmode(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:99:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 99 | void ahci_zhaoxin_set_em_sgpio_gpmode(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ | static drivers/ata/ahci_zhaoxin_sgpio.c:601:6: warning: no previous prototype for function 'set_em_messages' [-Wmissing-prototypes] 601 | void set_em_messages(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:601:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 601 | void set_em_messages(struct sgpio_zhaoxin *sgpio_zhaoxin) | ^ | static drivers/ata/ahci_zhaoxin_sgpio.c:621:5: warning: no previous prototype for function 'add_sgpio_zhaoxin' [-Wmissing-prototypes] 621 | int add_sgpio_zhaoxin(void) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:621:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 621 | int add_sgpio_zhaoxin(void) | ^ | static drivers/ata/ahci_zhaoxin_sgpio.c:673:6: warning: no previous prototype for function 'remove_sgpio_zhaoxin' [-Wmissing-prototypes] 673 | void remove_sgpio_zhaoxin(void) | ^ drivers/ata/ahci_zhaoxin_sgpio.c:673:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 673 | void remove_sgpio_zhaoxin(void) | ^ | static 6 warnings generated.
vim +/ahci_wait_em_reset +31 drivers/ata/ahci_zhaoxin_sgpio.c 25 26 static unsigned int zhaoxin_em_type __read_mostly = AHCI_EM_MSG_LED_MODE; /*LED protocol*/ 27 module_param(zhaoxin_em_type, int, 0644); 28 MODULE_PARM_DESC(zhaoxin_em_type, 29 "AHCI Enclosure Management Message type control (1 = led on, 2 = sgpio on,3 = sgpio gp on)"); 30
31 int ahci_wait_em_reset(struct sgpio_zhaoxin *sgpio_zhaoxin, u32 retry) 32 { 33 void __iomem *mmio = sgpio_zhaoxin->mmio; 34 u32 em_ctl; 35 36 if (!sgpio_zhaoxin || retry == 0) { 37 pr_err("In ahci wait em reset, invalid param\n"); 38 return -EINVAL; 39 } 40 41 while (retry--) { /*EM_CTL needs reset at least 64ms*/ 42 em_ctl = readl(mmio + HOST_EM_CTL); 43 if (em_ctl & EM_CTL_RST) 44 usleep_range(10000, 20000); /*EM_CTL still in reset, usleep 10ms*/ 45 else 46 break; 47 48 if (!retry) 49 pr_err("Wait for EM_CTL reset, time out\n"); 50 } 51 52 return 0; 53 } 54 55 void ahci_zhaoxin_set_em_sgpio(struct sgpio_zhaoxin *sgpio_zhaoxin) 56 { 57 void __iomem *mmio = sgpio_zhaoxin->mmio; 58 void __iomem *em_mmio = mmio + SGPIO_OFFSET; 59 60 u32 read; 61 62 sgpio_zhaoxin->sgpio_reg.cfg_0.enable = 1; 63 64 sgpio_zhaoxin->sgpio_reg.cfg_1.blink_gen_a = 0x7; 65 sgpio_zhaoxin->sgpio_reg.cfg_1.blink_gen_b = 0x3; 66 sgpio_zhaoxin->sgpio_reg.cfg_1.blink_gen_c = 0x0; 67 sgpio_zhaoxin->sgpio_reg.cfg_1.stretch_act_on = 0; 68 sgpio_zhaoxin->sgpio_reg.cfg_1.stretch_act_off = 0; 69 sgpio_zhaoxin->sgpio_reg.cfg_1.max_act_on = 2; 70 sgpio_zhaoxin->sgpio_reg.cfg_1.force_act_off = 1; 71 72 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sload = 0xf; 73 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.count = 0x0; 74 75 sgpio_zhaoxin->sgpio_reg.transmit_0.sgpio_tx_0 = 0; 76 sgpio_zhaoxin->sgpio_reg.transmit_1.sgpio_tx_1 = 0; 77 sgpio_zhaoxin->sgpio_reg.gp_transmit_reg.sgpio_tx_gp = 0; 78 79 sgpio_zhaoxin->sgpio_reg.receive_reg.sgpio_rx = 0x07070707; 80 sgpio_zhaoxin->sgpio_reg.gp_receive_reg.sgpio_rx_gp = 0; 81 82 /*Setup SGPIO type*/ 83 read = readl(mmio + sgpio_zhaoxin->em_loc); 84 read = read | SGPIO_MESSAGE_HEAD; /*LED register MSG_HEAD, select SGPIO*/ 85 writel(read, mmio + sgpio_zhaoxin->em_loc); 86 87 /*Setup gp mode*/ 88 writel(sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sgpio_tx_gp_cfg, em_mmio + 0x38); 89 90 /*Initial SGPIO CFG1*/ 91 writel(sgpio_zhaoxin->sgpio_reg.cfg_1.sgpio_cfg_1, em_mmio + 0x4); 92 93 /*Initial SGPIO CFG0*/ 94 read = readl(em_mmio); 95 read |= sgpio_zhaoxin->sgpio_reg.cfg_0.sgpio_cfg_0; 96 writel(read, em_mmio); 97 } 98 99 void ahci_zhaoxin_set_em_sgpio_gpmode(struct sgpio_zhaoxin *sgpio_zhaoxin) 100 { 101 void __iomem *mmio = sgpio_zhaoxin->mmio; 102 void __iomem *em_mmio = mmio + SGPIO_OFFSET; 103 u32 read; 104 105 sgpio_zhaoxin->sgpio_reg.cfg_0.enable = 1; 106 107 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sload = 0xf; 108 sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.count = 0xff; 109 110 sgpio_zhaoxin->sgpio_reg.transmit_0.sgpio_tx_0 = 0; 111 sgpio_zhaoxin->sgpio_reg.transmit_1.sgpio_tx_1 = 0; 112 sgpio_zhaoxin->sgpio_reg.gp_transmit_reg.sgpio_tx_gp = 0; 113 114 sgpio_zhaoxin->sgpio_reg.receive_reg.sgpio_rx = 0; 115 sgpio_zhaoxin->sgpio_reg.gp_receive_reg.sgpio_rx_gp = 0xff0f0000; 116 117 /*Setup SGPIO type*/ 118 read = readl(mmio + sgpio_zhaoxin->em_loc); 119 read |= SGPIO_MESSAGE_HEAD; 120 writel(read, mmio + sgpio_zhaoxin->em_loc); 121 122 /*Setup gp mode*/ 123 writel(sgpio_zhaoxin->sgpio_reg.gp_transmit_cfg.sgpio_tx_gp_cfg, em_mmio + 0x38); 124 125 /*Enable SGPIO*/ 126 writel(sgpio_zhaoxin->sgpio_reg.cfg_0.sgpio_cfg_0, em_mmio); 127 } 128
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot