From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D34D227EB6 for ; Tue, 1 Apr 2025 18:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743531969; cv=none; b=LM4PW51wSUlqTBDv8oLW0XsJZdLoP+lTqWIjHRXT2DGXeIaP03L+swFOjBmlJMjk65NhlaMA160YUAtJojtiJgEzhfOmdb24JJbn/HE7amvGtNHUzSb+WoE9RPsE6ONMBSJQY6jdSPcRthsBTW0MNM+0auheESvuOyM1WMefzL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743531969; c=relaxed/simple; bh=VYAhgSHR8CjW8YATc0oZ3XPUiaGVjv/5MYlkyFYu2lI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=NPxnYuLTX2PUXRDnYiBGW9rAuz7FFg1ZR3JB9IisqOUSrL2z4bUOKBNnEiGCRpgTT9ODyq04Sg/MXiT147Oj7ICmY8JQoMxKOxArnwMI7VLCbsgV/G/R1AY0jCgBr7ob3ClQwzlGQbZAICVC78wgscZIxLV2JXW6LtIqBUrv/Uo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Qgx77zgx; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Qgx77zgx" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ff7cf599beso10931671a91.0 for ; Tue, 01 Apr 2025 11:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1743531966; x=1744136766; darn=lists.linux.dev; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=3GhpEMZc+Go5hXkRH+5nn2InkEe+78BeHi9RfDz0OEg=; b=Qgx77zgx8KLZcwIrLr8clqPtORM8bIxo1ZYicZ/0zgBz4yYvI5Dv0bGwzA9lANJKi1 ohb4O5z3wQvrkctstHq1MaTTRgCAiJbGYaxo3ewqXJ/xZpx1Ees59Nzp5X8s0toNCMmN PdCTq1UkElS/UcVVitsX4paVcTksxc4s4UvLHDfg1Rnz4dMkucRTvlJrFio9R7fHOpYs FRfLrcUxQIpxxIjvRuJN5av+AVwvjjBS98IITzTGNh2cdZW0tOUtMBV8/IYOJAZkixqo 92koRzuzNVRK85GB5ew+2zR4EsCQ3tZysBFKVqu9MVnT6DAlu0Gh0jVIMO4fj3cCsHAv 3/dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743531966; x=1744136766; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3GhpEMZc+Go5hXkRH+5nn2InkEe+78BeHi9RfDz0OEg=; b=Jszvl6tn5LfJQtadLpkCs+vSMLmC3ScAM8Lc2WSAWHcMFBRTezpjLfFPQUWyqd9dIr ZXmjs6yCKXxn87fq/7sCil+UQUiOClaUK4L478EgkUzPl4Zhudf4Mue12aL06gnQCkwo 5qqTawAW4I29o9eln7wN2EpGLN4rE1iiB42xR4jG+ITEtmpaDa81YHMog+T7a1eaQjWG 6zutHpWu8uPNdJuTfyhGXg1XCC5XoOS47P6S3iTqVDTjnVyyLPTXNirBcbqSLCDxcxNM OI6A8C5KhAeNHnmY5Qv6xNqi76rsfV1iK6trEPhOGwBgMTBNFPDi/Yp5ZzJVIW6a3l8S VUqw== X-Forwarded-Encrypted: i=1; AJvYcCV3p1v7jCqK1Y0gj0eG/S4SLhzOAPkPNU/kl5zkIw6UpTS/sDWLGBt+7Qxa1G7RsGo1Goat@lists.linux.dev X-Gm-Message-State: AOJu0YwLTfmUbjYls2kvIZxoRfowuGua/alCKLA+vRZhKiYdngHZyxO6 HvSp0dWbiPLuXM7s3gDfFGzrV8KL5gXUWBiJkj7tECquo/J+syS/9WKObiLgdh3tNBOLpbTtHEp gxtxVMw== X-Google-Smtp-Source: AGHT+IH28uehI5+J49TPsEd9NihvXOguO0Bih1z8y7KT4XeqjB74B1qbmMSKwRKZHS/+SGf0DQUxAQTZmWKE X-Received: from pjbqn13.prod.google.com ([2002:a17:90b:3d4d:b0:2e9:38ea:ca0f]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:53d0:b0:2ee:8430:b831 with SMTP id 98e67ed59e1d1-30531f715eamr22653376a91.2.1743531966013; Tue, 01 Apr 2025 11:26:06 -0700 (PDT) Date: Tue, 1 Apr 2025 11:23:42 -0700 In-Reply-To: <20250401182347.3422199-1-irogers@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250401182347.3422199-1-irogers@google.com> X-Mailer: git-send-email 2.49.0.504.g3bcea36a83-goog Message-ID: <20250401182347.3422199-45-irogers@google.com> Subject: [PATCH v1 44/48] perf zlib: Silence -Wshorten-64-to-32 warnings From: Ian Rogers To: Yury Norov , Rasmus Villemoes , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Thomas Gleixner , Darren Hart , Davidlohr Bueso , "=?UTF-8?q?Andr=C3=A9=20Almeida?=" , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Yicong Yang , Jonathan Cameron , Nathan Chancellor , Bill Wendling , Justin Stitt , Josh Poimboeuf , Al Viro , Kyle Meyer , Ben Gainey , Athira Rajeev , Kajol Jain , Aditya Gupta , Eder Zulian , Dapeng Mi , Kuan-Wei Chiu , He Zhe , Dirk Gouders , Brian Geffon , Ravi Bangoria , Howard Chu , Charlie Jenkins , Colin Ian King , Dominique Martinet , Jann Horn , Masahiro Yamada , Arnd Bergmann , Yang Jihong , Dmitry Vyukov , Andi Kleen , Graham Woodward , Ilkka Koskinen , Anshuman Khandual , Zhongqiu Han , Hao Ge , Tengda Wu , Gabriele Monaco , Chun-Tse Shao , Casey Chen , "Dr. David Alan Gilbert" , Li Huafei , "Steinar H. Gunderson" , Levi Yun , Weilin Wang , Thomas Falcon , Thomas Richter , Andrew Kreimer , "=?UTF-8?q?Krzysztof=20=C5=81opatowski?=" , Christophe Leroy , Jean-Philippe Romain , Junhao He , "Masami Hiramatsu (Google)" , Xu Yang , Steve Clevenger , Zixian Cai , Stephen Brennan , Yujie Liu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" The clang warning -Wshorten-64-to-32 can be useful to catch inadvertent truncation. In some instances this truncation can lead to changing the sign of a result, for example, truncation to return an int to fit a sort routine. Silence the warning by making the implicit truncation explicit. Signed-off-by: Ian Rogers --- tools/perf/util/zlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/zlib.c b/tools/perf/util/zlib.c index 78d2297c1b67..d30597701fd1 100644 --- a/tools/perf/util/zlib.c +++ b/tools/perf/util/zlib.c @@ -44,7 +44,7 @@ int gzip_decompress_to_file(const char *input, int output_fd) goto out_unmap; zs.next_in = ptr; - zs.avail_in = stbuf.st_size; + zs.avail_in = (uInt)stbuf.st_size; do { zs.next_out = buf; -- 2.49.0.504.g3bcea36a83-goog