arc: Fix sscanf format strings for uint32_t
sscanf() was being used with "%d" to read data into an unsigned integer destination. If the value being read was greater than INT_MAX, the value was clamped to INT_MAX. This affected the reading of the idle "state" value, which can be 4294967295 (UINT_MAX). Unfortunately "-Wformat" does not seem to catch this problem. For safety, switch to using the format specifiers from inttypes.h, and use SCNu32 whenever a uint32_t is read. I assumed that all places that read a uint32_t really did want an unsigned 32 bit integer. TEST=Locally BUG=b:132637438 Change-Id: Ifb8627998152a1a8ef61a9974bc99db445580ea7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1612699 Reviewed-by:Yury Khmel <khmel@chromium.org> Reviewed-by:
Yusuke Sato <yusukes@chromium.org> Auto-Submit: Lloyd Pique <lpique@chromium.org> Commit-Queue: Lloyd Pique <lpique@chromium.org> Cr-Commit-Position: refs/heads/master@{#660182}
Loading
Please register or sign in to comment