diff mbox

[U-Boot] image-fit: fix fit_image_load() OS check

Message ID 1471199484-44914-1-git-send-email-andreas@biessmann.org
State Accepted
Commit 950fe26de9d6e7355b96c6f5dcc8455398216b9f
Delegated to: Tom Rini
Headers show

Commit Message

Andreas Bießmann Aug. 14, 2016, 6:31 p.m. UTC
Commit 62afc601883e788f3f22291202d5b2a23c1a8b06 introduced fpga image load via
bootm but broke the OS check in fit_image_load().

This commit removes following compiler warning:

---8<---
In file included from tools/common/image-fit.c:1:
/Volumes/devel/u-boot/tools/../common/image-fit.c:1715:39: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
        os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
                                             ^  ~~~~~~~~~~~~
/Volumes/devel/u-boot/tools/../common/image-fit.c:1715:39: note: use '|' for a bitwise operation
        os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
                                             ^~
                                             |
1 warning generated.
--->8---

Signed-off-by: Andreas Bießmann <andreas@biessmann.org>
Cc: Michal Simek <michal.simek@xilinx.com>
---
 common/image-fit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michal Simek Aug. 15, 2016, 6:41 a.m. UTC | #1
On 14.8.2016 20:31, Andreas Bießmann wrote:
> Commit 62afc601883e788f3f22291202d5b2a23c1a8b06 introduced fpga image load via
> bootm but broke the OS check in fit_image_load().
> 
> This commit removes following compiler warning:
> 
> ---8<---
> In file included from tools/common/image-fit.c:1:
> /Volumes/devel/u-boot/tools/../common/image-fit.c:1715:39: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
>         os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
>                                              ^  ~~~~~~~~~~~~
> /Volumes/devel/u-boot/tools/../common/image-fit.c:1715:39: note: use '|' for a bitwise operation
>         os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
>                                              ^~
>                                              |
> 1 warning generated.
> --->8---
> 
> Signed-off-by: Andreas Bießmann <andreas@biessmann.org>
> Cc: Michal Simek <michal.simek@xilinx.com>
> ---
>  common/image-fit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/common/image-fit.c b/common/image-fit.c
> index d8d4e95..f833fe3 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1712,7 +1712,8 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
>  		  (image_type == IH_TYPE_KERNEL &&
>  		   fit_image_check_type(fit, noffset, IH_TYPE_KERNEL_NOLOAD));
>  
> -	os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
> +	os_ok = image_type == IH_TYPE_FLATDT ||
> +		image_type == IH_TYPE_FPGA ||
>  		fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
>  		fit_image_check_os(fit, noffset, IH_OS_U_BOOT) ||
>  		fit_image_check_os(fit, noffset, IH_OS_OPENRTOS);
> 


hm. Interesting. I didn't see that compilation warning.

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal
Andreas Bießmann Aug. 15, 2016, 7:30 a.m. UTC | #2
Hi Michal,

On 2016-08-15 08:41, Michal Simek wrote:
> On 14.8.2016 20:31, Andreas Bießmann wrote:
>> Commit 62afc601883e788f3f22291202d5b2a23c1a8b06 introduced fpga image 
>> load via
>> bootm but broke the OS check in fit_image_load().
>> 
>> This commit removes following compiler warning:
>> 
>> ---8<---
>> In file included from tools/common/image-fit.c:1:
>> /Volumes/devel/u-boot/tools/../common/image-fit.c:1715:39: warning: 
>> use of logical '||' with constant operand [-Wconstant-logical-operand]
>>         os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
>>                                              ^  ~~~~~~~~~~~~
>> /Volumes/devel/u-boot/tools/../common/image-fit.c:1715:39: note: use 
>> '|' for a bitwise operation
>>         os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
>>                                              ^~
>>                                              |
>> 1 warning generated.
>> --->8---
>> 
>> Signed-off-by: Andreas Bießmann <andreas@biessmann.org>
>> Cc: Michal Simek <michal.simek@xilinx.com>
>> ---
>>  common/image-fit.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/common/image-fit.c b/common/image-fit.c
>> index d8d4e95..f833fe3 100644
>> --- a/common/image-fit.c
>> +++ b/common/image-fit.c
>> @@ -1712,7 +1712,8 @@ int fit_image_load(bootm_headers_t *images, 
>> ulong addr,
>>  		  (image_type == IH_TYPE_KERNEL &&
>>  		   fit_image_check_type(fit, noffset, IH_TYPE_KERNEL_NOLOAD));
>> 
>> -	os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
>> +	os_ok = image_type == IH_TYPE_FLATDT ||
>> +		image_type == IH_TYPE_FPGA ||
>>  		fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
>>  		fit_image_check_os(fit, noffset, IH_OS_U_BOOT) ||
>>  		fit_image_check_os(fit, noffset, IH_OS_OPENRTOS);
>> 
> 
> 
> hm. Interesting. I didn't see that compilation warning.

It is an llvm 3.6 or so compiler (latest OS X)

Andreas
Tom Rini Sept. 7, 2016, 5:57 p.m. UTC | #3
On Sun, Aug 14, 2016 at 08:31:24PM +0200, Andreas Bießmann wrote:

> Commit 62afc601883e788f3f22291202d5b2a23c1a8b06 introduced fpga image load via
> bootm but broke the OS check in fit_image_load().
> 
> This commit removes following compiler warning:
> 

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index d8d4e95..f833fe3 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1712,7 +1712,8 @@  int fit_image_load(bootm_headers_t *images, ulong addr,
 		  (image_type == IH_TYPE_KERNEL &&
 		   fit_image_check_type(fit, noffset, IH_TYPE_KERNEL_NOLOAD));
 
-	os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
+	os_ok = image_type == IH_TYPE_FLATDT ||
+		image_type == IH_TYPE_FPGA ||
 		fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
 		fit_image_check_os(fit, noffset, IH_OS_U_BOOT) ||
 		fit_image_check_os(fit, noffset, IH_OS_OPENRTOS);