diff mbox

[U-Boot,02/14] spl: mmc: Fix build without LIBCOMMON_SUPPORT

Message ID 20161125223235.3434-2-marex@denx.de
State Superseded
Delegated to: Jaehoon Chung
Headers show

Commit Message

Marek Vasut Nov. 25, 2016, 10:32 p.m. UTC
If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
will happen, so fix it.

In file included from common/spl/spl_mmc.c:11:0:
common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
include/spl.h:18:30: error: label at end of compound statement
 #define MMCSD_MODE_UNDEFINED 0
                              ^
common/spl/spl_mmc.c:335:7: note: in expansion of macro ‘MMCSD_MODE_UNDEFINED’
  case MMCSD_MODE_UNDEFINED:
       ^
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Tom Rini <trini@konsulko.com>
---
 common/spl/spl_mmc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini Nov. 26, 2016, 8:45 p.m. UTC | #1
On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
> If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
> will happen, so fix it.
> 
> In file included from common/spl/spl_mmc.c:11:0:
> common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
> include/spl.h:18:30: error: label at end of compound statement
>  #define MMCSD_MODE_UNDEFINED 0
>                               ^
> common/spl/spl_mmc.c:335:7: note: in expansion of macro ‘MMCSD_MODE_UNDEFINED’
>   case MMCSD_MODE_UNDEFINED:
>        ^
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> Cc: Tom Rini <trini@konsulko.com>
> ---
>  common/spl/spl_mmc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 0b681c2..43c1030 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
>  
>  		break;
>  	case MMCSD_MODE_UNDEFINED:
> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  	default:
> +		{
> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>  		puts("spl: mmc: wrong boot mode\n");
>  #endif
> +		}
>  	}
>  
>  	return err;

I think we have something slightly off here.  Is
CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
no-op as puts becomes a do { } while(0), if disabled.  So I think we
should just remove the ifdef here.
Marek Vasut Nov. 26, 2016, 8:58 p.m. UTC | #2
On 11/26/2016 09:45 PM, Tom Rini wrote:
> On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
>> If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
>> will happen, so fix it.
>>
>> In file included from common/spl/spl_mmc.c:11:0:
>> common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
>> include/spl.h:18:30: error: label at end of compound statement
>>  #define MMCSD_MODE_UNDEFINED 0
>>                               ^
>> common/spl/spl_mmc.c:335:7: note: in expansion of macro ‘MMCSD_MODE_UNDEFINED’
>>   case MMCSD_MODE_UNDEFINED:
>>        ^
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>> Cc: Tom Rini <trini@konsulko.com>
>> ---
>>  common/spl/spl_mmc.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>> index 0b681c2..43c1030 100644
>> --- a/common/spl/spl_mmc.c
>> +++ b/common/spl/spl_mmc.c
>> @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
>>  
>>  		break;
>>  	case MMCSD_MODE_UNDEFINED:
>> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>  	default:
>> +		{
>> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>  		puts("spl: mmc: wrong boot mode\n");
>>  #endif
>> +		}
>>  	}
>>  
>>  	return err;
> 
> I think we have something slightly off here.  Is
> CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
> no-op as puts becomes a do { } while(0), if disabled.  So I think we
> should just remove the ifdef here.

No, series does not fit into SPL on this platform.
Jaehoon Chung Nov. 28, 2016, 2:33 a.m. UTC | #3
On 11/27/2016 05:58 AM, Marek Vasut wrote:
> On 11/26/2016 09:45 PM, Tom Rini wrote:
>> On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
>>> If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
>>> will happen, so fix it.
>>>
>>> In file included from common/spl/spl_mmc.c:11:0:
>>> common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
>>> include/spl.h:18:30: error: label at end of compound statement
>>>  #define MMCSD_MODE_UNDEFINED 0
>>>                               ^
>>> common/spl/spl_mmc.c:335:7: note: in expansion of macro ‘MMCSD_MODE_UNDEFINED’
>>>   case MMCSD_MODE_UNDEFINED:
>>>        ^
>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>>> Cc: Tom Rini <trini@konsulko.com>
>>> ---
>>>  common/spl/spl_mmc.c | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>>> index 0b681c2..43c1030 100644
>>> --- a/common/spl/spl_mmc.c
>>> +++ b/common/spl/spl_mmc.c
>>> @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
>>>  
>>>  		break;
>>>  	case MMCSD_MODE_UNDEFINED:
>>> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>  	default:
>>> +		{
>>> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>  		puts("spl: mmc: wrong boot mode\n");
>>>  #endif
>>> +		}
>>>  	}
>>>  
>>>  	return err;
>>
>> I think we have something slightly off here.  Is
>> CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
>> no-op as puts becomes a do { } while(0), if disabled.  So I think we
>> should just remove the ifdef here.
> 
> No, series does not fit into SPL on this platform.

I don't know..but i remembered that i suggested about putting just "break;" end of bracket.
how about?

Best Regards,
Jaehoon Chung

>
Marek Vasut Nov. 28, 2016, 2:53 a.m. UTC | #4
On 11/28/2016 03:33 AM, Jaehoon Chung wrote:
> On 11/27/2016 05:58 AM, Marek Vasut wrote:
>> On 11/26/2016 09:45 PM, Tom Rini wrote:
>>> On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
>>>> If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
>>>> will happen, so fix it.
>>>>
>>>> In file included from common/spl/spl_mmc.c:11:0:
>>>> common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
>>>> include/spl.h:18:30: error: label at end of compound statement
>>>>  #define MMCSD_MODE_UNDEFINED 0
>>>>                               ^
>>>> common/spl/spl_mmc.c:335:7: note: in expansion of macro ‘MMCSD_MODE_UNDEFINED’
>>>>   case MMCSD_MODE_UNDEFINED:
>>>>        ^
>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>>>> Cc: Tom Rini <trini@konsulko.com>
>>>> ---
>>>>  common/spl/spl_mmc.c | 4 +++-
>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>>>> index 0b681c2..43c1030 100644
>>>> --- a/common/spl/spl_mmc.c
>>>> +++ b/common/spl/spl_mmc.c
>>>> @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
>>>>  
>>>>  		break;
>>>>  	case MMCSD_MODE_UNDEFINED:
>>>> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>>  	default:
>>>> +		{
>>>> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>>  		puts("spl: mmc: wrong boot mode\n");
>>>>  #endif
>>>> +		}
>>>>  	}
>>>>  
>>>>  	return err;
>>>
>>> I think we have something slightly off here.  Is
>>> CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
>>> no-op as puts becomes a do { } while(0), if disabled.  So I think we
>>> should just remove the ifdef here.
>>
>> No, series does not fit into SPL on this platform.
> 
> I don't know..but i remembered that i suggested about putting just "break;" end of bracket.
> how about?

Sure, that works too.
Jaehoon Chung Dec. 1, 2016, 10:10 a.m. UTC | #5
Hi Marek,

On 11/28/2016 11:53 AM, Marek Vasut wrote:
> On 11/28/2016 03:33 AM, Jaehoon Chung wrote:
>> On 11/27/2016 05:58 AM, Marek Vasut wrote:
>>> On 11/26/2016 09:45 PM, Tom Rini wrote:
>>>> On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
>>>>> If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
>>>>> will happen, so fix it.
>>>>>
>>>>> In file included from common/spl/spl_mmc.c:11:0:
>>>>> common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
>>>>> include/spl.h:18:30: error: label at end of compound statement
>>>>>  #define MMCSD_MODE_UNDEFINED 0
>>>>>                               ^
>>>>> common/spl/spl_mmc.c:335:7: note: in expansion of macro ‘MMCSD_MODE_UNDEFINED’
>>>>>   case MMCSD_MODE_UNDEFINED:
>>>>>        ^
>>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>>>>> Cc: Tom Rini <trini@konsulko.com>
>>>>> ---
>>>>>  common/spl/spl_mmc.c | 4 +++-
>>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>>>>> index 0b681c2..43c1030 100644
>>>>> --- a/common/spl/spl_mmc.c
>>>>> +++ b/common/spl/spl_mmc.c
>>>>> @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
>>>>>  
>>>>>  		break;
>>>>>  	case MMCSD_MODE_UNDEFINED:
>>>>> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>>>  	default:
>>>>> +		{
>>>>> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>>>  		puts("spl: mmc: wrong boot mode\n");
>>>>>  #endif
>>>>> +		}
>>>>>  	}
>>>>>  
>>>>>  	return err;
>>>>
>>>> I think we have something slightly off here.  Is
>>>> CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
>>>> no-op as puts becomes a do { } while(0), if disabled.  So I think we
>>>> should just remove the ifdef here.
>>>
>>> No, series does not fit into SPL on this platform.
>>
>> I don't know..but i remembered that i suggested about putting just "break;" end of bracket.
>> how about?
> 
> Sure, that works too.

I didn't see this patch in your next version, right?

Best Regards,
Jaehoon Chung

>
Marek Vasut Dec. 1, 2016, 11:39 a.m. UTC | #6
On 12/01/2016 11:10 AM, Jaehoon Chung wrote:
> Hi Marek,
> 
> On 11/28/2016 11:53 AM, Marek Vasut wrote:
>> On 11/28/2016 03:33 AM, Jaehoon Chung wrote:
>>> On 11/27/2016 05:58 AM, Marek Vasut wrote:
>>>> On 11/26/2016 09:45 PM, Tom Rini wrote:
>>>>> On Fri, Nov 25, 2016 at 11:32:23PM +0100, Marek Vasut wrote:
>>>>>> If CONFIG_SPL_LIBCOMMON_SUPPORT is undefined, the following error
>>>>>> will happen, so fix it.
>>>>>>
>>>>>> In file included from common/spl/spl_mmc.c:11:0:
>>>>>> common/spl/spl_mmc.c: In function ‘spl_mmc_load_image’:
>>>>>> include/spl.h:18:30: error: label at end of compound statement
>>>>>>  #define MMCSD_MODE_UNDEFINED 0
>>>>>>                               ^
>>>>>> common/spl/spl_mmc.c:335:7: note: in expansion of macro ‘MMCSD_MODE_UNDEFINED’
>>>>>>   case MMCSD_MODE_UNDEFINED:
>>>>>>        ^
>>>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>>>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>>>>>> Cc: Tom Rini <trini@konsulko.com>
>>>>>> ---
>>>>>>  common/spl/spl_mmc.c | 4 +++-
>>>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>>>>>> index 0b681c2..43c1030 100644
>>>>>> --- a/common/spl/spl_mmc.c
>>>>>> +++ b/common/spl/spl_mmc.c
>>>>>> @@ -343,10 +343,12 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
>>>>>>  
>>>>>>  		break;
>>>>>>  	case MMCSD_MODE_UNDEFINED:
>>>>>> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>>>>  	default:
>>>>>> +		{
>>>>>> +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>>>>>  		puts("spl: mmc: wrong boot mode\n");
>>>>>>  #endif
>>>>>> +		}
>>>>>>  	}
>>>>>>  
>>>>>>  	return err;
>>>>>
>>>>> I think we have something slightly off here.  Is
>>>>> CONFIG_SPL_SERIAL_SUPPORT also enabled?  That would turn this into a
>>>>> no-op as puts becomes a do { } while(0), if disabled.  So I think we
>>>>> should just remove the ifdef here.
>>>>
>>>> No, series does not fit into SPL on this platform.
>>>
>>> I don't know..but i remembered that i suggested about putting just "break;" end of bracket.
>>> how about?
>>
>> Sure, that works too.
> 
> I didn't see this patch in your next version, right?

It doesn't seem to be necessary anymore.
diff mbox

Patch

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 0b681c2..43c1030 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -343,10 +343,12 @@  static int spl_mmc_load_image(struct spl_image_info *spl_image,
 
 		break;
 	case MMCSD_MODE_UNDEFINED:
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 	default:
+		{
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		puts("spl: mmc: wrong boot mode\n");
 #endif
+		}
 	}
 
 	return err;