From nobody Mon Nov 25 22:47:37 2024 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47EB61AF0A7 for ; Thu, 24 Oct 2024 08:07:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729757247; cv=none; b=ZUUqecLjl+K5xiyH9QxRjElYKCBVSvsk9Ud4hyXSlciEzJkCG33UrNJ3V9sZMAFUVpeE4/0ZIxTjpQ7PW77ZAXVP3jyuitTQJ67a0j75BN1jXyZXbwSk9pPRlwYzOy/m7iLeHcpZSx783KAUbitP1hIziRc+rapxbS/iheWg128= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729757247; c=relaxed/simple; bh=lKJz69FkZU5PsLniCJS6Kxeee5PW8bbqpC3sMQ+Zazw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Jnhqh5pXb4gjUsqjqxK8u2Bd9GTDTYhIiHQhC/JOAR55SwM42FQ0KLLD5KtEf/nyvPLiXCj+mfnjIh0+7qESxtwkMBLhtauF4AbM+MGEvlNQDy5nnZ1mf2gx4WqthWtb+gafPJDWzdWb8FGiR/3ECWllzeNggoBAuzVZNIP5l7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=d7hm6jgr; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d7hm6jgr" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-431688d5127so6178195e9.0 for ; Thu, 24 Oct 2024 01:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729757240; x=1730362040; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=EZy5UEggNFqbZ16nEcVpQryOaoa0SiPbjloEPBK8vjw=; b=d7hm6jgrWb+CpMFjECvjUGI4pcH2mxDXhkDqEy5nR7ZSqzof3lomaaCW7BGLYOiuE/ PSIWBvyzijruYqJ5+Wnrcl912L1kitj//+k3QwKEJVjnrbrLVZ0mtvNyqRU13E4lCN4H DoNdmvs7OApWYX28oPIS7wUszXWRB0DcRhIUsae5yXmA0wc+3iIeoe3xy7lJl4MNGQyH /r68XOSxtmP6hdvnraj8XvnfwYhBUtIz4KpYn3U//6OQekU/u0FfuKKuNqnryEokXcLr gjf/zVQGxzKGnvUBSvzVMJomvO6RQoMRtmkgWML18l9zPUsi9edh+CxnMAG28BcH+JTN wujA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729757240; x=1730362040; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EZy5UEggNFqbZ16nEcVpQryOaoa0SiPbjloEPBK8vjw=; b=n9X+qJnv0mYAsWEPZq+hiIReIDBDw/s1lfEhkHA+uaTptyfuZ+OxgPh+x2SNvNn/6B tRmt24RTXawepREKxTUSWYCcrHKk2BLQ/e4QzZyP2oSdMlo/jckKPcqmtwZOjpFnzlXP dJz/vwONHL/efK/4xyR4Q+2qi61rEsgD6cnMFpwNUIM1v5RKYM8cEGqH/fH6RZE+yoz/ 64OOPYGcgdwjbAbI0/elmhORg8xnCmDzOVYsWKo0/4H+IrJ4EUYnejdbdrKLB4jdVjWS zqq1c2TVbxc+UHwWEXxmuxnjKknpXDvvUt5IL/JHDed/x7+t+Sy0irJG65rLvnzJWkWW 23zQ== X-Forwarded-Encrypted: i=1; AJvYcCVJicB6ThgfadgxsjKJ7wxHCuRqSo26bH5q9VGJrmXrXSoM2WUMjmrSyluQ5xCmvcoVu10YdeoacsbyF4k=@vger.kernel.org X-Gm-Message-State: AOJu0YzxtTzYn4/hMR1OjblzitOMBdrPaHlUlVPfP/L5kHrLR1ZUGddK iwI90Pay5sUZXUGjaFrRQYCdMpMqkOVvXMVmzlLz21Elx86L5fydhmzFpXUMSd0= X-Google-Smtp-Source: AGHT+IHj3dTiTdI/Cfg0wXRcMpCa/DQvbUN9eHqbQfyoSZ5v/QASIQRyjUyPWiqx5em0P01hF5B1ZQ== X-Received: by 2002:a05:600c:5011:b0:430:54a4:5b03 with SMTP id 5b1f17b1804b1-4318c6e0175mr8691295e9.6.1729757239721; Thu, 24 Oct 2024 01:07:19 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43186c0e132sm38394125e9.34.2024.10.24.01.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 01:07:19 -0700 (PDT) Date: Thu, 24 Oct 2024 11:07:15 +0300 From: Dan Carpenter To: "Rafael J. Wysocki" , Koba Ko Cc: Len Brown , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org, "Paul E. McKenney" , Ard Biesheuvel Subject: [PATCH] ACPI: PRM: Clean Up guid type in struct prm_handler_info Message-ID: <3777d71b-9e19-45f4-be4e-17bf4fa7a834@stanley.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Clang 19 prints a warning when we pass &th->guid to efi_pa_va_lookup(): drivers/acpi/prmt.c:156:29: error: passing 1-byte aligned argument to 4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an unaligned pointer access [-Werror,-Walign-mismatch] 156 | (void *)efi_pa_va_lookup(&th->guid, handler= _info->handler_address); | ^ The problem is that efi_pa_va_lookup() takes a efi_guid_t and &th->guid is a regular guid_t. The difference between the two types is the alignment. efi_guid_t is a typedef. typedef guid_t efi_guid_t __aligned(__alignof__(u32)); It's possible that this a bug in Clang 19. Even though the alignment of &th->guid is not explicitly specified, it will still end up being aligned at 4 or 8 bytes. Anyway, as Ard points out, it's cleaner to change guid to efi_guid_t type and that also makes the warning go away. Fixes: 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM hand= ler and context") Reported-by: Linux Kernel Functional Testing Suggested-by: Ard Biesheuvel Signed-off-by: Dan Carpenter Tested-by: Paul E. McKenney Acked-by: Ard Biesheuvel --- Sorry for the unfair Fixes tags since you obviously aren't to blame. But i= t's more practical if we avoid breaking the build in backports or etc. Fixes t= ags are quite often unfair in this way... drivers/acpi/prmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index d59307a76ca3..747f83f7114d 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -52,7 +52,7 @@ struct prm_context_buffer { static LIST_HEAD(prm_module_list); =20 struct prm_handler_info { - guid_t guid; + efi_guid_t guid; efi_status_t (__efiapi *handler_addr)(u64, void *); u64 static_data_buffer_addr; u64 acpi_param_buffer_addr; --=20 2.45.2