Skip to content

Commit

Permalink
Make is_flat_memory more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox committed Aug 16, 2024
1 parent 7f07fa6 commit 4103da3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def get_voltage(self):
return float("{:.3f}".format(voltage))

def is_flat_memory(self):
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD)
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD) is not False

def get_temperature_support(self):
return not self.is_flat_memory()
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/sff8436.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def set_power_override(self, power_override, power_set):
return ret

def is_flat_memory(self):
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD)
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD) is not False

def get_tx_power_support(self):
return False
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/sff8472.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def tx_disable_channel(self, channel, disable):
return self.tx_disable(disable) if channel != 0 else True

def is_flat_memory(self):
return not self.xcvr_eeprom.read(consts.PAGING_SUPPORT_FIELD)
return not self.xcvr_eeprom.read(consts.PAGING_SUPPORT_FIELD) is not False

def get_temperature_support(self):
return self.xcvr_eeprom.read(consts.DDM_SUPPORT_FIELD)
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_xcvr/api/public/sff8636.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def set_power_override(self, power_override, power_set):
return ret

def is_flat_memory(self):
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD)
return self.xcvr_eeprom.read(consts.FLAT_MEM_FIELD) is not False

def get_tx_power_support(self):
if self.is_copper():
Expand Down

0 comments on commit 4103da3

Please sign in to comment.