From patchwork Tue Sep 22 18:45:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1369224 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jqJPY4gR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BwrBz0bRhz9sTS for ; Wed, 23 Sep 2020 04:56:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4FC14826C8; Tue, 22 Sep 2020 20:49:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jqJPY4gR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E0E8F823F9; Tue, 22 Sep 2020 20:47:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A3B878238F for ; Tue, 22 Sep 2020 20:47:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x341.google.com with SMTP id g96so16571511otb.12 for ; Tue, 22 Sep 2020 11:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pRjV4K8WRPmsvJOAxOTZ69X3itYaIbY6vI5xu/TZlnw=; b=jqJPY4gRnKsNF6qFUervumZUq9bZsOmUMFdgFm9FT/V392HC31+fZDnBlGMiX8ILea dcL0Ren4uQ46pbQkQxFRFs5sMBAklt6bPZRyWrqmY/BGVNQG7eaEbBvfyvmAup9ho+Dm TxXUqKrcfGUyIPyq+Av4mj93+CA7KdRmNDWc8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pRjV4K8WRPmsvJOAxOTZ69X3itYaIbY6vI5xu/TZlnw=; b=nZg+RXbLok5s0F9VBOO4P1/ssvDrTOBFd87G7fsrVZgANDY3BQIwm9FtcIIaYca4+1 kOSYSTMxu2CA7WrX4A4XIcOtHyBGNZTyybdBpkN2925jujMDZxIVD/FYbNR8KHAmz0Oh bqii5bGO8i722Xhc0fuQxqrlygJwr/Lzw7d401xexw9RlWkXKE601z7CZgUgxmjvpJH8 HqgSrVIVoDlrz+pZ3zS9xJLNwoy1KgjN8BMPtXzvDy1B+8nWZ4vCg9goSgfg5H95iAuI 0CVesFt1LXXZ7H4X9m57cL2dgCRKho3VXhQJ4Y1mrLmGHcNiN1cKq03s3osVAK3yTYOP m+Nw== X-Gm-Message-State: AOAM5303XvSozA7m0TAIN+9kcm4ZPribELGZF7i4iUt4cQz8gHTXmi/l WiEso/DX2bD8yUMXGtvHdwlhlPQPPALxX1RX X-Google-Smtp-Source: ABdhPJxXz1pQ+zPSHvsWEWBdgrM6nnPbzsnByIqQGNk0VLwjR3t//XGCU23zrKI6aag3OJF2gzN9Uw== X-Received: by 2002:a05:6830:1aca:: with SMTP id r10mr3632540otc.336.1600800437351; Tue, 22 Sep 2020 11:47:17 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id q24sm7622663oij.19.2020.09.22.11.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 11:47:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Wolfgang Wallner , Bin Meng , Bernhard Messerklinger , Simon Glass Subject: [PATCH v4 54/59] acpi: Use defines for field lengths Date: Tue, 22 Sep 2020 12:45:39 -0600 Message-Id: <20200922184544.2920969-25-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog In-Reply-To: <20200922184544.2920969-1-sjg@chromium.org> References: <20200922184544.2920969-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean A few fields have an open-coded length. Use the defines for this purpose instead. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) include/acpi/acpi_table.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index 9fba6536f50..3a243bf19ce 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -13,6 +13,7 @@ #ifndef __ACPI_TABLE_H__ #define __ACPI_TABLE_H__ +#include #include #define RSDP_SIG "RSD PTR " /* RSDP pointer signature */ @@ -48,7 +49,7 @@ struct acpi_rsdp { /* Generic ACPI header, provided by (almost) all tables */ struct __packed acpi_table_header { - char signature[4]; /* ACPI signature (4 ASCII characters) */ + char signature[ACPI_NAME_LEN]; /* ACPI signature (4 ASCII chars) */ u32 length; /* Table length in bytes (incl. header) */ u8 revision; /* Table version (not ACPI version!) */ volatile u8 checksum; /* To make sum of entire table == 0 */ @@ -263,7 +264,7 @@ struct __packed acpi_fadt { /* FACS (Firmware ACPI Control Structure) */ struct acpi_facs { - char signature[4]; /* "FACS" */ + char signature[ACPI_NAME_LEN]; /* "FACS" */ u32 length; /* Length in bytes (>= 64) */ u32 hardware_signature; /* Hardware signature */ u32 firmware_waking_vector; /* Firmware waking vector */