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 6BCD1C636D6 for ; Thu, 23 Feb 2023 13:22:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1FD8C858FB; Thu, 23 Feb 2023 14:22:54 +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=1677158574; bh=Cv+1+6sfwUdbRYsLHxB2Hq/QcvabVTw4TLn5fpRDUUM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oKVPLsa3AOdYCz1AihJNRHBbOJvrwDN6a44v0AbwgTDeV4aoZlztIbQuHlkESP/Lg a2aG5SehSiYsV24WxClw0GB3Y5QntQ1/wmTJ2Qd/aaeyplCrGaD48d32gYL4l2399C FZnuiFYpkxXU3ZBN4NUUr3SC6ZNO56VLrstzeoS35VO9qDfUo2Ew3IO2yrqQKzwOB+ WbxH42WI/a7lPN4/QDQMNZmuVqYrE79pkHkIkgx5oa4JZPwSzoSgHj+kbXpkvEmSuJ EjSaWjnsWZ/NDkuPqzmXApZp6Qt8TMv3WrwCUho962CptzJw2hYvVf2Z0HjjKWFQhv 1ooN4ZT6y76YQ== 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 52CBD8338B; Thu, 23 Feb 2023 14:22:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1677158572; bh=Cv+1+6sfwUdbRYsLHxB2Hq/QcvabVTw4TLn5fpRDUUM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eRvxsYdRKvIB+0TRmjdM2JF1RM3cj50pgzqBWpTkkLTDDrrLoSQJmGtf/MLZMwiGH QggOddwht44CgJ5c8HGt7yxZZdGwY3Ibf48Sd+4+juzpnfbL6mmYxtbrQQ99T01Lty iuJSyJXZkHU76wpjn9t4Lba0stncS0FcBzGqpkpIUp/MZlspY+dUG1XE03lP7hdVyX ATMu01J6Ahx3NhHUNoD3XOSHOCFz0apwmgDCLbz0f5/YC7p0VxY0EOwVPy/yhc7UHL 4p1Fnf4S6M7qdV4rPCFnbnwbCl2XREVqCh8EPURKuGZVw31lzkG72FZ5hHxgX3p1k1 y0u/25xeOYy5w== Message-ID: <2dd5b09a-515f-601d-e973-4404bfc42ea8@denx.de> Date: Thu, 23 Feb 2023 14:22:51 +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 Content-Language: en-US To: Patrick DELAUNAY , u-boot@lists.denx.de Cc: Patrice Chotard , Tom Rini References: <20230209123010.31953-1-marex@denx.de> <1125e79c-222b-ba3a-e342-81f609dbb68a@foss.st.com> From: Marek Vasut In-Reply-To: <1125e79c-222b-ba3a-e342-81f609dbb68a@foss.st.com> 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 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 ?