Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2841849yba; Mon, 22 Apr 2019 14:05:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqydky86/Rl4j21wI/MTe4dVw5olcj3DZADgoWJEDN+d7l5YQzbdAL0fLzdDW7S9/rVJuuu9 X-Received: by 2002:a65:614e:: with SMTP id o14mr21342759pgv.196.1555967110550; Mon, 22 Apr 2019 14:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555967110; cv=none; d=google.com; s=arc-20160816; b=zPY5zzQPnPf0lsEt4FeGWqTgEgmnHnJgujUz5NNQyhwYVvUdgYEqU2D1MXSVvvUJ1W rCfFYPpaEjReqDOjMm796BGIojHyZ3w3BHhp32iHGXnea3P/Em1cwF4d4DbaVLu2IxKr J9lsGJzhfXko60r/5BFcQTDjtIcZKuBZ1OSIMRuQhtq/uPxndI2n4ldeZ+t7pnTdBrTb XFPa7Bmd1hPAi6t+55//mcOpvQ7TJR9GfY8dAxqyvpKBUtpR3EfwWYNRjgJq8lZgOeVU NrCt0XbBStixwQHL0UDk3ZD5Twewixs9ZqFmmuYBLOu4ZDeZ61Sp0uTZVRYVhCXzTKD4 v9ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wVcEurmY5uS4Iqm0l1HscDjF+Rb0jMGiXOZB7t4sXf4=; b=W3T+/FQyaIS+J1Gj1xwehAQkmgU1rslQGmONz4SpVaASsd4Wknp31QAdWFRvtwhPWE EtPdzFONcBNj5R8XWOIsaNi7KU5cSSfSSZ5Yz6aewPK5hJBOMDX5n2gI+Cxm0v5yXXQi 6E3rekibl/U1umY2TJesh8NS1l8k7qFyUIQ1hNj867CcKIbKkYKy9iBAHRi7x2idtFmg aczztWvWavGLOPm6W8B/NOFX8e8eRwPoolgPetdd3HXqGhn0xZ25i/5gqMzd7ZXT6nlV R0K63vw6GwpDrT74G9ZU952fb2jHO/u7wmEzghtQ/pjj8xlke0ksbQdGpBsvV1G8XV9J aEcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bGeZS1uw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si13826062plr.307.2019.04.22.14.04.54; Mon, 22 Apr 2019 14:05:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bGeZS1uw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729687AbfDVTpM (ORCPT + 99 others); Mon, 22 Apr 2019 15:45:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:46686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729676AbfDVTpJ (ORCPT ); Mon, 22 Apr 2019 15:45:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9521218FC; Mon, 22 Apr 2019 19:45:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962309; bh=ayBwbVMY9vgfYN51KPq6lqqiETptuAceXX80LCYaM4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bGeZS1uwcI9daP4jNXauOuysr3JJkNmwGkycS3aQUU8YFud/ZfaV+145hai1yPyn8 CYFyrclvlMk0E6s3KYbb/YucUwyWXgsTHOScAu6rmMgRyJO1CBgdi3QPRZWkOaT5ag SiNp6HpYvCExLoq3UuK8rDCVFBEjFVr6Ip8VPLaE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Qian Cai , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Andrew Morton , Linus Torvalds , Sasha Levin , kasan-dev@googlegroups.com, linux-mm@kvack.org Subject: [PATCH AUTOSEL 5.0 95/98] kasan: fix variable 'tag' set but not used warning Date: Mon, 22 Apr 2019 15:42:02 -0400 Message-Id: <20190422194205.10404-95-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194205.10404-1-sashal@kernel.org> References: <20190422194205.10404-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qian Cai [ Upstream commit c412a769d2452161e97f163c4c4f31efc6626f06 ] set_tag() compiles away when CONFIG_KASAN_SW_TAGS=n, so make arch_kasan_set_tag() a static inline function to fix warnings below. mm/kasan/common.c: In function '__kasan_kmalloc': mm/kasan/common.c:475:5: warning: variable 'tag' set but not used [-Wunused-but-set-variable] u8 tag; ^~~ Link: http://lkml.kernel.org/r/20190307185244.54648-1-cai@lca.pw Signed-off-by: Qian Cai Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin (Microsoft) --- mm/kasan/kasan.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index ea51b2d898ec..c980ce43e3ba 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -164,7 +164,10 @@ static inline u8 random_tag(void) #endif #ifndef arch_kasan_set_tag -#define arch_kasan_set_tag(addr, tag) ((void *)(addr)) +static inline const void *arch_kasan_set_tag(const void *addr, u8 tag) +{ + return addr; +} #endif #ifndef arch_kasan_reset_tag #define arch_kasan_reset_tag(addr) ((void *)(addr)) -- 2.19.1