Commit 2b4a6cc9 authored by Benjamin Gray's avatar Benjamin Gray Committed by Michael Ellerman
Browse files

powerpc: Annotate endianness of various variables and functions



Sparse reports several endianness warnings on variables and functions
that are consistently treated as big endian. There are no
multi-endianness shenanigans going on here so fix these low hanging
fruit up in one patch.

All changes are just type annotations; no endianness switching
operations are introduced by this patch.

Signed-off-by: default avatarBenjamin Gray <bgray@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231011053711.93427-7-bgray@linux.ibm.com
parent 419d5d11
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -626,7 +626,7 @@ static inline pte_t pte_mkdevmap(pte_t pte)
 */
static inline int pte_devmap(pte_t pte)
{
	u64 mask = cpu_to_be64(_PAGE_DEVMAP | _PAGE_PTE);
	__be64 mask = cpu_to_be64(_PAGE_DEVMAP | _PAGE_PTE);

	return (pte_raw(pte) & mask) == mask;
}
+8 −8
Original line number Diff line number Diff line
@@ -74,14 +74,14 @@ struct imc_events {
 * The following is the data structure to hold trace imc data.
 */
struct trace_imc_data {
	u64 tb1;
	u64 ip;
	u64 val;
	u64 cpmc1;
	u64 cpmc2;
	u64 cpmc3;
	u64 cpmc4;
	u64 tb2;
	__be64 tb1;
	__be64 ip;
	__be64 val;
	__be64 cpmc1;
	__be64 cpmc2;
	__be64 cpmc3;
	__be64 cpmc4;
	__be64 tb2;
};

/* Event attribute array index */
+1 −1
Original line number Diff line number Diff line
@@ -947,7 +947,7 @@ struct option_vector7 {
} __packed;

struct ibm_arch_vec {
	struct { u32 mask, val; } pvrs[14];
	struct { __be32 mask, val; } pvrs[14];

	u8 num_vectors;

+2 −2
Original line number Diff line number Diff line
@@ -379,8 +379,8 @@ void default_machine_kexec(struct kimage *image)

#ifdef CONFIG_PPC_64S_HASH_MMU
/* Values we need to export to the second kernel via the device tree. */
static unsigned long htab_base;
static unsigned long htab_size;
static __be64 htab_base;
static __be64 htab_size;

static struct property htab_base_prop = {
	.name = "linux,htab-base",
+3 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#include <asm/plpks.h>

struct umem_info {
	u64 *buf;		/* data buffer for usable-memory property */
	__be64 *buf;		/* data buffer for usable-memory property */
	u32 size;		/* size allocated for the data buffer */
	u32 max_entries;	/* maximum no. of entries */
	u32 idx;		/* index of current entry */
@@ -443,10 +443,10 @@ static int locate_mem_hole_bottom_up_ppc64(struct kexec_buf *kbuf,
 *
 * Returns buffer on success, NULL on error.
 */
static u64 *check_realloc_usable_mem(struct umem_info *um_info, int cnt)
static __be64 *check_realloc_usable_mem(struct umem_info *um_info, int cnt)
{
	u32 new_size;
	u64 *tbuf;
	__be64 *tbuf;

	if ((um_info->idx + cnt) <= um_info->max_entries)
		return um_info->buf;
Loading