Changeset d0a1fc8 in rtems


Ignore:
Timestamp:
03/06/17 01:16:56 (7 years ago)
Author:
David Gibson <david@…>
Branches:
5, master
Children:
67f49b98
Parents:
90f54b0e
git-author:
David Gibson <david@…> (03/06/17 01:16:56)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/19/18 05:01:10)
Message:

libfdt: Change names of sparse helper macros

The default libfdt_env.h (for POSIXish userland builds) supports sparse
checking. It has a couple of helper macros, force and bitwise which
expand the relevant sparse attributes to enable checking for incorrect
or missing endian conversions.

Those are bad names: for one, leading underscores are supposed to be
reserved for the system libraries, and worse, some systems (including
RHEL7) do define those names already.

So change them to FDT_FORCE and FDT_BITWISE which are far less likely to
have collisions.

Suggested-by: Paolo Bonzini <pbonzini@…>
Signed-off-by: David Gibson <david@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/libfdt_env.h

    r90f54b0e rd0a1fc8  
    5959
    6060#ifdef __CHECKER__
    61 #define __force __attribute__((force))
    62 #define __bitwise __attribute__((bitwise))
     61#define FDT_FORCE __attribute__((force))
     62#define FDT_BITWISE __attribute__((bitwise))
    6363#else
    64 #define __force
    65 #define __bitwise
     64#define FDT_FORCE
     65#define FDT_BITWISE
    6666#endif
    6767
    68 typedef uint16_t __bitwise fdt16_t;
    69 typedef uint32_t __bitwise fdt32_t;
    70 typedef uint64_t __bitwise fdt64_t;
     68typedef uint16_t FDT_BITWISE fdt16_t;
     69typedef uint32_t FDT_BITWISE fdt32_t;
     70typedef uint64_t FDT_BITWISE fdt64_t;
    7171
    7272#define EXTRACT_BYTE(x, n)      ((unsigned long long)((uint8_t *)&x)[n])
     
    8181static inline uint16_t fdt16_to_cpu(fdt16_t x)
    8282{
    83         return (__force uint16_t)CPU_TO_FDT16(x);
     83        return (FDT_FORCE uint16_t)CPU_TO_FDT16(x);
    8484}
    8585static inline fdt16_t cpu_to_fdt16(uint16_t x)
    8686{
    87         return (__force fdt16_t)CPU_TO_FDT16(x);
     87        return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x);
    8888}
    8989
    9090static inline uint32_t fdt32_to_cpu(fdt32_t x)
    9191{
    92         return (__force uint32_t)CPU_TO_FDT32(x);
     92        return (FDT_FORCE uint32_t)CPU_TO_FDT32(x);
    9393}
    9494static inline fdt32_t cpu_to_fdt32(uint32_t x)
    9595{
    96         return (__force fdt32_t)CPU_TO_FDT32(x);
     96        return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x);
    9797}
    9898
    9999static inline uint64_t fdt64_to_cpu(fdt64_t x)
    100100{
    101         return (__force uint64_t)CPU_TO_FDT64(x);
     101        return (FDT_FORCE uint64_t)CPU_TO_FDT64(x);
    102102}
    103103static inline fdt64_t cpu_to_fdt64(uint64_t x)
    104104{
    105         return (__force fdt64_t)CPU_TO_FDT64(x);
     105        return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x);
    106106}
    107107#undef CPU_TO_FDT64
Note: See TracChangeset for help on using the changeset viewer.