From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Cc: mm-commits@vger.kernel.org, torvalds@linux-foundation.org,
masahiroy@kernel.org, keescook@chromium.org,
gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com,
Jason@zx2c4.com, akpm@linux-foundation.org
Subject: [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array
Date: Thu, 20 Oct 2022 12:49:45 +0300 [thread overview]
Message-ID: <Y1EZuQcO8UoN91cX@localhost.localdomain> (raw)
In-Reply-To: <20221020000356.177CDC433C1@smtp.kernel.org>
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>
---
arch/x86/events/intel/p4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/events/intel/p4.c
+++ b/arch/x86/events/intel/p4.c
@@ -24,7 +24,7 @@ struct p4_event_bind {
unsigned int escr_msr[2]; /* ESCR MSR for this event */
unsigned int escr_emask; /* valid ESCR EventMask bits */
unsigned int shared; /* event is shared across threads */
- char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on absence */
+ signed char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on absence */
};
struct p4_pebs_bind {
next prev parent reply other threads:[~2022-10-20 9:50 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 0:03 + kbuild-treat-char-as-always-unsigned.patch added to mm-nonmm-unstable branch Andrew Morton
2022-10-20 9:43 ` Alexey Dobriyan
2022-10-20 9:49 ` Alexey Dobriyan [this message]
2022-10-20 9:56 ` [PATCH -mm] -funsigned-char, namei: delete cast in lookup_one_common() Alexey Dobriyan
2022-10-20 16:28 ` [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array Jason A. Donenfeld
2022-10-20 17:14 ` Linus Torvalds
2022-10-20 17:33 ` Jason A. Donenfeld
2022-10-20 17:42 ` Linus Torvalds
2022-10-20 18:57 ` Kees Cook
2022-10-20 19:39 ` Linus Torvalds
2022-10-20 20:17 ` Linus Torvalds
2022-10-20 21:34 ` Andy Shevchenko
2022-10-20 22:46 ` Jason A. Donenfeld
2022-10-21 6:48 ` Greg KH
2022-10-21 7:24 ` Jason A. Donenfeld
2022-10-21 7:36 ` Greg KH
2022-10-26 1:50 ` Jason A. Donenfeld
2022-10-26 12:58 ` [cocci] " Jason A. Donenfeld
2022-10-26 12:58 ` Jason A. Donenfeld
2022-10-26 13:17 ` [cocci] " Andy Shevchenko
2022-10-26 13:17 ` Andy Shevchenko
2022-11-02 17:17 ` [cocci] " Julia Lawall
2022-11-03 0:08 ` Jason A. Donenfeld
2022-11-03 6:31 ` Julia Lawall
2022-11-03 12:45 ` Julia Lawall
2022-11-03 12:47 ` Jason A. Donenfeld
2022-11-03 12:57 ` Julia Lawall
2022-11-03 14:07 ` Jason A. Donenfeld
2022-10-24 15:44 ` Jason A. Donenfeld
2022-10-21 5:59 ` Alexey Dobriyan
2022-10-21 17:11 ` Linus Torvalds
2022-10-21 17:23 ` Linus Torvalds
2022-10-20 16:24 ` + kbuild-treat-char-as-always-unsigned.patch added to mm-nonmm-unstable branch Jason A. Donenfeld
2022-10-20 21:12 ` Andrew Morton
2022-10-20 21:13 ` Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y1EZuQcO8UoN91cX@localhost.localdomain \
--to=adobriyan@gmail.com \
--cc=Jason@zx2c4.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.