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 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 DE42CC61DA4 for ; Thu, 23 Feb 2023 18:24:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFCA785367; Thu, 23 Feb 2023 19:24:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1677176662; bh=p3lOcnj7huCMvPKzAGp95iAWTylqTBrrWZEpO+NlAg4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dWrljLS8uu089YtbJWCc0uWNUjPd2WLZf7tVzoUh/sdpODwHdbKngLO04AgLHU9hL Kq1uVcFI69pNLBk9tjMbOlFdujOLaO5R0RnDbvRgKOJcpGgTt3tgwTJMml4s4L/n8V k8uJ+AboBwT4fvvGX2NLP/c1JRJS8rRLBlfQYaV6KC6fhVuzcx7AKiEjiT7yFV6Hpy fE0oQEhHFU1LwYoS8VPp3njPWMD1Zd2+Gzx3fSJgHl+Cquz4rHbo9lKLKKepy9hoGv /c3BLK7jyX0/QszRaEHewVvrx36a0cWY2HmMAXdvgzA/u9w4bBCSJdZO3QWRD+LALi zM5MLP1wueVqg== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 3E688801DB; Thu, 23 Feb 2023 19:24:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1677176659; bh=p3lOcnj7huCMvPKzAGp95iAWTylqTBrrWZEpO+NlAg4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fQs/5YwU/MAg7HZWC+F3LRLUo8ZFe55MCJkdAIEFd5CdRji0OJwmF1ie8FT9ARdUX QZrdrNq6aTmgVtgtnpKyovtfI5sI6p4Ijtwg2JW4Km1dBF7L1pA/JaP9nUsyQ0XW3w tbWP/qptLy3aK9xAzBqMDOcyIqKwXyNb8zWWv3P/AwfohIetvQRelqWmoUF4Ua/P8d Ytp01rJ7YjzqQwKqaj/G+Cv66o/5EjFGk+Jx3Wa9aJVdQwiFwQ5FEgczV8yUY9q3JT UdCOxAPxnDhRVi/2cwjTn6EzZO9pLM+a2lQPq5nWsMRrKzEwyJXPX23/3i1oJbGkrt DiiUxoS3yW9lw== Message-ID: <68e4b60d-6d9a-3483-293b-2ceeb5a5dc6f@denx.de> Date: Thu, 23 Feb 2023 19:24:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 1/2] env: mmc: Clean up macro usage To: Tom Rini Cc: Patrick DELAUNAY , u-boot@lists.denx.de, Patrice Chotard References: <20230209123010.31953-1-marex@denx.de> <1125e79c-222b-ba3a-e342-81f609dbb68a@foss.st.com> <2dd5b09a-515f-601d-e973-4404bfc42ea8@denx.de> Content-Language: en-US From: Marek Vasut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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.6 at phobos.denx.de X-Virus-Status: Clean On 2/23/23 17:32, Tom Rini wrote: > On Thu, Feb 23, 2023 at 02:22:51PM +0100, Marek Vasut wrote: >> On 2/23/23 11:41, Patrick DELAUNAY wrote: >>> Hi Marek, >> >> Hi, >> >>> On 2/9/23 13:30, Marek Vasut wrote: >>>> Consistently use 'if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID))' instead of >>>> mix of ifdef. >>>> >>>> Signed-off-by: Marek Vasut >>>> --- >>>> Cc: Patrice Chotard >>>> Cc: Patrick Delaunay >>>> Cc: Tom Rini >>>> --- >>>> V2: Replace CONFIG_IS_ENABLED(PARTITION_TYPE_GUID) with >>>> IS_ENABLED(CONFIG_PARTITION_TYPE_GUID) >>>> --- >>>>   env/mmc.c | 4 +--- >>>>   1 file changed, 1 insertion(+), 3 deletions(-) >>>> >>>> diff --git a/env/mmc.c b/env/mmc.c >>>> index 5b01f657a7a..d51a5579128 100644 >>>> --- a/env/mmc.c >>>> +++ b/env/mmc.c >>>> @@ -73,8 +73,7 @@ static inline int mmc_offset_try_partition(const >>>> char *str, int copy, s64 *val) >>>>           if (str && !strncmp((const char *)info.name, str, >>>> sizeof(info.name))) >>>>               break; >>>> -#ifdef CONFIG_PARTITION_TYPE_GUID >>>> -        if (!str) { >>>> +        if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID) && !str) { >>>>               const efi_guid_t env_guid = PARTITION_U_BOOT_ENVIRONMENT; >>>>               efi_guid_t type_guid; >>>> @@ -82,7 +81,6 @@ static inline int mmc_offset_try_partition(const >>>> char *str, int copy, s64 *val) >>>>               if (!memcmp(&env_guid, &type_guid, sizeof(efi_guid_t))) >>>>                   break; >>>>           } >>>> -#endif >>>>       } >>>>       /* round up to info.blksz */ >>> >>> >>> If I remenber, I try this test with IS_ENABLED when I propose my patch >>> >>> and I have compilation issue on next line >>> >>> >>> +            uuid_str_to_bin(info.type_guid, type_guid.b, >>> UUID_STR_FORMAT_GUID); >>> >>> >>> because "info.type_guid" don't exist in struct disk_partition >>> >>> see ./include/part.h:59 >>> >>> >>> struct disk_partition { >>>     lbaint_t    start;    /* # of first block in partition    */ >>> ... >>> #ifdef CONFIG_PARTITION_TYPE_GUID >>>     char    type_guid[UUID_STR_LEN + 1];    /* type GUID as string, if >>> exists    */ >>> #endif >>> ... >>> }; >> >> Uh, which defconfig triggers this ? >> >> Also, is there a way to deal with this failure without reinstating the ifdef >> ? Tom ? > > It's likely on one of the platforms that disables EFI_LOADER, where this > ends up being a fail to build. I don't recall which, but I've seen it > before. So we probably don't end up converting this to a macro check. Can you pick the 2/2 for starters ? It is a bugfix and applies cleanly, so let's not block that one. I'll keep 1/2 in my queue and revisit it, I see the failure in CI now.