Messages in this thread Patch in this message | | | Date | Thu, 11 Sep 2003 00:06:16 -0700 | From | William Lee Irwin III <> | Subject | Re: [PATCH][2.6] i386 /proc/irq/.../smp_affinity |
| |
On Wed, Sep 10, 2003 at 09:55:03PM -0400, Zwane Mwaikambo wrote: > - len = 0; > - for (k = 0; k < sizeof(cpumask_t)/sizeof(u16); ++k) { > - int j = sprintf(page, "%04hx", (u16)cpus_coerce(tmp)); > - len += j; > - page += j; > - cpus_shift_right(tmp, tmp, 16); > - } > - len += sprintf(page, "\n"); > - return len; > + return sprintf(page, "%08x\n", (u32)cpus_coerce(tmp)); > }
Something like this (totally untested) might be better:
===== arch/i386/kernel/irq.c 1.39 vs edited ===== --- 1.39/arch/i386/kernel/irq.c Mon Aug 18 19:46:23 2003 +++ edited/arch/i386/kernel/irq.c Thu Sep 11 00:01:31 2003 @@ -939,17 +939,19 @@ int count, int *eof, void *data) { int k, len; - cpumask_t tmp = irq_affinity[(long)data]; if (count < HEX_DIGITS+1) return -EINVAL; len = 0; for (k = 0; k < sizeof(cpumask_t)/sizeof(u16); ++k) { - int j = sprintf(page, "%04hx", (u16)cpus_coerce(tmp)); + cpumask_t tmp; + int j, shift = sizeof(cpumask_t)/sizeof(u16) - k - 1; + + cpus_shift_right(tmp, irq_affinity[(long)data], 16*shift); + j = sprintf(page, "%04hx", (u16)cpus_coerce(tmp)); len += j; page += j; - cpus_shift_right(tmp, tmp, 16); } len += sprintf(page, "\n"); return len; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |