bootconfig.h 917 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _BOOTCONFIG_LINUX_BOOTCONFIG_H
  3. #define _BOOTCONFIG_LINUX_BOOTCONFIG_H
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <stdint.h>
  7. #include <stdbool.h>
  8. #include <ctype.h>
  9. #include <errno.h>
  10. #include <string.h>
  11. #ifndef fallthrough
  12. # define fallthrough
  13. #endif
  14. #define WARN_ON(cond) \
  15. ((cond) ? printf("Internal warning(%s:%d, %s): %s\n", \
  16. __FILE__, __LINE__, __func__, #cond) : 0)
  17. #define unlikely(cond) (cond)
  18. /* Copied from lib/string.c */
  19. static inline char *skip_spaces(const char *str)
  20. {
  21. while (isspace(*str))
  22. ++str;
  23. return (char *)str;
  24. }
  25. static inline char *strim(char *s)
  26. {
  27. size_t size;
  28. char *end;
  29. size = strlen(s);
  30. if (!size)
  31. return s;
  32. end = s + size - 1;
  33. while (end >= s && isspace(*end))
  34. end--;
  35. *(end + 1) = '\0';
  36. return skip_spaces(s);
  37. }
  38. #define __init
  39. #define __initdata
  40. #include "../../../../include/linux/bootconfig.h"
  41. #endif