Merge patch series "Clean-up patch set for MbedTLS integration"

Raymond Mao <raymond.mao@linaro.org> says:

This patch set is picked from the previously posted serie:
"[RFC] Integrate MbedTLS v3.6 LTS with U-Boot"

They are not directly related to MbedTLS integration, but the
prerequisite for a few clean-up, refactoring and minor fixes.

For V2, the linker script patch is dropped and added one patch
to move the snprintf to stdio.h
This commit is contained in:
Tom Rini
2024-05-22 08:55:35 -06:00
21 changed files with 43 additions and 48 deletions

View File

@@ -46,6 +46,23 @@ static inline int vprintf(const char *fmt, va_list args)
}
#endif
/**
* Format a string and place it in a buffer
*
* @buf: The buffer to place the result into
* @size: The size of the buffer, including the trailing null space
* @fmt: The format string to use
* @...: Arguments for the format string
* Return: the number of characters which would be
* generated for the given input, excluding the trailing null,
* as per ISO C99. If the return is greater than or equal to
* @size, the resulting string is truncated.
*
* See the vsprintf() documentation for format string extensions over C99.
*/
int snprintf(char *buf, size_t size, const char *fmt, ...)
__attribute__ ((format (__printf__, 3, 4)));
/*
* FILE based functions (can only be used AFTER relocation!)
*/

View File

@@ -10,18 +10,18 @@
#define MD5_SUM_LEN 16
struct MD5Context {
typedef struct MD5Context {
__u32 buf[4];
__u32 bits[2];
union {
unsigned char in[64];
__u32 in32[16];
};
};
} MD5Context;
void MD5Init(struct MD5Context *ctx);
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *ctx);
void MD5Init(MD5Context *ctx);
void MD5Update(MD5Context *ctx, unsigned char const *buf, unsigned int len);
void MD5Final(unsigned char digest[16], MD5Context *ctx);
/*
* Calculate and store in 'output' the MD5 digest of 'len' bytes at

View File

@@ -218,23 +218,6 @@ char *simple_itoa(ulong val);
*/
char *simple_xtoa(ulong num);
/**
* Format a string and place it in a buffer
*
* @buf: The buffer to place the result into
* @size: The size of the buffer, including the trailing null space
* @fmt: The format string to use
* @...: Arguments for the format string
* Return: the number of characters which would be
* generated for the given input, excluding the trailing null,
* as per ISO C99. If the return is greater than or equal to
* @size, the resulting string is truncated.
*
* See the vsprintf() documentation for format string extensions over C99.
*/
int snprintf(char *buf, size_t size, const char *fmt, ...)
__attribute__ ((format (__printf__, 3, 4)));
/**
* Format a string and place it in a buffer
*