From patchwork Thu Feb 11 15:22:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 12083523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74471C433DB for ; Thu, 11 Feb 2021 15:24:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7DD664E08 for ; Thu, 11 Feb 2021 15:24:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7DD664E08 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=92n8JvGRHcVcJ6QWWWTeqH8shX+KL3Kv3WurhCw5BQc=; b=qSP2E40tj7lgyLUODLgyohSzD3 VJJDlzWpOJlEGjY7jyhlUJYLJUt6fzDM5IdcPlq75HpYdXDJSsjjagD2qDhmELJb9NR1YnBrqYYlB z7FNtq8byFhaeJKQwXZTopDrcvbe3L6vpEFr/UbpQn1RCb254sXjyDUBs0xIMzKgrEpXY7KyHYmi7 1us+LMHR6fB+USMumZVYCT5jn9jK1VRaztMqrtow5ZXD0EWuNXbd+NhRoORxEvmDiv0GOhXgwXJoc JYjbbn7yYhcnbdVieMhCenfaMF///R8+jRBr+QiDs3VQVYxor1+E2k+aa/CSGCD0+9s6rY3eYvwYh j3JNi71Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lADnu-0008N5-Dw; Thu, 11 Feb 2021 15:22:50 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lADnr-0008MX-B0 for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 15:22:48 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 776AE113E; Thu, 11 Feb 2021 07:22:20 -0800 (PST) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A94C3F73D; Thu, 11 Feb 2021 07:22:19 -0800 (PST) From: Vincenzo Frascino To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Subject: [PATCH v2] arm64: Fix warning in mte_get_random_tag() Date: Thu, 11 Feb 2021 15:22:08 +0000 Message-Id: <20210211152208.23811-1-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_102247_444171_19695EF4 X-CRM114-Status: GOOD ( 14.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Andrew Morton , Vincenzo Frascino , Will Deacon , Andrey Konovalov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The simplification of mte_get_random_tag() caused the introduction of the warning below: In file included from arch/arm64/include/asm/kasan.h:9, from include/linux/kasan.h:16, from mm/kasan/common.c:14: mm/kasan/common.c: In function ‘mte_get_random_tag’: arch/arm64/include/asm/mte-kasan.h:45:9: warning: ‘addr’ is used uninitialized [-Wuninitialized] 45 | asm(__MTE_PREAMBLE "irg %0, %0" | Fix the warning using "=r" for the address in the asm inline. Fixes: c8f8de4c0887 ("arm64: kasan: simplify and inline MTE functions") Cc: Catalin Marinas Cc: Will Deacon Cc: Andrey Konovalov Cc: Andrew Morton Signed-off-by: Vincenzo Frascino Acked-by: Andrey Konovalov Tested-by: Andrey Konovalov Acked-by: Catalin Marinas --- This patch is based on linux-next/akpm arch/arm64/include/asm/mte-kasan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/mte-kasan.h b/arch/arm64/include/asm/mte-kasan.h index 3d58489228c0..7ab500e2ad17 100644 --- a/arch/arm64/include/asm/mte-kasan.h +++ b/arch/arm64/include/asm/mte-kasan.h @@ -43,7 +43,7 @@ static inline u8 mte_get_random_tag(void) void *addr; asm(__MTE_PREAMBLE "irg %0, %0" - : "+r" (addr)); + : "=r" (addr)); return mte_get_ptr_tag(addr); }