diff mbox series

[libubootenv] Use stdint.h integer types on FreeBSD

Message ID 21EDD5B8-8BB0-4895-92C8-5E8D57001C30@siemens.com
State Accepted
Headers show
Series [libubootenv] Use stdint.h integer types on FreeBSD | expand

Commit Message

Storm, Christian Jan. 22, 2024, 9:13 a.m. UTC
FreeBSD and other BSDs have not defined u{8,32,64}, so use their
stdint.h pendants.

This is in the BSD #ifdef path providing a shim for MTD which
is not available on BSDs anyway.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 src/uboot_private.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Storm, Christian Jan. 22, 2024, 9:20 a.m. UTC | #1
Hi Stefano,

> FreeBSD and other BSDs have not defined u{8,32,64}, so use their
> stdint.h pendants.
> 
> This is in the BSD #ifdef path providing a shim for MTD which
> is not available on BSDs anyway.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>

As we both did the (obvious) same thing, I included you as
having signed-off this. I hope this is OK?

#define ENODATA ENODEV
is already present in your commit 86421eb "Move MTD related
function to separate file", so no change here.
If we wanted to support NetBSD though, we need to conditionalize
it since NetBSD has ENODATA defined...


Kind regards,
  Christian
Stefano Babic Jan. 22, 2024, 9:32 a.m. UTC | #2
On 22.01.24 10:20, 'Storm, Christian' via swupdate wrote:
> Hi Stefano,
> 
>> FreeBSD and other BSDs have not defined u{8,32,64}, so use their
>> stdint.h pendants.
>>
>> This is in the BSD #ifdef path providing a shim for MTD which
>> is not available on BSDs anyway.
>>
>> Signed-off-by: Christian Storm <christian.storm@siemens.com>
>> Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
> 
> As we both did the (obvious) same thing, I included you as
> having signed-off this. I hope this is OK?
> 

Yes, thanks !

> #define ENODATA ENODEV
> is already present in your commit 86421eb "Move MTD related
> function to separate file", so no change here.
> If we wanted to support NetBSD though, we need to conditionalize
> it since NetBSD has ENODATA defined...

Never tried to build with NetBSD, and we can do it if needed.

Regards,
Stefano

> 
> 
> Kind regards,
>    Christian
>
diff mbox series

Patch

diff --git a/src/uboot_private.h b/src/uboot_private.h
index 92772d2..bd97940 100644
--- a/src/uboot_private.h
+++ b/src/uboot_private.h
@@ -51,13 +51,13 @@ 
 #define ENODATA ENODEV
 
 struct mtd_info_user {
-	u8 type;
-	u32 flags;
-	u32 size;	/* Total size of the MTD */
-	u32 erasesize;
-	u32 writesize;
-	u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */
-	u64 padding;	/* Old obsolete field; do not use */
+	uint8_t type;
+	uint32_t flags;
+	uint32_t size;		/* Total size of the MTD */
+	uint32_t erasesize;
+	uint32_t writesize;
+	uint32_t oobsize;	/* Amount of OOB data per block (e.g. 16) */
+	uint64_t padding;	/* Old obsolete field; do not use */
 };
 #endif