Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp605736rwi; Thu, 20 Oct 2022 03:00:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ooP+JScO9ZSyYXxmPFQAx8Q2rXiXSi/6vT7nGFey9GDdxyL6TY3i3zhKk1t1qpNKmyDwV X-Received: by 2002:a17:906:8a47:b0:78d:b6d8:f531 with SMTP id gx7-20020a1709068a4700b0078db6d8f531mr10347337ejc.287.1666260017441; Thu, 20 Oct 2022 03:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666260017; cv=none; d=google.com; s=arc-20160816; b=O+4VSRj21yYiQYaRpPuy4jb/AB+hpeigAUThQXbogKS1kQNYUd8RdRQrTwLr3AmZ+I g4QA4K2TSy5sfIRsKFJ7CejQ4YsOrKgvVQCgrHOOpFEWoSgMkUnKw9HTE8y9zUJ/oDMd sD4E4Uqqzj7ywdGGhUtzWBZquOg0R8coTUPtY20ACOxvXKLuO1hly/K6IjLAZQf9h0mY Mv4GkduNEpiBdBicH7WJbm/iHmdTzIljw5s31zrBQxSMgz58FnV+6MKbW/0WNIZJDS2h BAm2qoLWciz07v6e9syUcVu0xd3wTFrW/9EgeFviLe8B22UtivkS7ov9N/3T8SJgnV6Y kduQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn20-20020a17090794d400b007123952b00dsi16779508ejc.100.2022.10.20.02.59.49; Thu, 20 Oct 2022 03:00:17 -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-Type: text/plain; charset=utf-8 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 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 --- 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 {