public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH V2 0/2] Fix warnings occurred during compilation
@ 2023-06-21 10:59 Nikhil M Jain
  2023-06-21 10:59 ` [PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files Nikhil M Jain
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Nikhil M Jain @ 2023-06-21 10:59 UTC (permalink / raw)
  To: u-boot; +Cc: n-jain1, trini, devarsht, vigneshr, nsekhar, sjg

This patch series aims at fixing warnings which occur during
compilation, by including required header files and using appropriate
types for variables which are typecasted.

Changes in V2:
- Type cast bmp_load_addr to uintptr_t at places necessary rather than
  changing argument type.

Nikhil M Jain (2):
  board: ti: am62x: evm: Include necessary header files
  common: splash_source: Fix type casting errors.

 board/ti/am62x/evm.c   | 1 +
 common/splash_source.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files
  2023-06-21 10:59 [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
@ 2023-06-21 10:59 ` Nikhil M Jain
  2023-07-21 23:34   ` Tom Rini
  2023-06-21 10:59 ` [PATCH V2 2/2] common: splash_source: Fix type casting errors Nikhil M Jain
  2023-07-19 11:14 ` [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
  2 siblings, 1 reply; 10+ messages in thread
From: Nikhil M Jain @ 2023-06-21 10:59 UTC (permalink / raw)
  To: u-boot; +Cc: n-jain1, trini, devarsht, vigneshr, nsekhar, sjg

At the time of compilation evm.c gives below warning for implicit
declaration of enable_caches, to mitigate this include cpu_func.h.

board/ti/am62x/evm.c: In function ‘spl_board_init’:
board/ti/am62x/evm.c:90:9: warning: implicit declaration of function ‘enable_caches’ [-Wimplicit-function-declaration]
90 |         enable_caches();

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
---
V2:
- No change.

 board/ti/am62x/evm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index d3c1786cd9..ad93908840 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -12,6 +12,7 @@
 #include <init.h>
 #include <video.h>
 #include <splash.h>
+#include <cpu_func.h>
 #include <k3-ddrss.h>
 #include <fdt_support.h>
 #include <asm/io.h>
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH V2 2/2] common: splash_source: Fix type casting errors
  2023-06-21 10:59 [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
  2023-06-21 10:59 ` [PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files Nikhil M Jain
@ 2023-06-21 10:59 ` Nikhil M Jain
  2023-07-21 23:34   ` Tom Rini
  2023-07-19 11:14 ` [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
  2 siblings, 1 reply; 10+ messages in thread
From: Nikhil M Jain @ 2023-06-21 10:59 UTC (permalink / raw)
  To: u-boot; +Cc: n-jain1, trini, devarsht, vigneshr, nsekhar, sjg

During compilation splash_source puts out below warning for type
conversion in splash_load_fit for bmp_load_addr and fit_header.
Change their type to uintptr_t to fix the warnings.

common/splash_source.c: In function ‘splash_load_fit’:
common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  366 |         img_header = (struct legacy_img_hdr *)bmp_load_addr;
      |                      ^
common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  376 |         res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
      |                                                 ^
common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  401 |                 memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size);

The above warnings are generated if CONFIG_FIT is enabled.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
---
V2:
- Type cast bmp_load_addr to uintptr_t at places necessary instead of
  changing argument type for splash_load_fit as done in splash_load_raw.

 common/splash_source.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/splash_source.c b/common/splash_source.c
index a260137619..7223a1aae7 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -363,7 +363,7 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
 	if (res < 0)
 		return res;
 
-	img_header = (struct legacy_img_hdr *)bmp_load_addr;
+	img_header = (struct legacy_img_hdr *)(uintptr_t)bmp_load_addr;
 	if (image_get_magic(img_header) != FDT_MAGIC) {
 		printf("Could not find FDT magic\n");
 		return -EINVAL;
@@ -373,7 +373,7 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
 
 	/* Read in entire FIT */
 	fit_header = (const u32 *)(bmp_load_addr + header_size);
-	res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
+	res = splash_storage_read_raw(location, (uintptr_t)fit_header, fit_size);
 	if (res < 0)
 		return res;
 
@@ -398,7 +398,7 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
 	/* Extract the splash data from FIT */
 	/* 1. Test if splash is in FIT internal data. */
 	if (!fit_image_get_data(fit_header, node_offset, &internal_splash_data, &internal_splash_size))
-		memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size);
+		memmove((void *)(uintptr_t)bmp_load_addr, internal_splash_data, internal_splash_size);
 	/* 2. Test if splash is in FIT external data with fixed position. */
 	else if (!fit_image_get_data_position(fit_header, node_offset, &external_splash_addr))
 		is_splash_external = true;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH V2 0/2] Fix warnings occurred during compilation
  2023-06-21 10:59 [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
  2023-06-21 10:59 ` [PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files Nikhil M Jain
  2023-06-21 10:59 ` [PATCH V2 2/2] common: splash_source: Fix type casting errors Nikhil M Jain
@ 2023-07-19 11:14 ` Nikhil M Jain
  2023-07-19 11:58   ` Tom Rini
  2 siblings, 1 reply; 10+ messages in thread
From: Nikhil M Jain @ 2023-07-19 11:14 UTC (permalink / raw)
  To: u-boot, trini; +Cc: devarsht, vigneshr, nsekhar, sjg

Hi Tom,

Seems like this series fell through the cracks, so a gentle reminder on
this.

On 21/06/23 16:29, Nikhil M Jain wrote:
> This patch series aims at fixing warnings which occur during
> compilation, by including required header files and using appropriate
> types for variables which are typecasted.
> 
> Changes in V2:
> - Type cast bmp_load_addr to uintptr_t at places necessary rather than
>    changing argument type.
> 
> Nikhil M Jain (2):
>    board: ti: am62x: evm: Include necessary header files
>    common: splash_source: Fix type casting errors.
> 
>   board/ti/am62x/evm.c   | 1 +
>   common/splash_source.c | 6 +++---
>   2 files changed, 4 insertions(+), 3 deletions(-)
> 

Thanks,
Nikhil

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2 0/2] Fix warnings occurred during compilation
  2023-07-19 11:14 ` [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
@ 2023-07-19 11:58   ` Tom Rini
  2023-07-19 13:14     ` [EXTERNAL] " Nikhil M Jain
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2023-07-19 11:58 UTC (permalink / raw)
  To: Nikhil M Jain; +Cc: u-boot, devarsht, vigneshr, nsekhar, sjg

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

On Wed, Jul 19, 2023 at 04:44:36PM +0530, Nikhil M Jain wrote:
> Hi Tom,
> 
> Seems like this series fell through the cracks, so a gentle reminder on
> this.
> 
> On 21/06/23 16:29, Nikhil M Jain wrote:
> > This patch series aims at fixing warnings which occur during
> > compilation, by including required header files and using appropriate
> > types for variables which are typecasted.
> > 
> > Changes in V2:
> > - Type cast bmp_load_addr to uintptr_t at places necessary rather than
> >    changing argument type.
> > 
> > Nikhil M Jain (2):
> >    board: ti: am62x: evm: Include necessary header files
> >    common: splash_source: Fix type casting errors.
> > 
> >   board/ti/am62x/evm.c   | 1 +
> >   common/splash_source.c | 6 +++---
> >   2 files changed, 4 insertions(+), 3 deletions(-)

This depends on the other series that you just reposted I believe you
had said before.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [EXTERNAL] Re: [PATCH V2 0/2] Fix warnings occurred during compilation
  2023-07-19 11:58   ` Tom Rini
@ 2023-07-19 13:14     ` Nikhil M Jain
  2023-07-19 13:18       ` Tom Rini
  0 siblings, 1 reply; 10+ messages in thread
From: Nikhil M Jain @ 2023-07-19 13:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, devarsht, vigneshr, nsekhar, sjg

Hi Tom,

On 19/07/23 17:28, Tom Rini wrote:
> On Wed, Jul 19, 2023 at 04:44:36PM +0530, Nikhil M Jain wrote:
>> Hi Tom,
>>
>> Seems like this series fell through the cracks, so a gentle reminder on
>> this.
>>
>> On 21/06/23 16:29, Nikhil M Jain wrote:
>>> This patch series aims at fixing warnings which occur during
>>> compilation, by including required header files and using appropriate
>>> types for variables which are typecasted.
>>>
>>> Changes in V2:
>>> - Type cast bmp_load_addr to uintptr_t at places necessary rather than
>>>     changing argument type.
>>>
>>> Nikhil M Jain (2):
>>>     board: ti: am62x: evm: Include necessary header files
>>>     common: splash_source: Fix type casting errors.
>>>
>>>    board/ti/am62x/evm.c   | 1 +
>>>    common/splash_source.c | 6 +++---
>>>    2 files changed, 4 insertions(+), 3 deletions(-)
> 
> This depends on the other series that you just reposted I believe you
> had said before.
> 

This series is independent and doesn't depend on the series I have
reposted yesterday.

Thanks,
Nikhil

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [EXTERNAL] Re: [PATCH V2 0/2] Fix warnings occurred during compilation
  2023-07-19 13:14     ` [EXTERNAL] " Nikhil M Jain
@ 2023-07-19 13:18       ` Tom Rini
  2023-07-20  6:05         ` Nikhil M Jain
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2023-07-19 13:18 UTC (permalink / raw)
  To: Nikhil M Jain; +Cc: u-boot, devarsht, vigneshr, nsekhar, sjg

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

On Wed, Jul 19, 2023 at 06:44:18PM +0530, Nikhil M Jain wrote:
> Hi Tom,
> 
> On 19/07/23 17:28, Tom Rini wrote:
> > On Wed, Jul 19, 2023 at 04:44:36PM +0530, Nikhil M Jain wrote:
> > > Hi Tom,
> > > 
> > > Seems like this series fell through the cracks, so a gentle reminder on
> > > this.
> > > 
> > > On 21/06/23 16:29, Nikhil M Jain wrote:
> > > > This patch series aims at fixing warnings which occur during
> > > > compilation, by including required header files and using appropriate
> > > > types for variables which are typecasted.
> > > > 
> > > > Changes in V2:
> > > > - Type cast bmp_load_addr to uintptr_t at places necessary rather than
> > > >     changing argument type.
> > > > 
> > > > Nikhil M Jain (2):
> > > >     board: ti: am62x: evm: Include necessary header files
> > > >     common: splash_source: Fix type casting errors.
> > > > 
> > > >    board/ti/am62x/evm.c   | 1 +
> > > >    common/splash_source.c | 6 +++---
> > > >    2 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > This depends on the other series that you just reposted I believe you
> > had said before.
> > 
> 
> This series is independent and doesn't depend on the series I have
> reposted yesterday.

What is it against then? It didn't apply before, I could have sworn I
reported.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2 0/2] Fix warnings occurred during compilation
  2023-07-19 13:18       ` Tom Rini
@ 2023-07-20  6:05         ` Nikhil M Jain
  0 siblings, 0 replies; 10+ messages in thread
From: Nikhil M Jain @ 2023-07-20  6:05 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, devarsht, vigneshr, nsekhar, sjg

Hi Tom,

On 19/07/23 18:48, Tom Rini wrote:
> On Wed, Jul 19, 2023 at 06:44:18PM +0530, Nikhil M Jain wrote:
>> Hi Tom,
>>
>> On 19/07/23 17:28, Tom Rini wrote:
>>> On Wed, Jul 19, 2023 at 04:44:36PM +0530, Nikhil M Jain wrote:
>>>> Hi Tom,
>>>>
>>>> Seems like this series fell through the cracks, so a gentle reminder on
>>>> this.
>>>>
>>>> On 21/06/23 16:29, Nikhil M Jain wrote:
>>>>> This patch series aims at fixing warnings which occur during
>>>>> compilation, by including required header files and using appropriate
>>>>> types for variables which are typecasted.
>>>>>
>>>>> Changes in V2:
>>>>> - Type cast bmp_load_addr to uintptr_t at places necessary rather than
>>>>>      changing argument type.
>>>>>
>>>>> Nikhil M Jain (2):
>>>>>      board: ti: am62x: evm: Include necessary header files
>>>>>      common: splash_source: Fix type casting errors.
>>>>>
>>>>>     board/ti/am62x/evm.c   | 1 +
>>>>>     common/splash_source.c | 6 +++---
>>>>>     2 files changed, 4 insertions(+), 3 deletions(-)
>>>
>>> This depends on the other series that you just reposted I believe you
>>> had said before.
>>>
>>
>> This series is independent and doesn't depend on the series I have
>> reposted yesterday.
> 
> What is it against then? It didn't apply before, I could have sworn I
> reported.
> 
I have checked, these patches can be applied on tip of next
independently. Below are the logs.

[1] https://gist.github.com/NikMJain/336831817fc79d6bf3d512d6d2663d59

Thanks,
Nikhil

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files
  2023-06-21 10:59 ` [PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files Nikhil M Jain
@ 2023-07-21 23:34   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2023-07-21 23:34 UTC (permalink / raw)
  To: Nikhil M Jain; +Cc: u-boot, devarsht, vigneshr, nsekhar, sjg

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

On Wed, Jun 21, 2023 at 04:29:52PM +0530, Nikhil M Jain wrote:

> At the time of compilation evm.c gives below warning for implicit
> declaration of enable_caches, to mitigate this include cpu_func.h.
> 
> board/ti/am62x/evm.c: In function ‘spl_board_init’:
> board/ti/am62x/evm.c:90:9: warning: implicit declaration of function ‘enable_caches’ [-Wimplicit-function-declaration]
> 90 |         enable_caches();
> 
> Signed-off-by: Nikhil M Jain <n-jain1@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH V2 2/2] common: splash_source: Fix type casting errors
  2023-06-21 10:59 ` [PATCH V2 2/2] common: splash_source: Fix type casting errors Nikhil M Jain
@ 2023-07-21 23:34   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2023-07-21 23:34 UTC (permalink / raw)
  To: Nikhil M Jain; +Cc: u-boot, devarsht, vigneshr, nsekhar, sjg

[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]

On Wed, Jun 21, 2023 at 04:29:53PM +0530, Nikhil M Jain wrote:

> During compilation splash_source puts out below warning for type
> conversion in splash_load_fit for bmp_load_addr and fit_header.
> Change their type to uintptr_t to fix the warnings.
> 
> common/splash_source.c: In function ‘splash_load_fit’:
> common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>   366 |         img_header = (struct legacy_img_hdr *)bmp_load_addr;
>       |                      ^
> common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>   376 |         res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
>       |                                                 ^
> common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>   401 |                 memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size);
> 
> The above warnings are generated if CONFIG_FIT is enabled.
> 
> Signed-off-by: Nikhil M Jain <n-jain1@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-07-21 23:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21 10:59 [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
2023-06-21 10:59 ` [PATCH V2 1/2] board: ti: am62x: evm: Include necessary header files Nikhil M Jain
2023-07-21 23:34   ` Tom Rini
2023-06-21 10:59 ` [PATCH V2 2/2] common: splash_source: Fix type casting errors Nikhil M Jain
2023-07-21 23:34   ` Tom Rini
2023-07-19 11:14 ` [PATCH V2 0/2] Fix warnings occurred during compilation Nikhil M Jain
2023-07-19 11:58   ` Tom Rini
2023-07-19 13:14     ` [EXTERNAL] " Nikhil M Jain
2023-07-19 13:18       ` Tom Rini
2023-07-20  6:05         ` Nikhil M Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox