Skip to content

Commit

Permalink
Fix semgrep warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jemifdo committed May 9, 2024
1 parent 055eff0 commit 491236f
Show file tree
Hide file tree
Showing 21 changed files with 756 additions and 738 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,5 @@ portmap_56=63:10

pbmp_xport_xe=0x01FFFFFFFFFFFFFE

#
sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc
#
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
modreg ING_MISC_CONFIG INPUT_PRI_TAGGED=1
modreg ING_MISC_CONFIG INPUT_PRI_UNTAGGED=1
modreg QTG_CHIP_CONFIG.qtgport0 PAUSE_PFC_SEL=1
modreg QTG_CHIP_CONFIG.qtgport1 PAUSE_PFC_SEL=1
modreg CHIP_CONFIG.pmqport0 PAUSE_PFC_SEL=1
modreg CHIP_CONFIG.pmqport1 PAUSE_PFC_SEL=1
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ all:

clean:
rm -rf *.elf *.o *.map *.bin

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ This array would have port speed for each port, as per bit mapping defined in
"soc_led_speed_t" in $SDK/include/shared/cmicfw/cmicx_led_public.h file.
Here is an exception, please keep in mind:
1. For TH3, port status/speed of xe1 (physical port 258) is located in the
1. For TH3, port status/speed of xe1 (physical port 258) is located in the
accumulation entry/speed array of physical port 259.
******************************************************************************/
Expand All @@ -108,16 +108,16 @@ Here is an exception, please keep in mind:
#define LED_AMBER_BICOLOR 0x1 //bit : 01
#define LED_OFF_BICOLOR 0x3 //bit : 11
#define LED_SW_LINK_UP 0x1

unsigned short portmap[] = {
25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40,
33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 49, 50, 51, 52,
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 24, 23, 22, 21,
20, 19, 18, 17, 16, 15, 14, 13,
20, 19, 18, 17, 16, 15, 14, 13,
60, 58, 59, 57, 62, 64, 61, 63
};
};


/*
Expand All @@ -137,18 +137,18 @@ void custom_led_handler(soc_led_custom_handler_ctrl_t *ctrl,
uint8 idx = 0;
uint16 accu_val = 0, send_val = 0;
uint16 uc_port = 0, physical_port = 0;

/* Physical port numbers to be used */
for(uc_port = 0; uc_port < PORT_NUM_TOTAL; uc_port++) {

// change to zero-based
physical_port = portmap[uc_port] - 1;

/* Read value from led_ram bank0 */
accu_val = LED_HW_RAM_READ16(ctrl->accu_ram_base, physical_port);

send_val = LED_OFF_BICOLOR;

if (((accu_val & LED_HW_RX) || (accu_val & LED_HW_TX)) && (activity_count & ACTIVITY_TICKS))
{
send_val = LED_OFF_BICOLOR;
Expand All @@ -161,7 +161,7 @@ void custom_led_handler(soc_led_custom_handler_ctrl_t *ctrl,
{
send_val = LED_OFF_BICOLOR;
}

/* Write value to led_ram bank1 */
LED_HW_RAM_WRITE16(ctrl->pat_ram_base, uc_port, send_val);
} /* for */
Expand Down Expand Up @@ -190,4 +190,3 @@ void custom_led_handler(soc_led_custom_handler_ctrl_t *ctrl,
return;

}

6 changes: 4 additions & 2 deletions device/celestica/x86_64-cel_ds1000-r0/led_proc_init.soc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
linkscan off
m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin
led auto on
led start
sleep 3
led auto on; led start
linkscan on
1 change: 0 additions & 1 deletion device/celestica/x86_64-cel_ds1000-r0/media_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@
}
}
}

4 changes: 2 additions & 2 deletions device/celestica/x86_64-cel_ds1000-r0/pddf/pd-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"PSU":
{
"psu_present":
"psu_present":
{
"i2c":
{
"valmap": { "1":true, "0":false }
}
},
"psu_power_good":
"psu_power_good":
{
"i2c":
{
Expand Down
Loading

0 comments on commit 491236f

Please sign in to comment.