public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Zwane Mwaikambo <zwane@linuxpower.ca>
Cc: Maciej <maciej@apathy.killer-robot.net>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][2.6] i386 /proc/irq/.../smp_affinity
Date: Thu, 11 Sep 2003 00:06:16 -0700	[thread overview]
Message-ID: <20030911070616.GT4306@holomorphy.com> (raw)
In-Reply-To: <Pine.LNX.4.53.0309101535050.9323@montezuma.fsmlabs.com>

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;

  parent reply	other threads:[~2003-09-11  7:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10 19:14 No IRQ balancing in 2.6.0-test5 Maciej
2003-09-11  1:55 ` [PATCH][2.6] i386 /proc/irq/.../smp_affinity Zwane Mwaikambo
2003-09-11  2:02   ` William Lee Irwin III
2003-09-11  2:07     ` Zwane Mwaikambo
2003-09-11  2:21       ` William Lee Irwin III
2003-09-11  7:06   ` William Lee Irwin III [this message]
2003-09-11 17:43   ` Maciej Babinski
2003-09-11 21:43     ` Zwane Mwaikambo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030911070616.GT4306@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej@apathy.killer-robot.net \
    --cc=zwane@linuxpower.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox