3 ms·
I see. And the previous code didn't have this issue?
by thomasahle 11y ago
I see. And the previous code didn't have this issue?
- deleted 11y ago[deleted]
- sanderjd 11y agoHaven't read any of the relevant code, but if the new code returns a negative number representing an error, it will decrement the `str` pointer, whereas I'm guessing `simple_strtoul` leaves its `str` pointer alone on error.
- metric10 11y agoI don't know about Linux's simple_strtoul(), but the C library's strtoul(3) will return ULONG_MAX and set the string pointer to a valid location. So the old code COULD cause an issue if "io_tlb_nslabs" being equal to ULONG_MAX isn't accounted for later on, but adding -1 (0xffffffffffffffff) to a pointer (as the new code does) is far worse.