From patchwork Thu Oct 20 09:49:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 6107 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp6148wrr; Thu, 20 Oct 2022 02:54:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5wgZs72MQa1oMtORKBmnQghoZQC276Z2bA7dcBiM1XzYC1q+f2Gbr7YX4Mx2/0QRF4IPxn X-Received: by 2002:a17:90b:3d85:b0:20c:8f6a:8298 with SMTP id pq5-20020a17090b3d8500b0020c8f6a8298mr51879792pjb.242.1666259664939; Thu, 20 Oct 2022 02:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666259664; cv=none; d=google.com; s=arc-20160816; b=cNqAi47vyj6ItVMxS98/xPlyVO2y88IrDZ81RAYpEy9SvEw9yeomac4Qe7IP/v9yBW b7R4QYjKwQ5Q3Pvsj8pBGRpg9sj0AbzK/gXUxXKwRIMow6CWO3oLr1ID51bx3NkarRy7 JjHgPFz8+pEbWxgrRf4lGgbZwIdhwzLkOfAsd533erQhtgbhdtcB1gGqGvJ2TbA97aS/ AJt38ysWp5QlwKy0pTnt9SHD0lYMArOPxgx7CdmrM2ZxT4UKSy9AGdEUb5Jz7q5BlQN0 UtbXcnBMPbYkGtKxJXOKun+ni/oQJFWvulFX+y4WEs6857oWnEqEpewHxOP8osGDyiit W+Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CsbgLwtXWAZeUoPBDuirRh8cmWsDoeYMrYLPa9qkP64=; b=AEzNCTRsbWxhjEZx5EM7z52MtTy6x+Rt0Jcq8l+XvaPPebHyFpjMNmGUbdOoackear P1mQSMbq0DjOBSsZIiEJ08FgrZ7r7Zdcl6FkyP3s6m4vt/meneJTZLSNILxQdvkLiRpo J5BUDBBMbf07F8HShgCrZX00DxGrwJ05Um1DvjXEdlfHeCSgIKlX3OpV6ayoJGXT5BRp Gqjp7rejdfN3rCu8Q5mkPQCqfoIvjNSD7wIubtRPFgHYQzpxCvJa2q4LjWgE2UYN0UXO jw6IV8P7mjL2IRuAcVxcST3HDc2SZYVpQK/augIzv6LR+sySJSMyzKpbqfBysEkoUxuI zqBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=m2QbMSEZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a170902e81100b0017f6b2a8bc6si22135355plg.214.2022.10.20.02.54.12; Thu, 20 Oct 2022 02:54:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=m2QbMSEZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbiJTJuA (ORCPT + 99 others); Thu, 20 Oct 2022 05:50:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiJTJtv (ORCPT ); Thu, 20 Oct 2022 05:49:51 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6835E3CBF8; Thu, 20 Oct 2022 02:49:49 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id c3-20020a1c3503000000b003bd21e3dd7aso1910739wma.1; Thu, 20 Oct 2022 02:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CsbgLwtXWAZeUoPBDuirRh8cmWsDoeYMrYLPa9qkP64=; b=m2QbMSEZSz2NvNgQoSppIW5IjE0GNFw7ivno2OsayVLigqErIbVT7EP9JtEER/Rbw8 T9fU6zIKtD0aFOx76KZyRUMbBtnrP6GZ2wXg5ju1XI97od8DKKqiXiXja6iAVyqp0ruu lL/PzZdlbWPLox8TPyra/WPOJu8SjQIr7/9NLZVy8MhSRIAWTEBMYxM2ElU4Z4espQ7/ DRA9wPBe1wuVmnlTrKX0l2bZvYfhA9oSO++xcfKkHFFMvxMMxeIgn7vYTKzL9v83QOvY GqzJEqjHBH7NHmd4nSOtqMzyOthQsiPdgaU1856lGjHVIVIggYbsHSePicLcxrHfS0EM xDKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CsbgLwtXWAZeUoPBDuirRh8cmWsDoeYMrYLPa9qkP64=; b=RO8EZVuzKMMiEEaPD+cNmMLE4k2CoAExpPepgUIojqUuu3vwWZxoKfBVZ4WF8AEgDC KvB3E7INGYFfyh1USCMEsGW5P3qiKdXJcwqXs9+WYq1WkbU4dVDfYrLzUVPZYoAccTkR mdiAprNAXs2U9PlJjR1P/xqi0SxrMB25ZggPa3d0FhevisuPaxS2RLRhLQONjzU71v2c YSaHM1kcSPvx4AYwl3pI3J2C/0QjTXMbkvF4fVqO9nunPRJX3kV+8FNgfYntsN1bQAiw OO8XfJRHCGb5UOYVZDwcNopJHnSIoGZaBDbtbl935cVA0+HCb/d5i2+FxYsK0H4QE3Zi gMWg== X-Gm-Message-State: ACrzQf2qhkepbDD1O7DVx1HKoJHXIpn4NEW5Z2E13GrD8FCh/+dEtEoL NvewgMWDIwEtsRFCXeskwgeyM3Bweg== X-Received: by 2002:a05:600c:5398:b0:3c3:dccf:2362 with SMTP id hg24-20020a05600c539800b003c3dccf2362mr8927478wmb.89.1666259387545; Thu, 20 Oct 2022 02:49:47 -0700 (PDT) Received: from localhost.localdomain ([46.53.254.126]) by smtp.gmail.com with ESMTPSA id c26-20020a7bc85a000000b003b3307fb98fsm2314939wml.24.2022.10.20.02.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 02:49:47 -0700 (PDT) Date: Thu, 20 Oct 2022 12:49:45 +0300 From: Alexey Dobriyan 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 Message-ID: References: <20221020000356.177CDC433C1@smtp.kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221020000356.177CDC433C1@smtp.kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747199894768686110?= X-GMAIL-MSGID: =?utf-8?q?1747199894768686110?= 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 Reviewed-by: Jason A. Donenfeld --- 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 {