diff mbox series

[v1,2/5] discover/platform-powerpc: Fix build warning

Message ID 42d8c424b52852beefce0885095886edf1ef6eb3.1587958237.git.geoff@infradead.org
State New
Headers show
Series [v1,1/5] ncurses/nc-menu: Remove stray declaration | expand

Commit Message

Geoff Levand April 27, 2020, 3:38 a.m. UTC
Fix bad pointer assignment when coping mailbox data:

  warning: assignment to ‘uint8_t *’ from incompatible pointer type ‘uint8_t (*)[13]’

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 discover/platform-powerpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jeremy Kerr May 3, 2020, 4:43 a.m. UTC | #1
Hi Geoff,

> Fix bad pointer assignment when coping mailbox data:
> 
>   warning: assignment to ‘uint8_t *’ from incompatible pointer type ‘uint8_t (*)[13]’

Thanks, applied. I'll enable all platforms for my usual builds :)

Maxim: any objections to this?

Cheers,


Jeremy

> 
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
>  discover/platform-powerpc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
> index c6ab416..bcb18e1 100644
> --- a/discover/platform-powerpc.c
> +++ b/discover/platform-powerpc.c
> @@ -564,7 +564,7 @@ static int get_ipmi_boot_mailbox(struct platform_powerpc *platform,
>  			 * Enterprise ID number
>  			 */
>  			block_size -= CHASSIS_BOOT_MBOX_IANA_SZ;
> -			boot_opt_data = &mailbox.b0.data;
> +			boot_opt_data = mailbox.b0.data;
>  
>  			/* Check IANA matches the IBM number, '2' */
>  			if (mailbox.b0.iana[0] != 0x02 ||
> @@ -577,7 +577,7 @@ static int get_ipmi_boot_mailbox(struct platform_powerpc *platform,
>  				return -1;
>  			}
>  		} else {
> -			boot_opt_data = &mailbox.data;
> +			boot_opt_data = mailbox.data;
>  		}
>  
>  		mailbox_buffer = talloc_realloc(platform, mailbox_buffer,
>
Maxim Polyakov May 6, 2020, 3:51 p.m. UTC | #2
03.05.2020 07:43, Jeremy Kerr пишет:
> Maxim: any objections to this?

Sorry about the delay just back from holiday.

Good catch. Thanks.
I agree with these changes.
diff mbox series

Patch

diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index c6ab416..bcb18e1 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -564,7 +564,7 @@  static int get_ipmi_boot_mailbox(struct platform_powerpc *platform,
 			 * Enterprise ID number
 			 */
 			block_size -= CHASSIS_BOOT_MBOX_IANA_SZ;
-			boot_opt_data = &mailbox.b0.data;
+			boot_opt_data = mailbox.b0.data;
 
 			/* Check IANA matches the IBM number, '2' */
 			if (mailbox.b0.iana[0] != 0x02 ||
@@ -577,7 +577,7 @@  static int get_ipmi_boot_mailbox(struct platform_powerpc *platform,
 				return -1;
 			}
 		} else {
-			boot_opt_data = &mailbox.data;
+			boot_opt_data = mailbox.data;
 		}
 
 		mailbox_buffer = talloc_realloc(platform, mailbox_buffer,