Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/pci: use proper endianness annotations

Add proper annotation to the bar definition and use casts within the
bus accessors. Also change the sequence in the accessors to do the
shifts in the native byte order. No functional change.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
5064cd35 90b3baa2

+5 -5
+1 -1
arch/s390/include/asm/pci_clp.h
··· 85 85 u32 fid; /* pci function id */ 86 86 u8 bar_size[PCI_BAR_COUNT]; 87 87 u16 pchid; 88 - u32 bar[PCI_BAR_COUNT]; 88 + __le32 bar[PCI_BAR_COUNT]; 89 89 u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */ 90 90 u32 : 16; 91 91 u8 fmb_len;
+4 -4
arch/s390/pci/pci.c
··· 224 224 225 225 rc = zpci_load(&data, req, offset); 226 226 if (!rc) { 227 - data = data << ((8 - len) * 8); 228 - data = le64_to_cpu(data); 227 + data = le64_to_cpu((__force __le64) data); 228 + data >>= (8 - len) * 8; 229 229 *val = (u32) data; 230 230 } else 231 231 *val = 0xffffffff; ··· 238 238 u64 data = val; 239 239 int rc; 240 240 241 - data = cpu_to_le64(data); 242 - data = data >> ((8 - len) * 8); 241 + data <<= (8 - len) * 8; 242 + data = (__force u64) cpu_to_le64(data); 243 243 rc = zpci_store(data, req, offset); 244 244 return rc; 245 245 }