public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: libc-stable@sourceware.org
Subject: [COMMITTED/2.33 2/3] x86: Use SIZE_MAX instead of (long int)-1 for tunable range value
Date: Wed, 10 Feb 2021 19:26:03 +0530	[thread overview]
Message-ID: <20210210135604.445223-2-siddhesh@sourceware.org> (raw)
In-Reply-To: <20210210135604.445223-1-siddhesh@sourceware.org>

The tunable types are SIZE_T, so set the ranges to the correct maximum
value, i.e. SIZE_MAX.

(cherry picked from commit a1b8b06a55c1ee581d5ef860cec214b0c27a66f0)
---
 sysdeps/x86/dl-cacheinfo.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
index e0a72568d8..6f91651f0d 100644
--- a/sysdeps/x86/dl-cacheinfo.h
+++ b/sysdeps/x86/dl-cacheinfo.h
@@ -917,14 +917,14 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
   rep_stosb_threshold = TUNABLE_GET (x86_rep_stosb_threshold,
 				     long int, NULL);
 
-  TUNABLE_SET_WITH_BOUNDS (x86_data_cache_size, data, 0, (long int) -1);
-  TUNABLE_SET_WITH_BOUNDS (x86_shared_cache_size, shared, 0, (long int) -1);
+  TUNABLE_SET_WITH_BOUNDS (x86_data_cache_size, data, 0, SIZE_MAX);
+  TUNABLE_SET_WITH_BOUNDS (x86_shared_cache_size, shared, 0, SIZE_MAX);
   TUNABLE_SET_WITH_BOUNDS (x86_non_temporal_threshold, non_temporal_threshold,
-			   0, (long int) -1);
+			   0, SIZE_MAX);
   TUNABLE_SET_WITH_BOUNDS (x86_rep_movsb_threshold, rep_movsb_threshold,
-			   minimum_rep_movsb_threshold, (long int) -1);
+			   minimum_rep_movsb_threshold, SIZE_MAX);
   TUNABLE_SET_WITH_BOUNDS (x86_rep_stosb_threshold, rep_stosb_threshold, 1,
-			   (long int) -1);
+			   SIZE_MAX);
 #endif
 
   cpu_features->data_cache_size = data;
-- 
2.29.2


  reply	other threads:[~2021-02-10 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 13:56 [COMMITTED/2.33 1/3] tunables: Simplify TUNABLE_SET interface Siddhesh Poyarekar
2021-02-10 13:56 ` Siddhesh Poyarekar [this message]
2021-02-10 13:56 ` [COMMITTED/2.33 3/3] tunables: Disallow negative values for some tunables Siddhesh Poyarekar

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=20210210135604.445223-2-siddhesh@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=libc-stable@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).