summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStefan Roese <[email protected]>2020-03-06 15:14:05 +0100
committerDaniel Schwierzeck <[email protected]>2020-04-27 20:30:13 +0200
commit04d21a93fa36e43f992ed224dc9615492c578ce2 (patch)
tree763ff1c2e097c5a2bee2c17dd3f35c3e65ee2eed /include/linux
parent112add362be04d085bd6b6a9d728242639404c21 (diff)
mips: mt76x8: ddr_cal: Correct dqs_find_min/max implementations
The current implementations have some issues detecting the correct values: dqs_find_max() will return "last passing fieldval + 1" instead of "last passing fieldval". Also it will return "maxval + 1" in the case that all fieldvals are tested valid (without error). dqs_find_min() will not test the "lowest" value because of using ">" instead of ">=". This patch now rewrites these functions to fix those issues. Also, this patch uses the same approach of a for loop in both functions making it easier to read and maintain. Since the variables are integers now, we can use min()/max(), which handles the wrap around case for fieldval=0: return (0 - 1). Signed-off-by: Stefan Roese <[email protected]> Cc: Weijie Gao <[email protected]> Cc: Daniel Schwierzeck <[email protected]> Reviewed-by: Weijie Gao <[email protected]>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions