Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751501AbdGZW1h (ORCPT ); Wed, 26 Jul 2017 18:27:37 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:38631 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751034AbdGZW1f (ORCPT ); Wed, 26 Jul 2017 18:27:35 -0400 From: AbdAllah-MEZITI To: luto@kernel.org Cc: AbdAllah MEZITI , Mark Rutland , Kees Cook , Ingo Molnar , Heiko Carstens , Kyle Huey , Sahara , Al Viro , linux-kernel@vger.kernel.org Subject: [PATCH] thread_info: suppress sparse warning in check_copy_size() Date: Thu, 27 Jul 2017 00:27:11 +0200 Message-Id: <1501108037-14429-1-git-send-email-abdallah.meziti.pro@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1006 Lines: 25 This patch fixes the following sparse warning in thread_info.h: ./include/linux/thread_info.h:129:18: warning: incorrect type in argument 1 (different modifiers) ./include/linux/thread_info.h:129:18: expected void * ./include/linux/thread_info.h:129:18: got void const *addr Signed-off-by: AbdAllah MEZITI --- include/linux/thread_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 250a276..e2c4a8e 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -126,7 +126,7 @@ static inline void copy_overflow(int size, unsigned long count) static __always_inline bool check_copy_size(const void *addr, size_t bytes, bool is_source) { - int sz = __compiletime_object_size(addr); + int sz = __compiletime_object_size((void *)addr); if (unlikely(sz >= 0 && sz < bytes)) { if (!__builtin_constant_p(bytes)) copy_overflow(sz, bytes); -- 2.7.4