mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: perfctr-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: perfctr-2.6.1 build fix for amd64 in 2.6 SMP kernels
Date: Tue, 7 Oct 2003 23:23:06 +0200	[thread overview]
Message-ID: <16259.11962.872427.626426@gargle.gargle.HOWL> (raw)

This patch for perfctr-2.6.1 fixes a problem which causes a
compilation error for amd64 (aka x86-64) in 2.6 SMP kernels.

The problem is that cpu_isset(cpu,mask) requires that mask
is an lvalue (it uses test_bit()), but on amd64 I want to
pass in a constant (the mask is always empty). Oops.

Thanks to Bryan O'Sullivan for reporting the build error.

/Mikael

--- perfctr-2.6.1/linux/drivers/perfctr/cpumask.h.~1~	2003-09-07 22:15:38.000000000 +0200
+++ perfctr-2.6.1/linux/drivers/perfctr/cpumask.h	2003-10-07 20:19:52.000000000 +0200
@@ -38,6 +38,8 @@
    but cpumask_t compatibility issues forced it to be moved here. */
 #if PERFCTR_CPUS_FORBIDDEN_MASK_NEEDED
 extern cpumask_t perfctr_cpus_forbidden_mask;
+#define perfctr_cpu_is_forbidden(cpu)	cpu_isset((cpu), perfctr_cpus_forbidden_mask)
 #else
 #define perfctr_cpus_forbidden_mask	CPU_MASK_NONE
+#define perfctr_cpu_is_forbidden(cpu)	0 /* cpu_isset() needs an lvalue :-( */
 #endif
--- perfctr-2.6.1/linux/drivers/perfctr/global.c.~1~	2003-10-02 22:04:35.000000000 +0200
+++ perfctr-2.6.1/linux/drivers/perfctr/global.c	2003-10-07 20:19:52.000000000 +0200
@@ -138,7 +138,7 @@
 		return ret;
 	if( cpu_control.cpu >= NR_CPUS ||
 	    !cpu_online(cpu_control.cpu) ||
-	    cpu_isset(cpu_control.cpu, perfctr_cpus_forbidden_mask) )
+	    perfctr_cpu_is_forbidden(cpu_control.cpu) )
 		return -EINVAL;
 	/* we don't permit i-mode counters */
 	if( cpu_control.cpu_control.nrictrs != 0 )

                 reply	other threads:[~2003-10-07 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=16259.11962.872427.626426@gargle.gargle.HOWL \
    --to=mikpe@csd.uu.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perfctr-devel@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®