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 84869C636D6 for ; Thu, 23 Feb 2023 10:41:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B176385AB5; Thu, 23 Feb 2023 11:41:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="3kjwZVjJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F011B85903; Thu, 23 Feb 2023 11:41:39 +0100 (CET) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 15B5D85AD6 for ; Thu, 23 Feb 2023 11:41:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=041805acfd=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31N9IXe1025217; Thu, 23 Feb 2023 11:41:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=8zs0oYtV+2RbJKOHLkphhaEgkhJwFXfbqQTfRoVwcg4=; b=3kjwZVjJ75I8z9eDwHYpNfAdB6hD7Wqw17LlzRoLUZfWJinolmPfAxuigDEz7wLURMIM oi3emdpsq59+b1gino0xHBc7RPVH/Jdhafaa7lAur7y4AKjxoqW70zxM4eQCSxhF3aUb H13PmFuXxXBTi1B3C+OCkbeXfEiEOdtbte9qbsoMN9vEzNw9CfJPZSeWV77xJzCj2Hou cIU+MNXIGgQEQJCMIE3oNqao7saGKTWAdUtzk890p3ZsBnzp24D9cm9LivjlDxredaLg g6UnG+VKU2JNGFook6EpteAGilO5xdH3l6I0Ov3L0NAdx0Rh4cJaw3VVEKroTvyPV4yZ pw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3nwyb8trrq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 11:41:35 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 586A8100034; Thu, 23 Feb 2023 11:41:34 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 487CB214D0A; Thu, 23 Feb 2023 11:41:34 +0100 (CET) Received: from [10.48.0.157] (10.48.0.157) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 23 Feb 2023 11:41:32 +0100 Message-ID: <1125e79c-222b-ba3a-e342-81f609dbb68a@foss.st.com> Date: Thu, 23 Feb 2023 11:41:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 1/2] env: mmc: Clean up macro usage Content-Language: en-US To: Marek Vasut , CC: Patrice Chotard , Tom Rini References: <20230209123010.31953-1-marex@denx.de> From: Patrick DELAUNAY In-Reply-To: <20230209123010.31953-1-marex@denx.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.48.0.157] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-23_06,2023-02-23_01,2023-02-09_01 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 Hi Marek, 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 ... }; Regards Patrick