+ ieee1394-add-preprocessor-constant-for-invalid-csr.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     ieee1394: add preprocessor constant for invalid csr address

has been added to the -mm tree.  Its filename is

     ieee1394-add-preprocessor-constant-for-invalid-csr.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: ieee1394: add preprocessor constant for invalid csr address
From: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>


Replace occurrences of the magic value ~(u64)0 for invalid CSR address
spaces by a named constant for better readability.

Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
Cc: Jody McIntyre <scjody@xxxxxxxxxxxxxx>
Cc: Ben Collins <bcollins@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/ieee1394/csr1212.c   |    2 +-
 drivers/ieee1394/csr1212.h   |    1 +
 drivers/ieee1394/eth1394.c   |   16 +++++++---------
 drivers/ieee1394/eth1394.h   |    2 --
 drivers/ieee1394/highlevel.c |    9 +++++----
 drivers/ieee1394/sbp2.c      |    8 ++++----
 6 files changed, 18 insertions(+), 20 deletions(-)

diff -puN drivers/ieee1394/csr1212.c~ieee1394-add-preprocessor-constant-for-invalid-csr drivers/ieee1394/csr1212.c
--- devel/drivers/ieee1394/csr1212.c~ieee1394-add-preprocessor-constant-for-invalid-csr	2006-06-03 17:17:57.000000000 -0700
+++ devel-akpm/drivers/ieee1394/csr1212.c	2006-06-03 17:17:57.000000000 -0700
@@ -779,7 +779,7 @@ static int csr1212_append_new_cache(stru
 	romsize = (romsize + (csr->max_rom - 1)) & ~(csr->max_rom - 1);
 
 	csr_addr = csr->ops->allocate_addr_range(romsize, csr->max_rom, csr->private);
-	if (csr_addr == ~0ULL) {
+	if (csr_addr == CSR1212_INVALID_ADDR_SPACE) {
 		return CSR1212_ENOMEM;
 	}
 	if (csr_addr < CSR1212_REGISTER_SPACE_BASE) {
diff -puN drivers/ieee1394/csr1212.h~ieee1394-add-preprocessor-constant-for-invalid-csr drivers/ieee1394/csr1212.h
--- devel/drivers/ieee1394/csr1212.h~ieee1394-add-preprocessor-constant-for-invalid-csr	2006-06-03 17:17:57.000000000 -0700
+++ devel-akpm/drivers/ieee1394/csr1212.h	2006-06-03 17:17:57.000000000 -0700
@@ -192,6 +192,7 @@
 
 #define  CSR1212_EXTENDED_ROM_SIZE		(0x10000 * sizeof(u_int32_t))
 
+#define  CSR1212_INVALID_ADDR_SPACE		-1
 
 /* Config ROM image structures */
 struct csr1212_bus_info_block_img {
diff -puN drivers/ieee1394/eth1394.c~ieee1394-add-preprocessor-constant-for-invalid-csr drivers/ieee1394/eth1394.c
--- devel/drivers/ieee1394/eth1394.c~ieee1394-add-preprocessor-constant-for-invalid-csr	2006-06-03 17:17:57.000000000 -0700
+++ devel-akpm/drivers/ieee1394/eth1394.c	2006-06-03 17:17:57.000000000 -0700
@@ -367,7 +367,7 @@ static int eth1394_probe(struct device *
 	spin_lock_init(&node_info->pdg.lock);
 	INIT_LIST_HEAD(&node_info->pdg.list);
 	node_info->pdg.sz = 0;
-	node_info->fifo = ETHER1394_INVALID_ADDR;
+	node_info->fifo = CSR1212_INVALID_ADDR_SPACE;
 
 	ud->device.driver_data = node_info;
 	new_node->ud = ud;
@@ -566,13 +566,11 @@ static void ether1394_add_host (struct h
 	if (!(host->config_roms & HPSB_CONFIG_ROM_ENTRY_IP1394))
 		return;
 
-	fifo_addr = hpsb_allocate_and_register_addrspace(&eth1394_highlevel,
-							 host,
-							 &addr_ops,
-							 ETHER1394_REGION_ADDR_LEN,
-							 ETHER1394_REGION_ADDR_LEN,
-							 -1, -1);
-	if (fifo_addr == ~0ULL)
+	fifo_addr = hpsb_allocate_and_register_addrspace(
+			&eth1394_highlevel, host, &addr_ops,
+			ETHER1394_REGION_ADDR_LEN, ETHER1394_REGION_ADDR_LEN,
+			CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE);
+	if (fifo_addr == CSR1212_INVALID_ADDR_SPACE)
 		goto out;
 
 	/* We should really have our own alloc_hpsbdev() function in
@@ -1686,7 +1684,7 @@ static int ether1394_tx (struct sk_buff 
 			goto fail;
 		}
 		node_info = (struct eth1394_node_info*)node->ud->device.driver_data;
-		if (node_info->fifo == ETHER1394_INVALID_ADDR) {
+		if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) {
 			ret = -EAGAIN;
 			goto fail;
 		}
diff -puN drivers/ieee1394/eth1394.h~ieee1394-add-preprocessor-constant-for-invalid-csr drivers/ieee1394/eth1394.h
--- devel/drivers/ieee1394/eth1394.h~ieee1394-add-preprocessor-constant-for-invalid-csr	2006-06-03 17:17:57.000000000 -0700
+++ devel-akpm/drivers/ieee1394/eth1394.h	2006-06-03 17:17:57.000000000 -0700
@@ -32,8 +32,6 @@
  * S3200 (per Table 16-3 of IEEE 1394b-2002). */
 #define ETHER1394_REGION_ADDR_LEN	4096
 
-#define ETHER1394_INVALID_ADDR		~0ULL
-
 /* GASP identifier numbers for IPv4 over IEEE 1394 */
 #define ETHER1394_GASP_SPECIFIER_ID	0x00005E
 #define ETHER1394_GASP_SPECIFIER_ID_HI	((ETHER1394_GASP_SPECIFIER_ID >> 8) & 0xffff)
diff -puN drivers/ieee1394/highlevel.c~ieee1394-add-preprocessor-constant-for-invalid-csr drivers/ieee1394/highlevel.c
--- devel/drivers/ieee1394/highlevel.c~ieee1394-add-preprocessor-constant-for-invalid-csr	2006-06-03 17:17:57.000000000 -0700
+++ devel-akpm/drivers/ieee1394/highlevel.c	2006-06-03 17:17:57.000000000 -0700
@@ -301,7 +301,7 @@ u64 hpsb_allocate_and_register_addrspace
 {
 	struct hpsb_address_serve *as, *a1, *a2;
 	struct list_head *entry;
-	u64 retval = ~0ULL;
+	u64 retval = CSR1212_INVALID_ADDR_SPACE;
 	unsigned long flags;
 	u64 align_mask = ~(alignment - 1);
 
@@ -314,9 +314,10 @@ u64 hpsb_allocate_and_register_addrspace
 
 	/* default range,
 	 * avoids controller's posted write area (see OHCI 1.1 clause 1.5) */
-	if (start == ~0ULL && end == ~0ULL) {
+	if (start == CSR1212_INVALID_ADDR_SPACE &&
+	    end   == CSR1212_INVALID_ADDR_SPACE) {
 		start = host->middle_addr_space;
-		end = CSR1212_ALL_SPACE_END;
+		end   = CSR1212_ALL_SPACE_END;
 	}
 
 	if (((start|end) & ~align_mask) || (start >= end) || (end > 0x1000000000000ULL)) {
@@ -360,7 +361,7 @@ u64 hpsb_allocate_and_register_addrspace
 
 	write_unlock_irqrestore(&addr_space_lock, flags);
 
-	if (retval == ~0ULL) {
+	if (retval == CSR1212_INVALID_ADDR_SPACE) {
 		kfree(as);
 	}
 
diff -puN drivers/ieee1394/sbp2.c~ieee1394-add-preprocessor-constant-for-invalid-csr drivers/ieee1394/sbp2.c
--- devel/drivers/ieee1394/sbp2.c~ieee1394-add-preprocessor-constant-for-invalid-csr	2006-06-03 17:17:57.000000000 -0700
+++ devel-akpm/drivers/ieee1394/sbp2.c	2006-06-03 17:17:57.000000000 -0700
@@ -794,7 +794,7 @@ static struct scsi_id_instance_data *sbp
 	scsi_id->ud = ud;
 	scsi_id->speed_code = IEEE1394_SPEED_100;
 	scsi_id->max_payload_size = sbp2_speedto_max_payload[IEEE1394_SPEED_100];
-	scsi_id->status_fifo_addr = ~0ULL;
+	scsi_id->status_fifo_addr = CSR1212_INVALID_ADDR_SPACE;
 	atomic_set(&scsi_id->sbp2_login_complete, 0);
 	INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_inuse);
 	INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_completed);
@@ -848,7 +848,7 @@ static struct scsi_id_instance_data *sbp
 			&sbp2_highlevel, ud->ne->host, &sbp2_ops,
 			sizeof(struct sbp2_status_block), sizeof(quadlet_t),
 			ud->ne->host->low_addr_space, CSR1212_ALL_SPACE_END);
-	if (scsi_id->status_fifo_addr == ~0ULL) {
+	if (scsi_id->status_fifo_addr == CSR1212_INVALID_ADDR_SPACE) {
 		SBP2_ERR("failed to allocate status FIFO address range");
 		goto failed_alloc;
 	}
@@ -1090,9 +1090,9 @@ static void sbp2_remove_device(struct sc
 		SBP2_DMA_FREE("single query logins data");
 	}
 
-	if (scsi_id->status_fifo_addr != ~0ULL)
+	if (scsi_id->status_fifo_addr != CSR1212_INVALID_ADDR_SPACE)
 		hpsb_unregister_addrspace(&sbp2_highlevel, hi->host,
-			scsi_id->status_fifo_addr);
+					  scsi_id->status_fifo_addr);
 
 	scsi_id->ud->device.driver_data = NULL;
 
_

Patches currently in -mm which might be from stefanr@xxxxxxxxxxxxxxxxx are

sbp2-fix-check-of-return-value-of.patch
ieee1394-ohci1394c-function-calls-without.patch
ieee1394-sbp2-make-tsb42aa9-workaround-specific.patch
ieee1394-raw1394-fix-whitespace-after-x86_64.patch
ieee1394-ieee1394-ohci1394-cycletoolong.patch
ieee1394-ieee1394-support-for-slow-links-or-slow.patch
ieee1394-ieee1394-save-ram-by-using-a-single.patch
ieee1394-sbp2-remove-manipulation-of-inquiry.patch
ieee1394-sbp2-log-number-of-supported-concurrent.patch
ieee1394-ieee1394-extend-lowlevel-api-for.patch
ieee1394-ohci1394-set-address-range-properties.patch
ieee1394-ohci1394-make-phys_dma-parameter.patch
ieee1394-sbp2-sbp2-remove-ohci1394-specific.patch
ieee1394-sbp2-fix-s800-transfers-if-phys_dma-is.patch
ieee1394-update-feature-removal-of-obsolete.patch
ieee1394-sbp2-provide-helptext-for.patch
ieee1394-sbp2-kconfig-fix.patch
ieee1394-sbp2-use-__attribute__packed-for.patch
ieee1394-speed-up-of-dma_region_sync_for_cpu.patch
ieee1394-sbp2-fix-deregistration-of-status-fifo-address-space.patch
ieee1394-add-preprocessor-constant-for-invalid-csr.patch
ieee1394_core-switch-to-kthread-api.patch
eth1394-endian-fixes.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux