Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8EB97CDB482 for ; Sun, 15 Oct 2023 07:43:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB2F38691E; Sun, 15 Oct 2023 09:11:14 +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="ndC8i0QI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0D77885DFA; Sun, 15 Oct 2023 09:07:09 +0200 (CEST) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (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 915668071F for ; Sun, 15 Oct 2023 09:05:49 +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-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso1209400b3a.2 for ; Sun, 15 Oct 2023 00:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1697353547; x=1697958347; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/5knB3pjofFGUFVjLqhKrZqPNV4BxoHqvTtVWMUZb1I=; b=ndC8i0QIFl9e5nW2GUgZselSBHeXVoj503ohnbvpThxEjK/y1T7+1IzGrheJzLBlM3 RxvMYU6F6NjqgGAsT4OUxzzoJiH8Djs2TOYlROw1ZMdWai2QUMFsuxzx3iulkG+opDDh WJAUWEI3QCHCZ9DZyzyDHLAczexCDNK46xnBw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697353547; x=1697958347; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/5knB3pjofFGUFVjLqhKrZqPNV4BxoHqvTtVWMUZb1I=; b=N5IFamV8um8Yr8zSFObbArtmqC0Bwv7djJ012Ww8crFAaxbK/UaB7IIH35yzduTwa4 /BD4WAU+7Xpn3FHeHmoz7/FMGA7MpOr53+57+veD3egYvrOH5UMVkwZrgIAtMIyIgfvy kZfP14MMiu9oQ+VjWjCH7lCNWE85+fhbXH1wUW2IV9kFqQXQdJjsD3EjIukLqe4wmWWe /UnKia1YPthk/5UV60CggsY4jJArDESRMRahqZ9s5uZQnHJEG30Tap+NJaKqux+x6vOC zlctwaz6+E0yc8/tNHcdy+1KRyBoiN0gwyQx3VL3lRiVhepfhEVkGMcmBbFq8Yv0uVIK CHhQ== X-Gm-Message-State: AOJu0YxhZUNdouo3aAexWuUgde1Ud3O+4wous8Q5OJL0ovqznSF4DgnI D623Ey78VmE+vm++TbHITiXEc16NY11npamEfn4SIw== X-Google-Smtp-Source: AGHT+IHtYKqFcXvFj5khhORWzuz8kIyKWYOsxCZpclySBrE3YLEnFhZrc9q9WrIqxT9k/xNxWnLkkA== X-Received: by 2002:a05:6e02:1544:b0:357:5dac:3a1f with SMTP id j4-20020a056e02154400b003575dac3a1fmr8032132ilu.30.1697337919310; Sat, 14 Oct 2023 19:45:19 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id v6-20020a92cd46000000b003497ced3fa1sm2462842ilq.29.2023.10.14.19.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 19:45:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass Subject: [PATCH v2 6/6] smbios: Require the caller to align the SMBIOS table Date: Sat, 14 Oct 2023 20:45:08 -0600 Message-ID: <20231015024511.3995580-7-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog In-Reply-To: <20231015024511.3995580-1-sjg@chromium.org> References: <20231015024511.3995580-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean All callers handle this alignment, so drop the unnecessary code. This simplifies things a little. Signed-off-by: Simon Glass --- (no changes since v1) include/smbios.h | 5 +---- lib/smbios.c | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/smbios.h b/include/smbios.h index ddabb558299e..31d997287588 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -248,12 +248,9 @@ static inline void fill_smbios_header(void *table, int type, * * This writes SMBIOS table at a given address. * - * @addr: start address to write SMBIOS table. If this is not - * 16-byte-aligned then it will be aligned before the table is - * written. + * @addr: start address to write SMBIOS table (must be 16-byte-aligned) * Return: end address of SMBIOS table (and start address for next entry) * or NULL in case of an error - * */ ulong write_smbios_table(ulong addr); diff --git a/lib/smbios.c b/lib/smbios.c index 92e98388084f..5c9f108496d6 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -483,8 +483,6 @@ ulong write_smbios_table(ulong addr) ctx.dev = NULL; } - /* 16 byte align the table address */ - addr = ALIGN(addr, 16); start_addr = addr; /* -- 2.42.0.655.g421f12c284-goog