Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2685859pxb; Sat, 26 Mar 2022 01:46:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9BO1zbloiae/EOQdmN1D2py0OkS/KFicg8nrB9disbJcBf4BWicoOza0eczq3J/JwEH16 X-Received: by 2002:a17:906:d54d:b0:6e0:1f9b:5064 with SMTP id cr13-20020a170906d54d00b006e01f9b5064mr16116414ejc.59.1648284382153; Sat, 26 Mar 2022 01:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648284382; cv=none; d=google.com; s=arc-20160816; b=ijXl1pjwiz3v0pkSZjDLUngV8f4b2ISPGArDGo4rw5zxgqT5HNB014Uo2TYtNtkFTB YRkPFMi3EdOIO/8otIvJFtZlAtksxr8L8mLjv09nInMua29YPS+Jt0XiirLXdOvXC9/3 O2uU3BDwlYKNHesxKITOIhndZYwb3nmF8pUzITcxIpjcb8n5hYNvKvPOwBxst8wQfAbz qfUZEGPiwIvHqYs7U57tTbvw4LcF8i/2AVgYmfECRG4Q+kexB28ZPtP81qNyGp+N3pTk agOKua7GrcfnGlF7+4qyTyk/uS2r6qiyjp877iCvkmTqo4NlK0MrVs9Sg32F1WHMu/Ep MQaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=SL8TuNaVlkwmVyy3Qsk6LSWCqtgHi89RUef5ABcB9qY=; b=jXc+S6s2rGx5HB90s0wlxUB0H/AsHpDyxc40jU/1aPlOME3OeljQLJ4UCHhXGDN0uu DhxbDNCrZMDbavvE2qYT0BVpPNI51CuZV0sceX53TZ1UIlkjdJdy0EpJ3GWf9i1Tbbzq cpP0bPb5VxfoqcgkCjECP2WfSBiegVAennwxBdZar3vS7aU+4Pcp346en5fSmFfrWkq9 aqt9O8Kg2iJRgOfXSECG2IoKqNzKmSnPpDEd5xCXyRmjl8ju8wrMCoWMDFPGrnaP5S/p 5U+F+GKQirkirO3VAknP+3JdaD35do0npN0+a/nmB+HFKkbE4T3HgcDSJYN3CsGLQOy5 kcPA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f23-20020a17090660d700b006df76385d75si5240735ejk.533.2022.03.26.01.45.57; Sat, 26 Mar 2022 01:46:22 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbiCZGaL (ORCPT + 99 others); Sat, 26 Mar 2022 02:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231586AbiCZG3z (ORCPT ); Sat, 26 Mar 2022 02:29:55 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A32BE171EE5; Fri, 25 Mar 2022 23:27:47 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KQTXP3XcCzcbQS; Sat, 26 Mar 2022 14:27:33 +0800 (CST) Received: from dggpemm500014.china.huawei.com (7.185.36.153) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 26 Mar 2022 14:27:45 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 26 Mar 2022 14:27:44 +0800 From: Wupeng Ma To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 9/9] ia64/efi: Code simplification in efi_init Date: Sat, 26 Mar 2022 14:46:32 +0800 Message-ID: <20220326064632.131637-10-mawupeng1@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20220326064632.131637-1-mawupeng1@huawei.com> References: <20220326064632.131637-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: Ma Wupeng Since efi_print_memmap() was made public, print EFI memory map in efi_init() can be simplified by using efi_print_memmap(). Signed-off-by: Ma Wupeng --- arch/ia64/kernel/efi.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 31149e41f9be..4b8209b8797d 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -557,42 +557,7 @@ efi_init (void) #if EFI_DEBUG /* print EFI memory map: */ - { - efi_memory_desc_t *md; - void *p; - unsigned int i; - - for (i = 0, p = efi_map_start; p < efi_map_end; - ++i, p += efi_desc_size) - { - const char *unit; - unsigned long size; - char buf[64]; - - md = p; - size = md->num_pages << EFI_PAGE_SHIFT; - - if ((size >> 40) > 0) { - size >>= 40; - unit = "TB"; - } else if ((size >> 30) > 0) { - size >>= 30; - unit = "GB"; - } else if ((size >> 20) > 0) { - size >>= 20; - unit = "MB"; - } else { - size >>= 10; - unit = "KB"; - } - - printk("mem%02d: %s " - "range=[0x%016llx-0x%016llx) (%4lu%s)\n", - i, efi_md_typeattr_format(buf, sizeof(buf), md), - md->phys_addr, - md->phys_addr + efi_md_size(md), size, unit); - } - } + efi_print_memmap(); #endif efi_map_pal_code(); -- 2.18.0.huawei.25