Fix read_value() to correctly scale value when shift parameter is negative.

This commit is contained in:
Martin Whitaker 2024-06-21 22:25:23 +01:00
parent 3f86696f00
commit f52751d325
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2020 Martin Whitaker. // Copyright (C) 2020-2024 Martin Whitaker.
// //
// Derived from an extract of memtest86+ lib.c: // Derived from an extract of memtest86+ lib.c:
// //
@ -136,5 +136,5 @@ uintptr_t read_value(int row, int col, int field_width, int shift)
} }
} }
return shift < 0 ? value >> shift : value << shift; return shift < 0 ? value >> -shift : value << shift;
} }