Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: using PAGE_LENGTH instead of INIT_OFFSET #452

Merged
merged 1 commit into from
May 8, 2024
Merged

fix: using PAGE_LENGTH instead of INIT_OFFSET #452

merged 1 commit into from
May 8, 2024

Conversation

rqx110
Copy link
Contributor

@rqx110 rqx110 commented Apr 9, 2024

Description

for pageoffset in range(pages):
next_page = 0xa0 + pageoffset
if PAGE_LENGTH*(pageoffset + 1) <= epl_len:
datachunk = data[PAGE_LENGTH*pageoffset : PAGE_LENGTH*(pageoffset + 1)]
self.xcvr_eeprom.write_raw(next_page*PAGE_LENGTH+INIT_OFFSET, PAGE_LENGTH, datachunk)
else:
datachunk = data[INIT_OFFSET*pageoffset : ]
self.xcvr_eeprom.write_raw(next_page*PAGE_LENGTH+INIT_OFFSET, len(datachunk), datachunk)

here, on line 363 uses PAGE_LENGTH, but on line 366 uses INIT_OFFSET. This must be an oversight。
Although the two values are equal, they are semantically different.

Motivation and Context

None

Additional Information (Optional)

@prgeor
Copy link
Collaborator

prgeor commented Apr 9, 2024

@rqx110 please add more details in the PR

Description

Motivation and Context

Additional Information (Optional)

Copy link
Collaborator

@prgeor prgeor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qinchuanares can you review?

@prgeor prgeor merged commit 0362460 into sonic-net:master May 8, 2024
5 checks passed
@rqx110 rqx110 deleted the patch-1 branch May 8, 2024 05:15
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this pull request Oct 25, 2024
…y once (sonic-net#452)

The values of position_in_parent and parent_name for PSU will remain unchanged.
Consequently, update the predefined position_in_parent and parent_name of the PSU only once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants