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

Update RISCV_SCAN_DELAY_MAX to UINT_MAX #1137

Open
en-sc opened this issue Sep 23, 2024 · 0 comments
Open

Update RISCV_SCAN_DELAY_MAX to UINT_MAX #1137

en-sc opened this issue Sep 23, 2024 · 0 comments
Labels
Good First Issue This label marks the first good issue for anyone willing to contribute to the project.

Comments

@en-sc
Copy link
Collaborator

en-sc commented Sep 23, 2024

/* The scan delay values are passed to "jtag_add_runtest()", which accepts an
* "int". Therefore, the passed value should be no greater than "INT_MAX".
*
* Since the resulting delay value can be a sum of two individual delays,
* individual delays are limited to "INT_MAX / 2" to prevent overflow of the
* final sum.
*/
#define RISCV_SCAN_DELAY_MAX (INT_MAX / 2)

The reason for making RISCV_SCAN_DELAY_MAX INT_MAX / 2 no longer holds -- jtag_add_runtest() accepts an unsigned int since 0847a4d.

void jtag_add_runtest(unsigned int num_cycles, tap_state_t state)

This makes it possible to increase RISCV_SCAN_DELAY_MAX and remove/simplify checks.

@en-sc en-sc added the Good First Issue This label marks the first good issue for anyone willing to contribute to the project. label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue This label marks the first good issue for anyone willing to contribute to the project.
Projects
None yet
Development

No branches or pull requests

1 participant