-
Notifications
You must be signed in to change notification settings - Fork 338
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 data types around batch.{c,h} #1202
Fix data types around batch.{c,h} #1202
Conversation
a93b7cb
to
3a139b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
A couple of minor nitpicks.
3a139b8
to
7d22ec1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch!
IMHO it can be merged as-is, although I have a couple suggestion. Please take a look.
Check that the value of dtmcs.abits is in the expected range. Make corrections of data types in batch.{c,h} and in related code. Some of the issues were found by activating "-Wconversion" in GCC, others by inspecting the code manually. This is an initial step towards being able to use "-Wconversion" on RISC-V target code, which will give us bit more confidence when refactoring or merging new patches. Changes made: - Check `dtmcs.abits` during examination. - DMI address is no larger than 32-bits per the debug spec. Changed address parameters of multiple functions from uint64_t to uint32_t. - The value passed to jtag_add_runtest() is now `unsigned int`, not `int`. No need for `assert(idle <= INT_MAX)` anymore. - `get_delay()` in batch.c can return an unsigned value. - Added few assertions around `field->num_bits` in batch.c. Change-Id: Ibfccd62d552063df6ab9b5a2d4ea4ed23617d3db Signed-off-by: Jan Matyas <[email protected]>
7d22ec1
to
a450a7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks a lot for this cleanup!
Check that the value of dtmcs.abits is in the expected range
during the target examination.
Make corrections of data types in batch.{c,h} and in related code.
Some of the issues were found by activating "-Wconversion" in GCC,
others by inspecting the code manually.
This is an initial step towards being able to use "-Wconversion" on
RISC-V target code, which will give us bit more confidence around
data types when refactoring or merging new patches.