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

powerpc/xive: Remove (almost) unused macros

The GETFIELD and SETFIELD macros in xive-regs.h aren't used except for
a single instance of GETFIELD, so replace that and remove them.

These macros are also defined in vas.h, so either those should be
eventually replaced or the macros moved into bitops.h.

Signed-off-by: Russell Currey <ruscur@russell.cc>
[mpe: Rewrite the assignment to 'he' to avoid ffs() etc.]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Russell Currey and committed by
Michael Ellerman
8a792262 447808bf

+1 -7
-6
arch/powerpc/include/asm/xive-regs.h
··· 123 123 #define TM_QW3_NSR_I PPC_BIT8(2) 124 124 #define TM_QW3_NSR_GRP_LVL PPC_BIT8(3,7) 125 125 126 - /* Utilities to manipulate these (originaly from OPAL) */ 127 - #define MASK_TO_LSH(m) (__builtin_ffsl(m) - 1) 128 - #define GETFIELD(m, v) (((v) & (m)) >> MASK_TO_LSH(m)) 129 - #define SETFIELD(m, v, val) \ 130 - (((v) & ~(m)) | ((((typeof(v))(val)) << MASK_TO_LSH(m)) & (m))) 131 - 132 126 #endif /* _ASM_POWERPC_XIVE_REGS_H */
+1 -1
arch/powerpc/sysdev/xive/native.c
··· 341 341 * of the hypervisor interrupt (if any) 342 342 */ 343 343 cppr = ack & 0xff; 344 - he = GETFIELD(TM_QW3_NSR_HE, (ack >> 8)); 344 + he = (ack >> 8) >> 6; 345 345 switch(he) { 346 346 case TM_QW3_NSR_HE_NONE: /* Nothing to see here */ 347 347 break;