Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4023241pxb; Tue, 26 Jan 2021 10:19:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHLv6S5hgiVspdJJvbU+H7ns26al5om8odMZ6CjLzt41JuHtcmLFQMlrji4V4gla/T4NN4 X-Received: by 2002:a17:906:8046:: with SMTP id x6mr4313533ejw.351.1611685146848; Tue, 26 Jan 2021 10:19:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611685146; cv=none; d=google.com; s=arc-20160816; b=UEOMxi175oRkzwvKH/r1rkHcWuxRCzZ4wHr9sjQ3/fpVwtRdyR4ya1rWh/nBcAxgqj HDqIBDrrEFaZKB4Z2RiFSRVWVCErm+MB//rAUI/JQ1X/zuGervq7LhjHtSGQ1ocbP1TP EfLlzvJeIfUMbCRc34yg/kSt1YRAY1bXLY89kpVX7by+NlpAYqRte2EQaxqzpA4WbW0p tmEoCzLbwXbVTzp4Z4AVgUggvo+3boEEUD/UKEIzCr/kYlrLzKUp/ZzANIQApwaWELsP 5PKi6letgAH7dFx4uX2Ei8wcpLxOVu09/cAy7tzd/1NyXhex0NaD3SgqGobAjxRhC8x9 G6KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/bSefSAUajLeba9rOlCxkBCEfDCNj4jVoqbDYrfXaqg=; b=yeO1p+kQS+nrBct5fnA93vvJ7cUdVII6dgR4quG1e8IgTXfTmcy4piWnKn3qdesxVj zBMOfsqjpegYXVZH+Tu1zmPQgsE/HDh4/n3gKqmR2bWLV8xYlzKxaX3wF3A3yKs0/hO3 afkFM4CKdpBOVMY7P1fMx+FNGeMDLfr1mRwGWEjlVJozr/eo4pXGTiVkrFTXLJre+9Sc IQHUUvWjrtWKPw2IrbpAp5Mqq0A5MfF1t398UUmJ8W0TI0xQt65CcnLaHF+QvL3B8j2D kufKYM7d6IonvanF2p+JQwlIkBJZj4pxe0aoqAjCE8YPaDM80ihB9g3uEQ0asyKvTlmA +p4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si9155577edd.436.2021.01.26.10.18.42; Tue, 26 Jan 2021 10:19:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404485AbhAZKtU (ORCPT + 99 others); Tue, 26 Jan 2021 05:49:20 -0500 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:40416 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731879AbhAZCbv (ORCPT ); Mon, 25 Jan 2021 21:31:51 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0UMw3dyi_1611628266; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0UMw3dyi_1611628266) by smtp.aliyun-inc.com(127.0.0.1); Tue, 26 Jan 2021 10:31:06 +0800 From: Jeffle Xu To: linux-kernel@vger.kernel.org Cc: lkp@intel.com, joseph.qi@linux.alibaba.com, caspar@linux.alibaba.com Subject: [PATCH 2/2] thread_info: fix -Wsign-compare warnings Date: Tue, 26 Jan 2021 10:31:05 +0800 Message-Id: <20210126023105.13141-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210126023105.13141-1-jefflexu@linux.alibaba.com> References: <20210126023105.13141-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] if (unlikely(sz >= 0 && sz < bytes)) { Reported-by: kernel test robot Signed-off-by: Jeffle Xu --- include/linux/thread_info.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index c8a974cead73..11b4b36116fa 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -179,15 +179,15 @@ __bad_copy_from(void); extern void __compiletime_error("copy destination size is too small") __bad_copy_to(void); -static inline void copy_overflow(int size, unsigned long count) +static inline void copy_overflow(unsigned long size, unsigned long count) { - WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count); + WARN(1, "Buffer overflow detected (%lu < %lu)!\n", size, count); } static __always_inline __must_check bool check_copy_size(const void *addr, size_t bytes, bool is_source) { - int sz = __compiletime_object_size(addr); + size_t sz = __compiletime_object_size(addr); if (unlikely(sz >= 0 && sz < bytes)) { if (!__builtin_constant_p(bytes)) copy_overflow(sz, bytes); -- 2.27.0