From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 BABC6C43387 for ; Tue, 18 Dec 2018 02:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C45B214C6 for ; Tue, 18 Dec 2018 02:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726324AbeLRC3U (ORCPT ); Mon, 17 Dec 2018 21:29:20 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:65258 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726276AbeLRC3U (ORCPT ); Mon, 17 Dec 2018 21:29:20 -0500 X-IronPort-AV: E=Sophos;i="5.56,367,1539619200"; d="scan'208";a="50025732" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 18 Dec 2018 10:29:18 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 6D6B64B6ED69; Tue, 18 Dec 2018 10:29:14 +0800 (CST) Received: from localhost.localdomain (10.167.225.56) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 18 Dec 2018 10:29:19 +0800 Date: Tue, 18 Dec 2018 10:28:51 +0800 From: Chao Fan To: Ingo Molnar CC: , , , , , , , , , , Subject: Re: [PATCH v14 3/5] x86/boot: Introduce bios_get_rsdp_addr() to search RSDP in memory Message-ID: <20181218022851.GD31775@localhost.localdomain> References: <20181214093013.13370-1-fanc.fnst@cn.fujitsu.com> <20181214093013.13370-4-fanc.fnst@cn.fujitsu.com> <20181217173837.GC90818@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181217173837.GC90818@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [10.167.225.56] X-yoursite-MailScanner-ID: 6D6B64B6ED69.ABB2D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 17, 2018 at 06:38:37PM +0100, Ingo Molnar wrote: > >* Chao Fan wrote: > >> + /* Check the standard checksum */ >> + if (compute_checksum((u8 *) rsdp, ACPI_RSDP_CHECKSUM_LENGTH)) >> + continue; > >Could you please run your patches through checkpatch, does it not >complain about this line? I did, 0 errors, 0 warnings. If you mean the useless space, I can drop it. But it's from acpi_tb_validate_rsdp() of drivers/acpi/acpica/tbxfroot.c. > >> +/* Search RSDP address, based on acpi_find_root_pointer(). */ >> +static acpi_physical_address bios_get_rsdp_addr(void) >> +{ >> + u8 *table_ptr; >> + u32 address; >> + u8 *rsdp; >> + >> + /* Get the location of the Extended BIOS Data Area (EBDA) */ >> + table_ptr = (u8 *)ACPI_EBDA_PTR_LOCATION; >> + *(u32 *)(void *)&address = *(u16 *)(void *)table_ptr; > >what? So you take the address of 'u32 address', which turns it into an >u32 * - then you cast it to void *, then back to u32 * and then deference >it??? I will clean it, it's from #define ACPI_MOVE_16_TO_32(d, s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s) in acpi_find_root_pointer(). I thought it is safe to use the code existing in kernel. Thanks, Chao Fan > >Thanks, > > Ingo > >