]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf/x86: Make struct p4_event_bind::cntr signed array
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 20 Oct 2022 09:49:45 +0000 (12:49 +0300)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 18 Nov 2022 23:56:15 +0000 (00:56 +0100)
commitadcd7118caadac54666081be39bbbc3e9b5e1f7d
tree25bdbb1332bdf7ac5404b40e6f9a897e10ec8d36
parent23a60a03d9a9980d1e91190491ceea0dc58fae62
perf/x86: Make struct p4_event_bind::cntr signed array

struct p4_event_bind::cntr[][] should be signed because of
the following code:

int i, j;
        for (i = 0; i < P4_CNTR_LIMIT; i++) {
  --->          j = bind->cntr[thread][i];
                if (j != -1 && !test_bit(j, used_mask))
                        return j;
        }

Making this member unsigned will make "j" 255 and fail "j != -1"
comparison.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
arch/x86/events/intel/p4.c