powerpc/xive: Remove (almost) unused macros
authorRussell Currey <ruscur@russell.cc>
Fri, 11 May 2018 08:03:13 +0000 (18:03 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 10:43:35 +0000 (20:43 +1000)
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>
arch/powerpc/include/asm/xive-regs.h
arch/powerpc/sysdev/xive/native.c

index fa4288822b681db4337ecc7461ea118d95e36f3f..6de989f8defd482924c4295cc3b377e6120682a3 100644 (file)
 #define TM_QW3_NSR_I           PPC_BIT8(2)
 #define TM_QW3_NSR_GRP_LVL     PPC_BIT8(3,7)
 
-/* Utilities to manipulate these (originaly from OPAL) */
-#define MASK_TO_LSH(m)         (__builtin_ffsl(m) - 1)
-#define GETFIELD(m, v)         (((v) & (m)) >> MASK_TO_LSH(m))
-#define SETFIELD(m, v, val)                            \
-       (((v) & ~(m)) | ((((typeof(v))(val)) << MASK_TO_LSH(m)) & (m)))
-
 #endif /* _ASM_POWERPC_XIVE_REGS_H */
index b48454be5b9822fdd1ac75452edf20a988745e5b..83bcd72b21cf7820a6da70698eb1c8e6bf49ae09 100644 (file)
@@ -341,7 +341,7 @@ static void xive_native_update_pending(struct xive_cpu *xc)
         * of the hypervisor interrupt (if any)
         */
        cppr = ack & 0xff;
-       he = GETFIELD(TM_QW3_NSR_HE, (ack >> 8));
+       he = (ack >> 8) >> 6;
        switch(he) {
        case TM_QW3_NSR_HE_NONE: /* Nothing to see here */
                break;