public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Len Brown <lenb@kernel.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-acpi@vger.kernel.org, Rene Herman <rene.herman@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Adam M Belay <abelay@mit.edu>
Cc: Li Shaohua <shaohua.li@intel.com>
Cc: Matthieu Castet <castet.matthieu@free.fr>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Rene Herman <rene.herman@keyaccess.nl>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [patch 14/28] PNP: introduce pnp_irq_mask_t typedef
Date: Fri, 27 Jun 2008 16:57:05 -0600	[thread overview]
Message-ID: <20080627225801.130475937@ldl.fc.hp.com> (raw)
In-Reply-To: 20080627225651.663174474@ldl.fc.hp.com

[-- Attachment #1: pnp-irq-bitmap-decl --]
[-- Type: text/plain, Size: 6939 bytes --]

This adds a typedef for the IRQ bitmap, which should cause
no functional change, but will make it easier to pass a
pointer to a bitmap to pnp_register_irq_resource().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Rene Herman <rene.herman@gmail.com>

Index: work14/drivers/pnp/base.h
===================================================================
--- work14.orig/drivers/pnp/base.h	2008-06-24 17:07:55.000000000 -0600
+++ work14/drivers/pnp/base.h	2008-06-24 17:07:55.000000000 -0600
@@ -30,8 +30,10 @@ struct pnp_port {
 };
 
 #define PNP_IRQ_NR 256
+typedef struct { DECLARE_BITMAP(bits, PNP_IRQ_NR); } pnp_irq_mask_t;
+
 struct pnp_irq {
-	DECLARE_BITMAP(map, PNP_IRQ_NR);	/* bitmask for IRQ lines */
+	pnp_irq_mask_t map;	/* bitmap for IRQ lines */
 	unsigned char flags;	/* IRQ flags */
 	unsigned char pad;	/* pad */
 	struct pnp_irq *next;	/* next IRQ */
Index: work14/drivers/pnp/resource.c
===================================================================
--- work14.orig/drivers/pnp/resource.c	2008-06-24 17:06:49.000000000 -0600
+++ work14/drivers/pnp/resource.c	2008-06-24 17:07:55.000000000 -0600
@@ -98,13 +98,13 @@ int pnp_register_irq_resource(struct pnp
 		int i;
 
 		for (i = 0; i < 16; i++)
-			if (test_bit(i, data->map))
+			if (test_bit(i, data->map.bits))
 				pcibios_penalize_isa_irq(i, 0);
 	}
 #endif
 
 #ifdef DEBUG
-	bitmap_scnprintf(buf, sizeof(buf), data->map, PNP_IRQ_NR);
+	bitmap_scnprintf(buf, sizeof(buf), data->map.bits, PNP_IRQ_NR);
 	dev_dbg(&dev->dev, "  irq bitmask %s flags %#x\n", buf,
 		data->flags);
 #endif
@@ -653,7 +653,7 @@ static int pnp_possible_option(struct pn
 		case IORESOURCE_IRQ:
 			for (irq = tmp->irq; irq; irq = irq->next) {
 				if (start < PNP_IRQ_NR &&
-				    test_bit(start, irq->map))
+				    test_bit(start, irq->map.bits))
 					return 1;
 			}
 			break;
Index: work14/drivers/pnp/manager.c
===================================================================
--- work14.orig/drivers/pnp/manager.c	2008-06-24 16:53:05.000000000 -0600
+++ work14/drivers/pnp/manager.c	2008-06-24 17:07:55.000000000 -0600
@@ -128,20 +128,20 @@ static int pnp_assign_irq(struct pnp_dev
 	res->start = -1;
 	res->end = -1;
 
-	if (bitmap_empty(rule->map, PNP_IRQ_NR)) {
+	if (bitmap_empty(rule->map.bits, PNP_IRQ_NR)) {
 		res->flags |= IORESOURCE_DISABLED;
 		dev_dbg(&dev->dev, "  irq %d disabled\n", idx);
 		goto __add;
 	}
 
 	/* TBD: need check for >16 IRQ */
-	res->start = find_next_bit(rule->map, PNP_IRQ_NR, 16);
+	res->start = find_next_bit(rule->map.bits, PNP_IRQ_NR, 16);
 	if (res->start < PNP_IRQ_NR) {
 		res->end = res->start;
 		goto __add;
 	}
 	for (i = 0; i < 16; i++) {
-		if (test_bit(xtab[i], rule->map)) {
+		if (test_bit(xtab[i], rule->map.bits)) {
 			res->start = res->end = xtab[i];
 			if (pnp_check_irq(dev, res))
 				goto __add;
Index: work14/drivers/pnp/interface.c
===================================================================
--- work14.orig/drivers/pnp/interface.c	2008-06-24 17:07:55.000000000 -0600
+++ work14/drivers/pnp/interface.c	2008-06-24 17:07:55.000000000 -0600
@@ -67,7 +67,7 @@ static void pnp_print_irq(pnp_info_buffe
 
 	pnp_printf(buffer, "%sirq ", space);
 	for (i = 0; i < PNP_IRQ_NR; i++)
-		if (test_bit(i, irq->map)) {
+		if (test_bit(i, irq->map.bits)) {
 			if (!first) {
 				pnp_printf(buffer, ",");
 			} else {
@@ -78,7 +78,7 @@ static void pnp_print_irq(pnp_info_buffe
 			else
 				pnp_printf(buffer, "%i", i);
 		}
-	if (bitmap_empty(irq->map, PNP_IRQ_NR))
+	if (bitmap_empty(irq->map.bits, PNP_IRQ_NR))
 		pnp_printf(buffer, "<none>");
 	if (irq->flags & IORESOURCE_IRQ_HIGHEDGE)
 		pnp_printf(buffer, " High-Edge");
Index: work14/drivers/pnp/isapnp/core.c
===================================================================
--- work14.orig/drivers/pnp/isapnp/core.c	2008-06-24 17:07:55.000000000 -0600
+++ work14/drivers/pnp/isapnp/core.c	2008-06-24 17:07:55.000000000 -0600
@@ -441,7 +441,7 @@ static void __init isapnp_parse_irq_reso
 	if (!irq)
 		return;
 	bits = (tmp[1] << 8) | tmp[0];
-	bitmap_copy(irq->map, &bits, 16);
+	bitmap_copy(irq->map.bits, &bits, 16);
 	if (size > 2)
 		irq->flags = tmp[2];
 	else
Index: work14/drivers/pnp/pnpacpi/rsparser.c
===================================================================
--- work14.orig/drivers/pnp/pnpacpi/rsparser.c	2008-06-24 17:07:55.000000000 -0600
+++ work14/drivers/pnp/pnpacpi/rsparser.c	2008-06-24 17:07:55.000000000 -0600
@@ -442,7 +442,7 @@ static __init void pnpacpi_parse_irq_opt
 
 	for (i = 0; i < p->interrupt_count; i++)
 		if (p->interrupts[i])
-			__set_bit(p->interrupts[i], irq->map);
+			__set_bit(p->interrupts[i], irq->map.bits);
 	irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);
 
 	pnp_register_irq_resource(dev, option, irq);
@@ -463,7 +463,7 @@ static __init void pnpacpi_parse_ext_irq
 
 	for (i = 0; i < p->interrupt_count; i++)
 		if (p->interrupts[i])
-			__set_bit(p->interrupts[i], irq->map);
+			__set_bit(p->interrupts[i], irq->map.bits);
 	irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);
 
 	pnp_register_irq_resource(dev, option, irq);
Index: work14/drivers/pnp/quirks.c
===================================================================
--- work14.orig/drivers/pnp/quirks.c	2008-06-24 16:53:05.000000000 -0600
+++ work14/drivers/pnp/quirks.c	2008-06-24 17:08:52.000000000 -0600
@@ -66,15 +66,18 @@ static void quirk_cmi8330_resources(stru
 		struct pnp_irq *irq;
 		struct pnp_dma *dma;
 
-		for (irq = res->irq; irq; irq = irq->next) {	// Valid irqs are 5, 7, 10
+		for (irq = res->irq; irq; irq = irq->next) {
+			/* Valid irqs are 5, 7, 10 */
 			tmp = 0x04A0;
-			bitmap_copy(irq->map, &tmp, 16);	// 0000 0100 1010 0000
+			bitmap_copy(irq->map.bits, &tmp, 16);
 		}
 
-		for (dma = res->dma; dma; dma = dma->next)	// Valid 8bit dma channels are 1,3
+		for (dma = res->dma; dma; dma = dma->next) {
+			/* Valid 8bit dma channels are 1,3 */
 			if ((dma->flags & IORESOURCE_DMA_TYPE_MASK) ==
 			    IORESOURCE_DMA_8BIT)
 				dma->map = 0x000A;
+		}
 	}
 	dev_info(&dev->dev, "CMI8330 quirk - forced possible IRQs to 5, 7, 10 "
 		"and DMA channels to 1, 3\n");
@@ -187,7 +190,7 @@ static void quirk_ad1815_mpu_resources(s
 		if (!copy)
 			break;
 
-		memcpy(copy->map, irq->map, sizeof copy->map);
+		bitmap_copy(copy->map.bits, irq->map.bits, PNP_IRQ_NR);
 		copy->flags = irq->flags;
 
 		copy->next = res->irq; /* Yes, this is NULL */
Index: work14/drivers/pnp/pnpbios/rsparser.c
===================================================================
--- work14.orig/drivers/pnp/pnpbios/rsparser.c	2008-06-24 17:07:55.000000000 -0600
+++ work14/drivers/pnp/pnpbios/rsparser.c	2008-06-24 17:07:55.000000000 -0600
@@ -275,7 +275,7 @@ static __init void pnpbios_parse_irq_opt
 	if (!irq)
 		return;
 	bits = (p[2] << 8) | p[1];
-	bitmap_copy(irq->map, &bits, 16);
+	bitmap_copy(irq->map.bits, &bits, 16);
 	if (size > 2)
 		irq->flags = p[3];
 	else

-- 

  parent reply	other threads:[~2008-06-27 23:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 22:56 [patch 00/28] PNP: convert fixed tables to lists, v4 Bjorn Helgaas
2008-06-27 22:56 ` [patch 01/28] PNP: add detail to debug resource dump Bjorn Helgaas
2008-06-27 22:56 ` [patch 02/28] PNP: remove pnp_resource.index Bjorn Helgaas
2008-06-27 22:56 ` [patch 03/28] PNP: add pnp_resource_type() internal interface Bjorn Helgaas
2008-06-27 22:56 ` [patch 04/28] PNP: add pnp_resource_type_name() helper function Bjorn Helgaas
2008-06-27 22:56 ` [patch 05/28] PNP: make pnp_{port,mem,etc}_start(), et al work for invalid resources Bjorn Helgaas
2008-06-27 22:56 ` [patch 06/28] PNP: replace pnp_resource_table with dynamically allocated resources Bjorn Helgaas
2008-06-27 22:56 ` [patch 07/28] PNPACPI: keep disabled resources when parsing current config Bjorn Helgaas
2008-06-27 22:56 ` [patch 08/28] PNP: remove ratelimit on add resource failures Bjorn Helgaas
2008-06-27 22:57 ` [patch 09/28] PNP: dont sort by type in /sys/.../resources Bjorn Helgaas
2008-06-27 22:57 ` [patch 10/28] PNP: add pnp_possible_config() -- can a device could be configured this way? Bjorn Helgaas
2008-06-27 22:57 ` [patch 11/28] PNP: whitespace/coding style fixes Bjorn Helgaas
2008-06-28 19:56   ` Joe Perches
2008-06-28 20:02     ` Rene Herman
2008-06-27 22:57 ` [patch 12/28] PNP: define PNP-specific IORESOURCE_IO_* flags alongside IRQ, DMA, MEM Bjorn Helgaas
2008-06-27 22:57 ` [patch 13/28] PNP: make resource option structures private to PNP subsystem Bjorn Helgaas
2008-06-27 22:57 ` Bjorn Helgaas [this message]
2008-06-27 22:57 ` [patch 15/28] PNP: increase I/O port & memory option address sizes Bjorn Helgaas
2008-06-27 22:57 ` [patch 16/28] PNP: improve resource assignment debug Bjorn Helgaas
2008-06-27 22:57 ` [patch 17/28] PNP: in debug resource dump, make empty list obvious Bjorn Helgaas
2008-06-27 22:57 ` [patch 18/28] PNP: make resource assignment functions return 0 (success) or -EBUSY (failure) Bjorn Helgaas
2008-06-27 22:57 ` [patch 19/28] PNP: remove redundant pnp_can_configure() check Bjorn Helgaas
2008-06-27 22:57 ` [patch 20/28] PNP: centralize resource option allocations Bjorn Helgaas
2008-06-27 22:57 ` [patch 21/28] PNPACPI: ignore _PRS interrupt numbers larger than PNP_IRQ_NR Bjorn Helgaas
2008-06-27 22:57 ` [patch 22/28] PNP: rename pnp_register_*_resource() local variables Bjorn Helgaas
2008-06-27 22:57 ` [patch 23/28] PNP: support optional IRQ resources Bjorn Helgaas
2008-06-27 22:57 ` [patch 24/28] PNP: remove extra 0x100 bit from option priority Bjorn Helgaas
2008-06-27 22:57 ` [patch 25/28] ISAPNP: handle independent options following dependent ones Bjorn Helgaas
2008-06-27 22:57 ` [patch 26/28] PNP: convert resource options to single linked list Bjorn Helgaas
2008-06-27 22:57 ` [patch 27/28] PNP: avoid legacy IDE IRQs Bjorn Helgaas
2008-06-27 22:57 ` [patch 28/28] PNPACPI: add support for HP vendor-specific CCSR descriptors Bjorn Helgaas
2008-06-28  4:36 ` [patch 00/28] PNP: convert fixed tables to lists, v4 Len Brown
  -- strict thread matches above, loose matches on Subject: below --
2008-06-17 22:58 [patch 00/28] PNP: convert fixed tables to lists, v3 Bjorn Helgaas
2008-06-17 22:58 ` [patch 14/28] PNP: introduce pnp_irq_mask_t typedef Bjorn Helgaas

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=20080627225801.130475937@ldl.fc.hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rene.herman@gmail.com \
    /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