Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3910623imw; Mon, 18 Jul 2022 17:16:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tuuuTv1B5luXCezTA2GChS0glLHizrdkN8F5CnEalr5IizeLWYkpwioEHA0D/4rkiH/Me9 X-Received: by 2002:a17:906:cc5a:b0:72b:1459:6faa with SMTP id mm26-20020a170906cc5a00b0072b14596faamr28509170ejb.221.1658189815934; Mon, 18 Jul 2022 17:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658189815; cv=none; d=google.com; s=arc-20160816; b=ySmK6g6f+Vr7A7LqodbNk9eUm/dj/JiIgTd/qxgryXAtMVaRYNLUEtyOvaD9pioU16 +ZCj07oZcqb8/zKaZWl9paQBVhbjfyDKJNLz45Tn+BcOdon9ikNVQWql6GwW/KaTp41y H2tCU0+7pG90NfQOAGaWOb93LBk2YMXFxF9xv7Sed7eykKOoYMygIgzQCt9UQ/9iJbOn 01gr6CYAkKk9R1zvLVKuX5etFRguadM8fZt3sU+O3y3hSEHXbwWlX3FqLtMt+f5uPFHl cplyPYffbdl/IKTcm5SbJOp7qQheZBea2qWhZzygnObsRCrXi915de/CU3kvy2bJWYdB 619Q== 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 :dkim-signature; bh=jretA47WKAcb0y56HfWCPZEL31wNbTFgLZKnmROQ4mM=; b=wtjfo5MfPrQt7TOyx5iKkW59hExb2qJ6Y9cpRpkPbmFY9tfdNMG6RfeqdrvqTS4mMN W/pJfmZY/0nRVi/fVE7Fd/T6jvKkLhvTMxcoqpp8Cmmm4NlVTJcVudOKaPkistQMRQW5 Y6YrN/WIYTv4LPRxbF+dIneZJS3SxCYxJgDrBiOj4IsKLvzNyMM9139pOP5bHUyifgio 0PsMkY/zph0qO+z40YsBAJUUaYBywCs7QhLLDDwyGYv1yrVmz4sN0CQ8OcxvMIsUznan 7JYKWPtPv3wRoxVXe16eK/p+pktIgd8Ih9IBw97X0ZcHf1/0U5GZGm2/QHArttifQFU9 /vtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rU0FTMcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne38-20020a1709077ba600b00711d59cf00fsi20568283ejc.1000.2022.07.18.17.16.31; Mon, 18 Jul 2022 17:16:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rU0FTMcq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236666AbiGSAOq (ORCPT + 99 others); Mon, 18 Jul 2022 20:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236610AbiGSAOm (ORCPT ); Mon, 18 Jul 2022 20:14:42 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB71110 for ; Mon, 18 Jul 2022 17:14:41 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658189679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jretA47WKAcb0y56HfWCPZEL31wNbTFgLZKnmROQ4mM=; b=rU0FTMcqoNDbvSFCEfvW/hbLzd+m61UXURxZAxv5KwReNfRgMljavhFkQvEaeTbR5GaOf2 gBDhMOXjtGRYvmIi7i00aQMKDaRiBY+ZMn0IYYMFg1L755kFWJ3RLV/lTjezNlQZFEHzoJ bJ/lC2DE2miWoDPTZF40dXh10ulZiVM= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm v2 25/33] kasan: simplify print_report Date: Tue, 19 Jul 2022 02:10:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov To simplify reading the implementation of print_report(), remove the tagged_addr variable and rename untagged_addr to addr. Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index ac526c10ebff..dc38ada86f85 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -397,17 +397,16 @@ static void print_memory_metadata(const void *addr) static void print_report(struct kasan_report_info *info) { - void *tagged_addr = info->access_addr; - void *untagged_addr = kasan_reset_tag(tagged_addr); - u8 tag = get_tag(tagged_addr); + void *addr = kasan_reset_tag(info->access_addr); + u8 tag = get_tag(info->access_addr); print_error_description(info); - if (addr_has_metadata(untagged_addr)) + if (addr_has_metadata(addr)) kasan_print_tags(tag, info->first_bad_addr); pr_err("\n"); - if (addr_has_metadata(untagged_addr)) { - print_address_description(untagged_addr, tag); + if (addr_has_metadata(addr)) { + print_address_description(addr, tag); print_memory_metadata(info->first_bad_addr); } else { dump_stack_lvl(KERN_ERR); -- 2.25.1