LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [patch 13/24] rapidio: add RapidIO node into MPC8641HPCN dts file
From: akpm @ 2008-03-28 21:21 UTC (permalink / raw)
  To: paulus; +Cc: akpm, linuxppc-dev

From: Zhang Wei <wei.zhang@freescale.com>

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff -puN arch/powerpc/boot/dts/mpc8641_hpcn.dts~rapidio-add-rapidio-node-into-mpc8641hpcn-dts-file arch/powerpc/boot/dts/mpc8641_hpcn.dts
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts~rapidio-add-rapidio-node-into-mpc8641hpcn-dts-file
+++ a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -26,6 +26,7 @@
 		serial1 = &serial1;
 		pci0 = &pci0;
 		pci1 = &pci1;
+		rapidio0 = &rapidio0;
 	};
 
 	cpus {
@@ -500,4 +501,15 @@
 				  0x0 0x00100000>;
 		};
 	};
+	rapidio0: rapidio@f80c0000 {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		compatible = "fsl,rapidio-delta";
+		reg = <0xf80c0000 0x20000>;
+		ranges = <0 0 0xc0000000 0 0x20000000>;
+		interrupt-parent = <&mpic>;
+		/* err_irq bell_outb_irq bell_inb_irq
+			msg1_tx_irq msg1_rx_irq	msg2_tx_irq msg2_rx_irq */
+		interrupts = <48 2 49 2 50 2 53 2 54 2 55 2 56 2>;
+	};
 };
_

^ permalink raw reply

* [patch 14/24] rapidio: add RapidIO node probing into MPC86xx_HPCN board id table
From: akpm @ 2008-03-28 21:21 UTC (permalink / raw)
  To: paulus; +Cc: akpm, linuxppc-dev

From: Zhang Wei <wei.zhang@freescale.com>

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN arch/powerpc/platforms/86xx/mpc86xx_hpcn.c~rapidio-add-rapidio-node-probing-into-mpc86xx_hpcn-board-id-table arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c~rapidio-add-rapidio-node-probing-into-mpc86xx_hpcn-board-id-table
+++ a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -215,6 +215,7 @@ mpc86xx_time_init(void)
 
 static __initdata struct of_device_id of_bus_ids[] = {
 	{ .compatible = "simple-bus", },
+	{ .compatible = "fsl,rapidio-delta", },
 	{},
 };
 
_

^ permalink raw reply

* [patch 01/24] powerpc: replace remaining __FUNCTION__ occurrences
From: akpm @ 2008-03-28 21:21 UTC (permalink / raw)
  To: paulus; +Cc: akpm, harvey.harrison, linuxppc-dev

From: Harvey Harrison <harvey.harrison@gmail.com>

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/boot/libfdt-wrapper.c                |    2 
 arch/powerpc/kernel/ibmebus.c                     |   12 ++--
 arch/powerpc/kernel/iommu.c                       |    4 -
 arch/powerpc/kernel/isa-bridge.c                  |    2 
 arch/powerpc/kernel/lparcfg.c                     |   12 ++--
 arch/powerpc/kernel/rtas.c                        |    2 
 arch/powerpc/kernel/rtas_flash.c                  |    2 
 arch/powerpc/kernel/rtas_pci.c                    |   10 +--
 arch/powerpc/kernel/vio.c                         |   10 +--
 arch/powerpc/math-emu/fabs.c                      |    2 
 arch/powerpc/math-emu/fadd.c                      |    2 
 arch/powerpc/math-emu/fadds.c                     |    2 
 arch/powerpc/math-emu/fcmpo.c                     |    2 
 arch/powerpc/math-emu/fcmpu.c                     |    2 
 arch/powerpc/math-emu/fctiw.c                     |    2 
 arch/powerpc/math-emu/fctiwz.c                    |    2 
 arch/powerpc/math-emu/fdiv.c                      |    6 +-
 arch/powerpc/math-emu/fdivs.c                     |    6 +-
 arch/powerpc/math-emu/fmadd.c                     |    2 
 arch/powerpc/math-emu/fmadds.c                    |    2 
 arch/powerpc/math-emu/fmr.c                       |    2 
 arch/powerpc/math-emu/fmsub.c                     |    2 
 arch/powerpc/math-emu/fmsubs.c                    |    2 
 arch/powerpc/math-emu/fmul.c                      |    2 
 arch/powerpc/math-emu/fmuls.c                     |    2 
 arch/powerpc/math-emu/fnabs.c                     |    2 
 arch/powerpc/math-emu/fneg.c                      |    2 
 arch/powerpc/math-emu/fnmadd.c                    |    2 
 arch/powerpc/math-emu/fnmadds.c                   |    2 
 arch/powerpc/math-emu/fnmsub.c                    |    2 
 arch/powerpc/math-emu/fnmsubs.c                   |    2 
 arch/powerpc/math-emu/fres.c                      |    2 
 arch/powerpc/math-emu/frsp.c                      |    2 
 arch/powerpc/math-emu/frsqrte.c                   |    2 
 arch/powerpc/math-emu/fsel.c                      |    2 
 arch/powerpc/math-emu/fsqrt.c                     |    2 
 arch/powerpc/math-emu/fsqrts.c                    |    2 
 arch/powerpc/math-emu/fsub.c                      |    2 
 arch/powerpc/math-emu/fsubs.c                     |    2 
 arch/powerpc/math-emu/lfd.c                       |    2 
 arch/powerpc/math-emu/lfs.c                       |    2 
 arch/powerpc/math-emu/mcrfs.c                     |    4 -
 arch/powerpc/math-emu/mffs.c                      |    2 
 arch/powerpc/math-emu/mtfsb0.c                    |    2 
 arch/powerpc/math-emu/mtfsb1.c                    |    2 
 arch/powerpc/math-emu/mtfsf.c                     |    2 
 arch/powerpc/math-emu/mtfsfi.c                    |    2 
 arch/powerpc/math-emu/stfd.c                      |    2 
 arch/powerpc/math-emu/stfiwx.c                    |    2 
 arch/powerpc/math-emu/stfs.c                      |    2 
 arch/powerpc/mm/init_32.c                         |    2 
 arch/powerpc/mm/init_64.c                         |    2 
 arch/powerpc/oprofile/cell/spu_task_sync.c        |   12 ++--
 arch/powerpc/oprofile/cell/vma_map.c              |   10 +--
 arch/powerpc/oprofile/op_model_cell.c             |   14 ++---
 arch/powerpc/platforms/52xx/lite5200.c            |    4 -
 arch/powerpc/platforms/85xx/mpc85xx_ds.c          |    2 
 arch/powerpc/platforms/cell/iommu.c               |    8 +--
 arch/powerpc/platforms/cell/pervasive.c           |    2 
 arch/powerpc/platforms/cell/ras.c                 |   10 +--
 arch/powerpc/platforms/cell/spu_base.c            |    8 +--
 arch/powerpc/platforms/cell/spu_callbacks.c       |    2 
 arch/powerpc/platforms/cell/spu_manage.c          |    8 +--
 arch/powerpc/platforms/cell/spufs/file.c          |    4 -
 arch/powerpc/platforms/cell/spufs/run.c           |   10 +--
 arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c |   10 +--
 arch/powerpc/platforms/ps3/setup.c                |    2 
 arch/powerpc/platforms/pseries/pci_dlpar.c        |    2 
 arch/powerpc/platforms/pseries/reconfig.c         |   12 ++--
 arch/powerpc/sysdev/cpm1.c                        |    2 
 arch/powerpc/sysdev/cpm2.c                        |    2 
 arch/powerpc/sysdev/qe_lib/qe_io.c                |    2 
 arch/powerpc/sysdev/qe_lib/ucc_fast.c             |   32 ++++++------
 arch/powerpc/sysdev/qe_lib/ucc_slow.c             |   18 +++---
 arch/powerpc/sysdev/tsi108_dev.c                  |    4 -
 arch/powerpc/sysdev/tsi108_pci.c                  |    4 -
 76 files changed, 168 insertions(+), 168 deletions(-)

diff -puN arch/powerpc/boot/libfdt-wrapper.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/boot/libfdt-wrapper.c
--- a/arch/powerpc/boot/libfdt-wrapper.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/boot/libfdt-wrapper.c
@@ -35,7 +35,7 @@
 #define check_err(err) \
 	({ \
 		if (BAD_ERROR(err) || ((err < 0) && DEBUG)) \
-			printf("%s():%d  %s\n\r", __FUNCTION__, __LINE__, \
+			printf("%s():%d  %s\n\r", __func__, __LINE__, \
 			       fdt_strerror(err)); \
 		if (BAD_ERROR(err)) \
 			exit(); \
diff -puN arch/powerpc/kernel/ibmebus.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/ibmebus.c
--- a/arch/powerpc/kernel/ibmebus.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/ibmebus.c
@@ -183,7 +183,7 @@ static int ibmebus_create_devices(const 
 		ret = ibmebus_create_device(child);
 		if (ret) {
 			printk(KERN_ERR "%s: failed to create device (%i)",
-			       __FUNCTION__, ret);
+			       __func__, ret);
 			of_node_put(child);
 			break;
 		}
@@ -269,7 +269,7 @@ static ssize_t ibmebus_store_probe(struc
 	if (bus_find_device(&ibmebus_bus_type, NULL, path,
 			    ibmebus_match_path)) {
 		printk(KERN_WARNING "%s: %s has already been probed\n",
-		       __FUNCTION__, path);
+		       __func__, path);
 		rc = -EEXIST;
 		goto out;
 	}
@@ -279,7 +279,7 @@ static ssize_t ibmebus_store_probe(struc
 		of_node_put(dn);
 	} else {
 		printk(KERN_WARNING "%s: no such device node: %s\n",
-		       __FUNCTION__, path);
+		       __func__, path);
 		rc = -ENODEV;
 	}
 
@@ -308,7 +308,7 @@ static ssize_t ibmebus_store_remove(stru
 		return count;
 	} else {
 		printk(KERN_WARNING "%s: %s not on the bus\n",
-		       __FUNCTION__, path);
+		       __func__, path);
 
 		kfree(path);
 		return -ENODEV;
@@ -337,14 +337,14 @@ static int __init ibmebus_bus_init(void)
 	err = of_bus_type_init(&ibmebus_bus_type, "ibmebus");
 	if (err) {
 		printk(KERN_ERR "%s: failed to register IBM eBus.\n",
-		       __FUNCTION__);
+		       __func__);
 		return err;
 	}
 
 	err = device_register(&ibmebus_bus_device);
 	if (err) {
 		printk(KERN_WARNING "%s: device_register returned %i\n",
-		       __FUNCTION__, err);
+		       __func__, err);
 		bus_unregister(&ibmebus_bus_type);
 
 		return err;
diff -puN arch/powerpc/kernel/iommu.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/iommu.c
--- a/arch/powerpc/kernel/iommu.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/iommu.c
@@ -520,7 +520,7 @@ void iommu_free_table(struct iommu_table
 	unsigned int order;
 
 	if (!tbl || !tbl->it_map) {
-		printk(KERN_ERR "%s: expected TCE map for %s\n", __FUNCTION__,
+		printk(KERN_ERR "%s: expected TCE map for %s\n", __func__,
 				node_name);
 		return;
 	}
@@ -530,7 +530,7 @@ void iommu_free_table(struct iommu_table
 	for (i = 0; i < (tbl->it_size/64); i++) {
 		if (tbl->it_map[i] != 0) {
 			printk(KERN_WARNING "%s: Unexpected TCEs for %s\n",
-				__FUNCTION__, node_name);
+				__func__, node_name);
 			break;
 		}
 	}
diff -puN arch/powerpc/kernel/isa-bridge.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/isa-bridge.c
--- a/arch/powerpc/kernel/isa-bridge.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/isa-bridge.c
@@ -99,7 +99,7 @@ static void __devinit pci_process_ISA_OF
 	 */
 	if ((pci_addr != 0) || (isa_addr != 0)) {
 		printk(KERN_ERR "unexpected isa to pci mapping: %s\n",
-		       __FUNCTION__);
+		       __func__);
 		return;
 	}
 
diff -puN arch/powerpc/kernel/lparcfg.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/lparcfg.c
--- a/arch/powerpc/kernel/lparcfg.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/lparcfg.c
@@ -226,7 +226,7 @@ static void parse_system_parameter_strin
 	unsigned char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
 	if (!local_buffer) {
 		printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
-		       __FILE__, __FUNCTION__, __LINE__);
+		       __FILE__, __func__, __LINE__);
 		return;
 	}
 
@@ -243,14 +243,14 @@ static void parse_system_parameter_strin
 	if (call_status != 0) {
 		printk(KERN_INFO
 		       "%s %s Error calling get-system-parameter (0x%x)\n",
-		       __FILE__, __FUNCTION__, call_status);
+		       __FILE__, __func__, call_status);
 	} else {
 		int splpar_strlen;
 		int idx, w_idx;
 		char *workbuffer = kzalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
 		if (!workbuffer) {
 			printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
-			       __FILE__, __FUNCTION__, __LINE__);
+			       __FILE__, __func__, __LINE__);
 			kfree(local_buffer);
 			return;
 		}
@@ -484,10 +484,10 @@ static ssize_t lparcfg_write(struct file
 	current_weight = (resource >> 5 * 8) & 0xFF;
 
 	pr_debug("%s: current_entitled = %lu, current_weight = %u\n",
-		 __FUNCTION__, current_entitled, current_weight);
+		 __func__, current_entitled, current_weight);
 
 	pr_debug("%s: new_entitled = %lu, new_weight = %u\n",
-		 __FUNCTION__, *new_entitled_ptr, *new_weight_ptr);
+		 __func__, *new_entitled_ptr, *new_weight_ptr);
 
 	retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
 				    *new_weight_ptr);
@@ -502,7 +502,7 @@ static ssize_t lparcfg_write(struct file
 		retval = -EINVAL;
 	} else {
 		printk(KERN_WARNING "%s: received unknown hv return code %ld",
-		       __FUNCTION__, retval);
+		       __func__, retval);
 		retval = -EIO;
 	}
 
diff -puN arch/powerpc/kernel/rtas.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/rtas.c
--- a/arch/powerpc/kernel/rtas.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/rtas.c
@@ -507,7 +507,7 @@ int rtas_error_rc(int rtas_rc)
 			break;
 		default:
 			printk(KERN_ERR "%s: unexpected RTAS error %d\n",
-					__FUNCTION__, rtas_rc);
+					__func__, rtas_rc);
 			rc = -ERANGE;
 			break;
 	}
diff -puN arch/powerpc/kernel/rtas_flash.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/rtas_flash.c
--- a/arch/powerpc/kernel/rtas_flash.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/rtas_flash.c
@@ -807,7 +807,7 @@ int __init rtas_flash_init(void)
 				rtas_block_ctor);
 	if (!flash_block_cache) {
 		printk(KERN_ERR "%s: failed to create block cache\n",
-				__FUNCTION__);
+				__func__);
 		rc = -ENOMEM;
 		goto cleanup;
 	}
diff -puN arch/powerpc/kernel/rtas_pci.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/rtas_pci.c
--- a/arch/powerpc/kernel/rtas_pci.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/rtas_pci.c
@@ -326,7 +326,7 @@ int pcibios_remove_root_bus(struct pci_c
 
 	res = b->resource[0];
 	if (!res->flags) {
-		printk(KERN_ERR "%s: no IO resource for PHB %s\n", __FUNCTION__,
+		printk(KERN_ERR "%s: no IO resource for PHB %s\n", __func__,
 				b->name);
 		return 1;
 	}
@@ -334,13 +334,13 @@ int pcibios_remove_root_bus(struct pci_c
 	rc = pcibios_unmap_io_space(b);
 	if (rc) {
 		printk(KERN_ERR "%s: failed to unmap IO on bus %s\n",
-			__FUNCTION__, b->name);
+			__func__, b->name);
 		return 1;
 	}
 
 	if (release_resource(res)) {
 		printk(KERN_ERR "%s: failed to release IO on bus %s\n",
-				__FUNCTION__, b->name);
+				__func__, b->name);
 		return 1;
 	}
 
@@ -348,13 +348,13 @@ int pcibios_remove_root_bus(struct pci_c
 		res = b->resource[i];
 		if (!res->flags && i == 0) {
 			printk(KERN_ERR "%s: no MEM resource for PHB %s\n",
-				__FUNCTION__, b->name);
+				__func__, b->name);
 			return 1;
 		}
 		if (res->flags && release_resource(res)) {
 			printk(KERN_ERR
 			       "%s: failed to release IO %d on bus %s\n",
-				__FUNCTION__, i, b->name);
+				__func__, i, b->name);
 			return 1;
 		}
 	}
diff -puN arch/powerpc/kernel/vio.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/kernel/vio.c
--- a/arch/powerpc/kernel/vio.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/kernel/vio.c
@@ -139,7 +139,7 @@ static int vio_bus_remove(struct device 
  */
 int vio_register_driver(struct vio_driver *viodrv)
 {
-	printk(KERN_DEBUG "%s: driver %s registering\n", __FUNCTION__,
+	printk(KERN_DEBUG "%s: driver %s registering\n", __func__,
 		viodrv->driver.name);
 
 	/* fill in 'struct driver' fields */
@@ -184,7 +184,7 @@ struct vio_dev *vio_register_device_node
 	/* we need the 'device_type' property, in order to match with drivers */
 	if (of_node->type == NULL) {
 		printk(KERN_WARNING "%s: node %s missing 'device_type'\n",
-				__FUNCTION__,
+				__func__,
 				of_node->name ? of_node->name : "<unknown>");
 		return NULL;
 	}
@@ -192,7 +192,7 @@ struct vio_dev *vio_register_device_node
 	unit_address = of_get_property(of_node, "reg", NULL);
 	if (unit_address == NULL) {
 		printk(KERN_WARNING "%s: node %s missing 'reg'\n",
-				__FUNCTION__,
+				__func__,
 				of_node->name ? of_node->name : "<unknown>");
 		return NULL;
 	}
@@ -227,7 +227,7 @@ struct vio_dev *vio_register_device_node
 	/* register with generic device framework */
 	if (device_register(&viodev->dev)) {
 		printk(KERN_ERR "%s: failed to register device %s\n",
-				__FUNCTION__, viodev->dev.bus_id);
+				__func__, viodev->dev.bus_id);
 		/* XXX free TCE table */
 		kfree(viodev);
 		return NULL;
@@ -258,7 +258,7 @@ static int __init vio_bus_init(void)
 	err = device_register(&vio_bus_device.dev);
 	if (err) {
 		printk(KERN_WARNING "%s: device_register returned %i\n",
-				__FUNCTION__, err);
+				__func__, err);
 		return err;
 	}
 
diff -puN arch/powerpc/math-emu/fabs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fabs.c
--- a/arch/powerpc/math-emu/fabs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fabs.c
@@ -9,7 +9,7 @@ fabs(u32 *frD, u32 *frB)
 	frD[1] = frB[1];
 
 #ifdef DEBUG
-	printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+	printk("%s: D %p, B %p: ", __func__, frD, frB);
 	dump_double(frD);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/fadd.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fadd.c
--- a/arch/powerpc/math-emu/fadd.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fadd.c
@@ -14,7 +14,7 @@ fadd(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fadds.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fadds.c
--- a/arch/powerpc/math-emu/fadds.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fadds.c
@@ -15,7 +15,7 @@ fadds(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fcmpo.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fcmpo.c
--- a/arch/powerpc/math-emu/fcmpo.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fcmpo.c
@@ -15,7 +15,7 @@ fcmpo(u32 *ccr, int crfD, void *frA, voi
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p (%08x) %d %p %p\n", __FUNCTION__, ccr, *ccr, crfD, frA, frB);
+	printk("%s: %p (%08x) %d %p %p\n", __func__, ccr, *ccr, crfD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fcmpu.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fcmpu.c
--- a/arch/powerpc/math-emu/fcmpu.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fcmpu.c
@@ -14,7 +14,7 @@ fcmpu(u32 *ccr, int crfD, void *frA, voi
 	long cmp;
 
 #ifdef DEBUG
-	printk("%s: %p (%08x) %d %p %p\n", __FUNCTION__, ccr, *ccr, crfD, frA, frB);
+	printk("%s: %p (%08x) %d %p %p\n", __func__, ccr, *ccr, crfD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fctiw.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fctiw.c
--- a/arch/powerpc/math-emu/fctiw.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fctiw.c
@@ -16,7 +16,7 @@ fctiw(u32 *frD, void *frB)
 	frD[1] = r;
 
 #ifdef DEBUG
-	printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+	printk("%s: D %p, B %p: ", __func__, frD, frB);
 	dump_double(frD);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/fctiwz.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fctiwz.c
--- a/arch/powerpc/math-emu/fctiwz.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fctiwz.c
@@ -23,7 +23,7 @@ fctiwz(u32 *frD, void *frB)
 	__FPU_FPSCR = fpscr;
 
 #ifdef DEBUG
-	printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+	printk("%s: D %p, B %p: ", __func__, frD, frB);
 	dump_double(frD);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/fdiv.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fdiv.c
--- a/arch/powerpc/math-emu/fdiv.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fdiv.c
@@ -14,7 +14,7 @@ fdiv(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
@@ -28,13 +28,13 @@ fdiv(void *frD, void *frA, void *frB)
 	if (A_c == FP_CLS_ZERO && B_c == FP_CLS_ZERO) {
 		ret |= EFLAG_VXZDZ;
 #ifdef DEBUG
-		printk("%s: FPSCR_VXZDZ raised\n", __FUNCTION__);
+		printk("%s: FPSCR_VXZDZ raised\n", __func__);
 #endif
 	}
 	if (A_c == FP_CLS_INF && B_c == FP_CLS_INF) {
 		ret |= EFLAG_VXIDI;
 #ifdef DEBUG
-		printk("%s: FPSCR_VXIDI raised\n", __FUNCTION__);
+		printk("%s: FPSCR_VXIDI raised\n", __func__);
 #endif
 	}
 
diff -puN arch/powerpc/math-emu/fdivs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fdivs.c
--- a/arch/powerpc/math-emu/fdivs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fdivs.c
@@ -15,7 +15,7 @@ fdivs(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
@@ -29,13 +29,13 @@ fdivs(void *frD, void *frA, void *frB)
 	if (A_c == FP_CLS_ZERO && B_c == FP_CLS_ZERO) {
 		ret |= EFLAG_VXZDZ;
 #ifdef DEBUG
-		printk("%s: FPSCR_VXZDZ raised\n", __FUNCTION__);
+		printk("%s: FPSCR_VXZDZ raised\n", __func__);
 #endif
 	}
 	if (A_c == FP_CLS_INF && B_c == FP_CLS_INF) {
 		ret |= EFLAG_VXIDI;
 #ifdef DEBUG
-		printk("%s: FPSCR_VXIDI raised\n", __FUNCTION__);
+		printk("%s: FPSCR_VXIDI raised\n", __func__);
 #endif
 	}
 
diff -puN arch/powerpc/math-emu/fmadd.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fmadd.c
--- a/arch/powerpc/math-emu/fmadd.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fmadd.c
@@ -16,7 +16,7 @@ fmadd(void *frD, void *frA, void *frB, v
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fmadds.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fmadds.c
--- a/arch/powerpc/math-emu/fmadds.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fmadds.c
@@ -17,7 +17,7 @@ fmadds(void *frD, void *frA, void *frB, 
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fmr.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fmr.c
--- a/arch/powerpc/math-emu/fmr.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fmr.c
@@ -9,7 +9,7 @@ fmr(u32 *frD, u32 *frB)
 	frD[1] = frB[1];
 
 #ifdef DEBUG
-	printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+	printk("%s: D %p, B %p: ", __func__, frD, frB);
 	dump_double(frD);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/fmsub.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fmsub.c
--- a/arch/powerpc/math-emu/fmsub.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fmsub.c
@@ -16,7 +16,7 @@ fmsub(void *frD, void *frA, void *frB, v
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fmsubs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fmsubs.c
--- a/arch/powerpc/math-emu/fmsubs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fmsubs.c
@@ -17,7 +17,7 @@ fmsubs(void *frD, void *frA, void *frB, 
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fmul.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fmul.c
--- a/arch/powerpc/math-emu/fmul.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fmul.c
@@ -14,7 +14,7 @@ fmul(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fmuls.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fmuls.c
--- a/arch/powerpc/math-emu/fmuls.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fmuls.c
@@ -15,7 +15,7 @@ fmuls(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fnabs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fnabs.c
--- a/arch/powerpc/math-emu/fnabs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fnabs.c
@@ -9,7 +9,7 @@ fnabs(u32 *frD, u32 *frB)
 	frD[1] = frB[1];
 
 #ifdef DEBUG
-	printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+	printk("%s: D %p, B %p: ", __func__, frD, frB);
 	dump_double(frD);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/fneg.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fneg.c
--- a/arch/powerpc/math-emu/fneg.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fneg.c
@@ -9,7 +9,7 @@ fneg(u32 *frD, u32 *frB)
 	frD[1] = frB[1];
 
 #ifdef DEBUG
-	printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+	printk("%s: D %p, B %p: ", __func__, frD, frB);
 	dump_double(frD);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/fnmadd.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fnmadd.c
--- a/arch/powerpc/math-emu/fnmadd.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fnmadd.c
@@ -16,7 +16,7 @@ fnmadd(void *frD, void *frA, void *frB, 
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fnmadds.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fnmadds.c
--- a/arch/powerpc/math-emu/fnmadds.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fnmadds.c
@@ -17,7 +17,7 @@ fnmadds(void *frD, void *frA, void *frB,
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fnmsub.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fnmsub.c
--- a/arch/powerpc/math-emu/fnmsub.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fnmsub.c
@@ -16,7 +16,7 @@ fnmsub(void *frD, void *frA, void *frB, 
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fnmsubs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fnmsubs.c
--- a/arch/powerpc/math-emu/fnmsubs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fnmsubs.c
@@ -17,7 +17,7 @@ fnmsubs(void *frD, void *frA, void *frB,
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fres.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fres.c
--- a/arch/powerpc/math-emu/fres.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fres.c
@@ -6,7 +6,7 @@ int
 fres(void *frD, void *frB)
 {
 #ifdef DEBUG
-	printk("%s: %p %p\n", __FUNCTION__, frD, frB);
+	printk("%s: %p %p\n", __func__, frD, frB);
 #endif
 	return -ENOSYS;
 }
diff -puN arch/powerpc/math-emu/frsp.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/frsp.c
--- a/arch/powerpc/math-emu/frsp.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/frsp.c
@@ -12,7 +12,7 @@ frsp(void *frD, void *frB)
 	FP_DECL_D(B);
 
 #ifdef DEBUG
-	printk("%s: D %p, B %p\n", __FUNCTION__, frD, frB);
+	printk("%s: D %p, B %p\n", __func__, frD, frB);
 #endif
 
 	__FP_UNPACK_D(B, frB);
diff -puN arch/powerpc/math-emu/frsqrte.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/frsqrte.c
--- a/arch/powerpc/math-emu/frsqrte.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/frsqrte.c
@@ -6,7 +6,7 @@ int
 frsqrte(void *frD, void *frB)
 {
 #ifdef DEBUG
-	printk("%s: %p %p\n", __FUNCTION__, frD, frB);
+	printk("%s: %p %p\n", __func__, frD, frB);
 #endif
 	return 0;
 }
diff -puN arch/powerpc/math-emu/fsel.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fsel.c
--- a/arch/powerpc/math-emu/fsel.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fsel.c
@@ -11,7 +11,7 @@ fsel(u32 *frD, void *frA, u32 *frB, u32 
 	FP_DECL_D(A);
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+	printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fsqrt.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fsqrt.c
--- a/arch/powerpc/math-emu/fsqrt.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fsqrt.c
@@ -13,7 +13,7 @@ fsqrt(void *frD, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frB);
+	printk("%s: %p %p %p %p\n", __func__, frD, frB);
 #endif
 
 	__FP_UNPACK_D(B, frB);
diff -puN arch/powerpc/math-emu/fsqrts.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fsqrts.c
--- a/arch/powerpc/math-emu/fsqrts.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fsqrts.c
@@ -14,7 +14,7 @@ fsqrts(void *frD, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frB);
+	printk("%s: %p %p %p %p\n", __func__, frD, frB);
 #endif
 
 	__FP_UNPACK_D(B, frB);
diff -puN arch/powerpc/math-emu/fsub.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fsub.c
--- a/arch/powerpc/math-emu/fsub.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fsub.c
@@ -14,7 +14,7 @@ fsub(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/fsubs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/fsubs.c
--- a/arch/powerpc/math-emu/fsubs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/fsubs.c
@@ -15,7 +15,7 @@ fsubs(void *frD, void *frA, void *frB)
 	int ret = 0;
 
 #ifdef DEBUG
-	printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+	printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
 	__FP_UNPACK_D(A, frA);
diff -puN arch/powerpc/math-emu/lfd.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/lfd.c
--- a/arch/powerpc/math-emu/lfd.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/lfd.c
@@ -11,7 +11,7 @@ lfd(void *frD, void *ea)
 	if (copy_from_user(frD, ea, sizeof(double)))
 		return -EFAULT;
 #ifdef DEBUG
-	printk("%s: D %p, ea %p: ", __FUNCTION__, frD, ea);
+	printk("%s: D %p, ea %p: ", __func__, frD, ea);
 	dump_double(frD);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/lfs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/lfs.c
--- a/arch/powerpc/math-emu/lfs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/lfs.c
@@ -14,7 +14,7 @@ lfs(void *frD, void *ea)
 	float f;
 
 #ifdef DEBUG
-	printk("%s: D %p, ea %p\n", __FUNCTION__, frD, ea);
+	printk("%s: D %p, ea %p\n", __func__, frD, ea);
 #endif
 
 	if (copy_from_user(&f, ea, sizeof(float)))
diff -puN arch/powerpc/math-emu/mcrfs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/mcrfs.c
--- a/arch/powerpc/math-emu/mcrfs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/mcrfs.c
@@ -10,7 +10,7 @@ mcrfs(u32 *ccr, u32 crfD, u32 crfS)
 	u32 value, clear;
 
 #ifdef DEBUG
-	printk("%s: %p (%08x) %d %d\n", __FUNCTION__, ccr, *ccr, crfD, crfS);
+	printk("%s: %p (%08x) %d %d\n", __func__, ccr, *ccr, crfD, crfS);
 #endif
 
 	clear = 15 << ((7 - crfS) << 2);
@@ -24,7 +24,7 @@ mcrfs(u32 *ccr, u32 crfD, u32 crfS)
 	*ccr |= (value << ((7 - crfD) << 2));
 
 #ifdef DEBUG
-	printk("CR: %08x\n", __FUNCTION__, *ccr);
+	printk("CR: %08x\n", __func__, *ccr);
 #endif
 
 	return 0;
diff -puN arch/powerpc/math-emu/mffs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/mffs.c
--- a/arch/powerpc/math-emu/mffs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/mffs.c
@@ -10,7 +10,7 @@ mffs(u32 *frD)
 	frD[1] = __FPU_FPSCR;
 
 #ifdef DEBUG
-	printk("%s: frD %p: %08x.%08x\n", __FUNCTION__, frD, frD[0], frD[1]);
+	printk("%s: frD %p: %08x.%08x\n", __func__, frD, frD[0], frD[1]);
 #endif
 
 	return 0;
diff -puN arch/powerpc/math-emu/mtfsb0.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/mtfsb0.c
--- a/arch/powerpc/math-emu/mtfsb0.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/mtfsb0.c
@@ -11,7 +11,7 @@ mtfsb0(int crbD)
 		__FPU_FPSCR &= ~(1 << (31 - crbD));
 
 #ifdef DEBUG
-	printk("%s: %d %08lx\n", __FUNCTION__, crbD, __FPU_FPSCR);
+	printk("%s: %d %08lx\n", __func__, crbD, __FPU_FPSCR);
 #endif
 
 	return 0;
diff -puN arch/powerpc/math-emu/mtfsb1.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/mtfsb1.c
--- a/arch/powerpc/math-emu/mtfsb1.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/mtfsb1.c
@@ -11,7 +11,7 @@ mtfsb1(int crbD)
 		__FPU_FPSCR |= (1 << (31 - crbD));
 
 #ifdef DEBUG
-	printk("%s: %d %08lx\n", __FUNCTION__, crbD, __FPU_FPSCR);
+	printk("%s: %d %08lx\n", __func__, crbD, __FPU_FPSCR);
 #endif
 
 	return 0;
diff -puN arch/powerpc/math-emu/mtfsf.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/mtfsf.c
--- a/arch/powerpc/math-emu/mtfsf.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/mtfsf.c
@@ -38,7 +38,7 @@ mtfsf(unsigned int FM, u32 *frB)
 	__FPU_FPSCR |= (frB[1] & mask);
 
 #ifdef DEBUG
-	printk("%s: %02x %p: %08lx\n", __FUNCTION__, FM, frB, __FPU_FPSCR);
+	printk("%s: %02x %p: %08lx\n", __func__, FM, frB, __FPU_FPSCR);
 #endif
 
 	return 0;
diff -puN arch/powerpc/math-emu/mtfsfi.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/mtfsfi.c
--- a/arch/powerpc/math-emu/mtfsfi.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/mtfsfi.c
@@ -16,7 +16,7 @@ mtfsfi(unsigned int crfD, unsigned int I
 	__FPU_FPSCR |= (IMM & 0xf) << ((7 - crfD) << 2);
 
 #ifdef DEBUG
-	printk("%s: %d %x: %08lx\n", __FUNCTION__, crfD, IMM, __FPU_FPSCR);
+	printk("%s: %d %x: %08lx\n", __func__, crfD, IMM, __FPU_FPSCR);
 #endif
 
 	return 0;
diff -puN arch/powerpc/math-emu/stfd.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/stfd.c
--- a/arch/powerpc/math-emu/stfd.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/stfd.c
@@ -7,7 +7,7 @@ stfd(void *frS, void *ea)
 {
 #if 0
 #ifdef DEBUG
-	printk("%s: S %p, ea %p: ", __FUNCTION__, frS, ea);
+	printk("%s: S %p, ea %p: ", __func__, frS, ea);
 	dump_double(frS);
 	printk("\n");
 #endif
diff -puN arch/powerpc/math-emu/stfiwx.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/stfiwx.c
--- a/arch/powerpc/math-emu/stfiwx.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/stfiwx.c
@@ -6,7 +6,7 @@ int
 stfiwx(u32 *frS, void *ea)
 {
 #ifdef DEBUG
-	printk("%s: %p %p\n", __FUNCTION__, frS, ea);
+	printk("%s: %p %p\n", __func__, frS, ea);
 #endif
 
 	if (copy_to_user(ea, &frS[1], sizeof(frS[1])))
diff -puN arch/powerpc/math-emu/stfs.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/math-emu/stfs.c
--- a/arch/powerpc/math-emu/stfs.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/math-emu/stfs.c
@@ -15,7 +15,7 @@ stfs(void *frS, void *ea)
 	int err;
 
 #ifdef DEBUG
-	printk("%s: S %p, ea %p\n", __FUNCTION__, frS, ea);
+	printk("%s: S %p, ea %p\n", __func__, frS, ea);
 #endif
 
 	__FP_UNPACK_D(A, frS);
diff -puN arch/powerpc/mm/init_32.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/mm/init_32.c
--- a/arch/powerpc/mm/init_32.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/mm/init_32.c
@@ -276,7 +276,7 @@ static int __init setup_kcore(void)
 
 		kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
 		if (!kcore_mem)
-			panic("%s: kmalloc failed\n", __FUNCTION__);
+			panic("%s: kmalloc failed\n", __func__);
 
 		/* must stay under 32 bits */
 		if ( 0xfffffffful - (unsigned long)__va(base) < size) {
diff -puN arch/powerpc/mm/init_64.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/mm/init_64.c
--- a/arch/powerpc/mm/init_64.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/mm/init_64.c
@@ -122,7 +122,7 @@ static int __init setup_kcore(void)
 		/* GFP_ATOMIC to avoid might_sleep warnings during boot */
 		kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
 		if (!kcore_mem)
-			panic("%s: kmalloc failed\n", __FUNCTION__);
+			panic("%s: kmalloc failed\n", __func__);
 
 		kclist_add(kcore_mem, __va(base), size);
 	}
diff -puN arch/powerpc/oprofile/cell/spu_task_sync.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/oprofile/cell/spu_task_sync.c
--- a/arch/powerpc/oprofile/cell/spu_task_sync.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/oprofile/cell/spu_task_sync.c
@@ -68,7 +68,7 @@ static struct cached_info *get_cached_in
 	if (spu_num >= num_spu_nodes) {
 		printk(KERN_ERR "SPU_PROF: "
 		       "%s, line %d: Invalid index %d into spu info cache\n",
-		       __FUNCTION__, __LINE__, spu_num);
+		       __func__, __LINE__, spu_num);
 		ret_info = NULL;
 		goto out;
 	}
@@ -115,7 +115,7 @@ prepare_cached_spu_info(struct spu *spu,
 	if (!info) {
 		printk(KERN_ERR "SPU_PROF: "
 		       "%s, line %d: create vma_map failed\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		retval = -ENOMEM;
 		goto err_alloc;
 	}
@@ -123,7 +123,7 @@ prepare_cached_spu_info(struct spu *spu,
 	if (!new_map) {
 		printk(KERN_ERR "SPU_PROF: "
 		       "%s, line %d: create vma_map failed\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		retval = -ENOMEM;
 		goto err_alloc;
 	}
@@ -171,7 +171,7 @@ static int release_cached_info(int spu_i
 			printk(KERN_ERR "SPU_PROF: "
 				"%s, line %d: "
 				"Invalid index %d into spu info cache\n",
-				__FUNCTION__, __LINE__, spu_index);
+				__func__, __LINE__, spu_index);
 			goto out;
 		}
 		end = spu_index + 1;
@@ -273,7 +273,7 @@ fail_no_image_cookie:
 
 	printk(KERN_ERR "SPU_PROF: "
 		"%s, line %d: Cannot find dcookie for SPU binary\n",
-		__FUNCTION__, __LINE__);
+		__func__, __LINE__);
 	goto out;
 }
 
@@ -467,7 +467,7 @@ int spu_sync_stop(void)
 	if (ret) {
 		printk(KERN_ERR "SPU_PROF: "
 			"%s, line %d: spu_switch_event_unregister returned %d\n",
-			__FUNCTION__, __LINE__, ret);
+			__func__, __LINE__, ret);
 		goto out;
 	}
 
diff -puN arch/powerpc/oprofile/cell/vma_map.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/oprofile/cell/vma_map.c
--- a/arch/powerpc/oprofile/cell/vma_map.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/oprofile/cell/vma_map.c
@@ -72,7 +72,7 @@ vma_map_add(struct vma_to_fileoffset_map
 		kzalloc(sizeof(struct vma_to_fileoffset_map), GFP_KERNEL);
 	if (!new) {
 		printk(KERN_ERR "SPU_PROF: %s, line %d: malloc failed\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		vma_map_free(map);
 		return NULL;
 	}
@@ -132,19 +132,19 @@ struct vma_to_fileoffset_map *create_vma
 	if (memcmp(ehdr.e_ident, expected, EI_PAD) != 0) {
 		printk(KERN_ERR "SPU_PROF: "
 		       "%s, line %d: Unexpected e_ident parsing SPU ELF\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		goto fail;
 	}
 	if (ehdr.e_machine != EM_SPU) {
 		printk(KERN_ERR "SPU_PROF: "
 		       "%s, line %d: Unexpected e_machine parsing SPU ELF\n",
-		       __FUNCTION__,  __LINE__);
+		       __func__,  __LINE__);
 		goto fail;
 	}
 	if (ehdr.e_type != ET_EXEC) {
 		printk(KERN_ERR "SPU_PROF: "
 		       "%s, line %d: Unexpected e_type parsing SPU ELF\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		goto fail;
 	}
 	phdr_start = spu_elf_start + ehdr.e_phoff;
@@ -235,7 +235,7 @@ struct vma_to_fileoffset_map *create_vma
 	if (overlay_tbl_offset < 0) {
 		printk(KERN_ERR "SPU_PROF: "
 		       "%s, line %d: Error finding SPU overlay table\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		goto fail;
 	}
 	ovly_table = spu_elf_start + overlay_tbl_offset;
diff -puN arch/powerpc/oprofile/op_model_cell.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/oprofile/op_model_cell.c
--- a/arch/powerpc/oprofile/op_model_cell.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/oprofile/op_model_cell.c
@@ -216,7 +216,7 @@ static void pm_rtas_reset_signals(u32 no
 		 * failure to stop OProfile.
 		 */
 		printk(KERN_WARNING "%s: rtas returned: %d\n",
-		       __FUNCTION__, ret);
+		       __func__, ret);
 }
 
 static int pm_rtas_activate_signals(u32 node, u32 count)
@@ -255,7 +255,7 @@ static int pm_rtas_activate_signals(u32 
 
 		if (unlikely(ret)) {
 			printk(KERN_WARNING "%s: rtas returned: %d\n",
-			       __FUNCTION__, ret);
+			       __func__, ret);
 			return -EIO;
 		}
 	}
@@ -560,7 +560,7 @@ static int cell_reg_setup(struct op_coun
 		if (unlikely(spu_rtas_token == RTAS_UNKNOWN_SERVICE)) {
 			printk(KERN_ERR
 			       "%s: rtas token ibm,cbe-spu-perftools unknown\n",
-			       __FUNCTION__);
+			       __func__);
 			return -EIO;
 		}
 	}
@@ -576,7 +576,7 @@ static int cell_reg_setup(struct op_coun
 	if (unlikely(pm_rtas_token == RTAS_UNKNOWN_SERVICE)) {
 		printk(KERN_ERR
 		       "%s: rtas token ibm,cbe-perftools unknown\n",
-		       __FUNCTION__);
+		       __func__);
 		return -EIO;
 	}
 
@@ -853,7 +853,7 @@ static int pm_rtas_activate_spu_profilin
 
 	if (unlikely(ret)) {
 		printk(KERN_WARNING "%s: rtas returned: %d\n",
-		       __FUNCTION__, ret);
+		       __func__, ret);
 		return -EIO;
 	}
 
@@ -949,7 +949,7 @@ static int cell_global_start_spu(struct 
 		if (unlikely(ret != 0)) {
 			printk(KERN_ERR
 			       "%s: rtas call ibm,cbe-spu-perftools failed, return = %d\n",
-			       __FUNCTION__, ret);
+			       __func__, ret);
 			rtas_error = -EIO;
 			goto out;
 		}
@@ -1061,7 +1061,7 @@ static void cell_global_stop_spu(void)
 		if (unlikely(rtn_value != 0)) {
 			printk(KERN_ERR
 			       "%s: rtas call ibm,cbe-spu-perftools failed, return = %d\n",
-			       __FUNCTION__, rtn_value);
+			       __func__, rtn_value);
 		}
 
 		/* Deactivate the signals */
diff -puN arch/powerpc/platforms/52xx/lite5200.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/52xx/lite5200.c
--- a/arch/powerpc/platforms/52xx/lite5200.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/52xx/lite5200.c
@@ -63,7 +63,7 @@ lite5200_fix_clock_config(void)
 	of_node_put(np);
 	if (!cdm) {
 		printk(KERN_ERR "%s() failed; expect abnormal behaviour\n",
-		       __FUNCTION__);
+		       __func__);
 		return;
 	}
 
@@ -98,7 +98,7 @@ lite5200_fix_port_config(void)
 	of_node_put(np);
 	if (!gpio) {
 		printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
-		       __FUNCTION__);
+		       __func__);
 		return;
 	}
 
diff -puN arch/powerpc/platforms/85xx/mpc85xx_ds.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/85xx/mpc85xx_ds.c
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -36,7 +36,7 @@
 #undef DEBUG
 
 #ifdef DEBUG
-#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
+#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
 #else
 #define DBG(fmt, args...)
 #endif
diff -puN arch/powerpc/platforms/cell/iommu.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/iommu.c
--- a/arch/powerpc/platforms/cell/iommu.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/iommu.c
@@ -316,7 +316,7 @@ static void cell_iommu_setup_stab(struct
 	segments = max(dbase + dsize, fbase + fsize) >> IO_SEGMENT_SHIFT;
 
 	pr_debug("%s: iommu[%d]: segments: %lu\n",
-			__FUNCTION__, iommu->nid, segments);
+			__func__, iommu->nid, segments);
 
 	/* set up the segment table */
 	stab_size = segments * sizeof(unsigned long);
@@ -343,7 +343,7 @@ static unsigned long *cell_iommu_alloc_p
 				(1 << 12) / sizeof(unsigned long));
 
 	ptab_size = segments * pages_per_segment * sizeof(unsigned long);
-	pr_debug("%s: iommu[%d]: ptab_size: %lu, order: %d\n", __FUNCTION__,
+	pr_debug("%s: iommu[%d]: ptab_size: %lu, order: %d\n", __func__,
 			iommu->nid, ptab_size, get_order(ptab_size));
 	page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(ptab_size));
 	BUG_ON(!page);
@@ -355,7 +355,7 @@ static unsigned long *cell_iommu_alloc_p
 	n_pte_pages = (pages_per_segment * sizeof(unsigned long)) >> 12;
 
 	pr_debug("%s: iommu[%d]: stab at %p, ptab at %p, n_pte_pages: %lu\n",
-			__FUNCTION__, iommu->nid, iommu->stab, ptab,
+			__func__, iommu->nid, iommu->stab, ptab,
 			n_pte_pages);
 
 	/* initialise the STEs */
@@ -394,7 +394,7 @@ static void cell_iommu_enable_hardware(s
 
 	if (cell_iommu_find_ioc(iommu->nid, &xlate_base))
 		panic("%s: missing IOC register mappings for node %d\n",
-		      __FUNCTION__, iommu->nid);
+		      __func__, iommu->nid);
 
 	iommu->xlate_regs = ioremap(xlate_base, IOC_Reg_Size);
 	iommu->cmd_regs = iommu->xlate_regs + IOC_IOCmd_Offset;
diff -puN arch/powerpc/platforms/cell/pervasive.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/pervasive.c
--- a/arch/powerpc/platforms/cell/pervasive.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/pervasive.c
@@ -65,7 +65,7 @@ static void cbe_power_save(void)
 		break;
 	default:
 		printk(KERN_WARNING "%s: unknown configuration\n",
-			__FUNCTION__);
+			__func__);
 		break;
 	}
 	mtspr(SPRN_TSC_CELL, thread_switch_control);
diff -puN arch/powerpc/platforms/cell/ras.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/ras.c
--- a/arch/powerpc/platforms/cell/ras.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/ras.c
@@ -132,7 +132,7 @@ static int __init cbe_ptcal_enable_on_no
 				(unsigned int)(addr >> 32),
 				(unsigned int)(addr & 0xffffffff))) {
 		printk(KERN_ERR "%s: error enabling PTCAL on node %d!\n",
-				__FUNCTION__, nid);
+				__func__, nid);
 		goto out_free_pages;
 	}
 
@@ -162,7 +162,7 @@ static int __init cbe_ptcal_enable(void)
 	if (!size)
 		return -ENODEV;
 
-	pr_debug("%s: enabling PTCAL, size = 0x%x\n", __FUNCTION__, *size);
+	pr_debug("%s: enabling PTCAL, size = 0x%x\n", __func__, *size);
 	order = get_order(*size);
 	of_node_put(np);
 
@@ -180,7 +180,7 @@ static int __init cbe_ptcal_enable(void)
 		const u32 *nid = of_get_property(np, "node-id", NULL);
 		if (!nid) {
 			printk(KERN_ERR "%s: node %s is missing node-id?\n",
-					__FUNCTION__, np->full_name);
+					__func__, np->full_name);
 			continue;
 		}
 		cbe_ptcal_enable_on_node(*nid, order);
@@ -195,13 +195,13 @@ static int cbe_ptcal_disable(void)
 	struct ptcal_area *area, *tmp;
 	int ret = 0;
 
-	pr_debug("%s: disabling PTCAL\n", __FUNCTION__);
+	pr_debug("%s: disabling PTCAL\n", __func__);
 
 	list_for_each_entry_safe(area, tmp, &ptcal_list, list) {
 		/* disable ptcal on this node */
 		if (rtas_call(ptcal_stop_tok, 1, 1, NULL, area->nid)) {
 			printk(KERN_ERR "%s: error disabling PTCAL "
-					"on node %d!\n", __FUNCTION__,
+					"on node %d!\n", __func__,
 					area->nid);
 			ret = -EIO;
 			continue;
diff -puN arch/powerpc/platforms/cell/spu_base.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/spu_base.c
--- a/arch/powerpc/platforms/cell/spu_base.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/spu_base.c
@@ -165,7 +165,7 @@ static int __spu_trap_data_seg(struct sp
 	struct spu_slb slb;
 	int psize;
 
-	pr_debug("%s\n", __FUNCTION__);
+	pr_debug("%s\n", __func__);
 
 	slb.esid = (ea & ESID_MASK) | SLB_ESID_V;
 
@@ -215,7 +215,7 @@ static int __spu_trap_data_seg(struct sp
 extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); //XXX
 static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
 {
-	pr_debug("%s, %lx, %lx\n", __FUNCTION__, dsisr, ea);
+	pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea);
 
 	/* Handle kernel space hash faults immediately.
 	   User hash faults need to be deferred to process context. */
@@ -351,7 +351,7 @@ spu_irq_class_1(int irq, void *data)
 		__spu_trap_data_seg(spu, dar);
 
 	spin_unlock(&spu->register_lock);
-	pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
+	pr_debug("%s: %lx %lx %lx %lx\n", __func__, mask, stat,
 			dar, dsisr);
 
 	if (stat & CLASS1_STORAGE_FAULT_INTR)
@@ -726,7 +726,7 @@ static int __init init_spu_base(void)
 
 	if (ret < 0) {
 		printk(KERN_WARNING "%s: Error initializing spus\n",
-			__FUNCTION__);
+			__func__);
 		goto out_unregister_sysdev_class;
 	}
 
diff -puN arch/powerpc/platforms/cell/spu_callbacks.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/spu_callbacks.c
--- a/arch/powerpc/platforms/cell/spu_callbacks.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall
 	long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
 
 	if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
-		pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret);
+		pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret);
 		return -ENOSYS;
 	}
 
diff -puN arch/powerpc/platforms/cell/spu_manage.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/spu_manage.c
--- a/arch/powerpc/platforms/cell/spu_manage.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/spu_manage.c
@@ -92,7 +92,7 @@ static int __init spu_map_interrupts_old
 
 	tmp = of_get_property(np->parent->parent, "node-id", NULL);
 	if (!tmp) {
-		printk(KERN_WARNING "%s: can't find node-id\n", __FUNCTION__);
+		printk(KERN_WARNING "%s: can't find node-id\n", __func__);
 		nid = spu->node;
 	} else
 		nid = tmp[0];
@@ -296,7 +296,7 @@ static int __init of_enumerate_spus(int 
 		ret = fn(node);
 		if (ret) {
 			printk(KERN_WARNING "%s: Error initializing %s\n",
-				__FUNCTION__, node->name);
+				__func__, node->name);
 			break;
 		}
 		n++;
@@ -327,7 +327,7 @@ static int __init of_create_spu(struct s
 		if (!legacy_map) {
 			legacy_map = 1;
 			printk(KERN_WARNING "%s: Legacy device tree found, "
-				"trying to map old style\n", __FUNCTION__);
+				"trying to map old style\n", __func__);
 		}
 		ret = spu_map_device_old(spu);
 		if (ret) {
@@ -342,7 +342,7 @@ static int __init of_create_spu(struct s
 		if (!legacy_irq) {
 			legacy_irq = 1;
 			printk(KERN_WARNING "%s: Legacy device tree found, "
-				"trying old style irq\n", __FUNCTION__);
+				"trying old style irq\n", __func__);
 		}
 		ret = spu_map_interrupts_old(spu, spe);
 		if (ret) {
diff -puN arch/powerpc/platforms/cell/spufs/file.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/spufs/file.c
--- a/arch/powerpc/platforms/cell/spufs/file.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/spufs/file.c
@@ -1556,7 +1556,7 @@ void spufs_mfc_callback(struct spu *spu)
 
 	wake_up_all(&ctx->mfc_wq);
 
-	pr_debug("%s %s\n", __FUNCTION__, spu->name);
+	pr_debug("%s %s\n", __func__, spu->name);
 	if (ctx->mfc_fasync) {
 		u32 free_elements, tagstatus;
 		unsigned int mask;
@@ -1790,7 +1790,7 @@ static unsigned int spufs_mfc_poll(struc
 	if (tagstatus & ctx->tagwait)
 		mask |= POLLIN | POLLRDNORM;
 
-	pr_debug("%s: free %d tagstatus %d tagwait %d\n", __FUNCTION__,
+	pr_debug("%s: free %d tagstatus %d tagwait %d\n", __func__,
 		free_elements, tagstatus, ctx->tagwait);
 
 	return mask;
diff -puN arch/powerpc/platforms/cell/spufs/run.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/cell/spufs/run.c
--- a/arch/powerpc/platforms/cell/spufs/run.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/cell/spufs/run.c
@@ -98,7 +98,7 @@ static int spu_setup_isolated(struct spu
 			!= MFC_CNTL_PURGE_DMA_COMPLETE) {
 		if (time_after(jiffies, timeout)) {
 			printk(KERN_ERR "%s: timeout flushing MFC DMA queue\n",
-					__FUNCTION__);
+					__func__);
 			ret = -EIO;
 			goto out;
 		}
@@ -124,7 +124,7 @@ static int spu_setup_isolated(struct spu
 				status_loading) {
 		if (time_after(jiffies, timeout)) {
 			printk(KERN_ERR "%s: timeout waiting for loader\n",
-					__FUNCTION__);
+					__func__);
 			ret = -EIO;
 			goto out_drop_priv;
 		}
@@ -134,7 +134,7 @@ static int spu_setup_isolated(struct spu
 	if (!(status & SPU_STATUS_RUNNING)) {
 		/* If isolated LOAD has failed: run SPU, we will get a stop-and
 		 * signal later. */
-		pr_debug("%s: isolated LOAD failed\n", __FUNCTION__);
+		pr_debug("%s: isolated LOAD failed\n", __func__);
 		ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
 		ret = -EACCES;
 		goto out_drop_priv;
@@ -142,7 +142,7 @@ static int spu_setup_isolated(struct spu
 
 	if (!(status & SPU_STATUS_ISOLATED_STATE)) {
 		/* This isn't allowed by the CBEA, but check anyway */
-		pr_debug("%s: SPU fell out of isolated mode?\n", __FUNCTION__);
+		pr_debug("%s: SPU fell out of isolated mode?\n", __func__);
 		ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_STOP);
 		ret = -EINVAL;
 		goto out_drop_priv;
@@ -282,7 +282,7 @@ static int spu_handle_restartsys(struct 
 		break;
 	default:
 		printk(KERN_WARNING "%s: unexpected return code %ld\n",
-			__FUNCTION__, *spu_ret);
+			__func__, *spu_ret);
 		ret = 0;
 	}
 	return ret;
diff -puN arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -117,11 +117,11 @@ static void __init mpc7448_hpc2_init_IRQ
 	}
 
 	if (mpic_paddr == 0) {
-		printk("%s: No tsi108 PIC found !\n", __FUNCTION__);
+		printk("%s: No tsi108 PIC found !\n", __func__);
 		return;
 	}
 
-	DBG("%s: tsi108 pic phys_addr = 0x%x\n", __FUNCTION__,
+	DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__,
 	    (u32) mpic_paddr);
 
 	mpic = mpic_alloc(tsi_pic, mpic_paddr,
@@ -140,17 +140,17 @@ static void __init mpc7448_hpc2_init_IRQ
 #ifdef CONFIG_PCI
 	tsi_pci = of_find_node_by_type(NULL, "pci");
 	if (tsi_pci == NULL) {
-		printk("%s: No tsi108 pci node found !\n", __FUNCTION__);
+		printk("%s: No tsi108 pci node found !\n", __func__);
 		return;
 	}
 	cascade_node = of_find_node_by_type(NULL, "pic-router");
 	if (cascade_node == NULL) {
-		printk("%s: No tsi108 pci cascade node found !\n", __FUNCTION__);
+		printk("%s: No tsi108 pci cascade node found !\n", __func__);
 		return;
 	}
 
 	cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);
-	DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __FUNCTION__,
+	DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__,
 	    (u32) cascade_pci_irq);
 	tsi108_pci_int_init(cascade_node);
 	set_irq_data(cascade_pci_irq, mpic);
diff -puN arch/powerpc/platforms/ps3/setup.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/ps3/setup.c
--- a/arch/powerpc/platforms/ps3/setup.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/ps3/setup.c
@@ -117,7 +117,7 @@ static void __init prealloc(struct ps3_p
 
 	p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS));
 	if (!p->address) {
-		printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__,
+		printk(KERN_ERR "%s: Cannot allocate %s\n", __func__,
 		       p->name);
 		return;
 	}
diff -puN arch/powerpc/platforms/pseries/pci_dlpar.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/pseries/pci_dlpar.c
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -123,7 +123,7 @@ pcibios_pci_config_bridge(struct pci_dev
 	/* Add to children of PCI bridge dev->bus */
 	child_bus = pci_add_new_bus(dev->bus, dev, sec_busno);
 	if (!child_bus) {
-		printk (KERN_ERR "%s: could not add second bus\n", __FUNCTION__);
+		printk (KERN_ERR "%s: could not add second bus\n", __func__);
 		return -EIO;
 	}
 	sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
diff -puN arch/powerpc/platforms/pseries/reconfig.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/platforms/pseries/reconfig.c
--- a/arch/powerpc/platforms/pseries/reconfig.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/platforms/pseries/reconfig.c
@@ -222,14 +222,14 @@ static char * parse_next_property(char *
 	tmp = strchr(buf, ' ');
 	if (!tmp) {
 		printk(KERN_ERR "property parse failed in %s at line %d\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		return NULL;
 	}
 	*tmp = '\0';
 
 	if (++tmp >= end) {
 		printk(KERN_ERR "property parse failed in %s at line %d\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		return NULL;
 	}
 
@@ -238,12 +238,12 @@ static char * parse_next_property(char *
 	*length = simple_strtoul(tmp, &tmp, 10);
 	if (*length == -1) {
 		printk(KERN_ERR "property parse failed in %s at line %d\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		return NULL;
 	}
 	if (*tmp != ' ' || ++tmp >= end) {
 		printk(KERN_ERR "property parse failed in %s at line %d\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		return NULL;
 	}
 
@@ -252,12 +252,12 @@ static char * parse_next_property(char *
 	tmp += *length;
 	if (tmp > end) {
 		printk(KERN_ERR "property parse failed in %s at line %d\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		return NULL;
 	}
 	else if (tmp < end && *tmp != ' ' && *tmp != '\0') {
 		printk(KERN_ERR "property parse failed in %s at line %d\n",
-		       __FUNCTION__, __LINE__);
+		       __func__, __LINE__);
 		return NULL;
 	}
 	tmp++;
diff -puN arch/powerpc/sysdev/cpm1.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/sysdev/cpm1.c
--- a/arch/powerpc/sysdev/cpm1.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/sysdev/cpm1.c
@@ -257,7 +257,7 @@ int cpm_command(u32 command, u8 opcode)
 		if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
 			goto out;
 
-	printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
+	printk(KERN_ERR "%s(): Not able to issue CPM command\n", __func__);
 	ret = -EIO;
 out:
 	spin_unlock_irqrestore(&cmd_lock, flags);
diff -puN arch/powerpc/sysdev/cpm2.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/sysdev/cpm2.c
--- a/arch/powerpc/sysdev/cpm2.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/sysdev/cpm2.c
@@ -99,7 +99,7 @@ int cpm_command(u32 command, u8 opcode)
 		if ((in_be32(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
 			goto out;
 
-	printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
+	printk(KERN_ERR "%s(): Not able to issue CPM command\n", __func__);
 	ret = -EIO;
 out:
 	spin_unlock_irqrestore(&cmd_lock, flags);
diff -puN arch/powerpc/sysdev/qe_lib/qe_io.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/sysdev/qe_lib/qe_io.c
--- a/arch/powerpc/sysdev/qe_lib/qe_io.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/sysdev/qe_lib/qe_io.c
@@ -200,7 +200,7 @@ static void dump_par_io(void)
 {
 	unsigned int i;
 
-	printk(KERN_INFO "%s: par_io=%p\n", __FUNCTION__, par_io);
+	printk(KERN_INFO "%s: par_io=%p\n", __func__, par_io);
 	for (i = 0; i < num_par_io_ports; i++) {
 		printk(KERN_INFO "	cpodr[%u]=%08x\n", i,
 			in_be32(&par_io[i].cpodr));
diff -puN arch/powerpc/sysdev/qe_lib/ucc_fast.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/sysdev/qe_lib/ucc_fast.c
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -148,57 +148,57 @@ int ucc_fast_init(struct ucc_fast_info *
 
 	/* check if the UCC port number is in range. */
 	if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
-		printk(KERN_ERR "%s: illegal UCC number\n", __FUNCTION__);
+		printk(KERN_ERR "%s: illegal UCC number\n", __func__);
 		return -EINVAL;
 	}
 
 	/* Check that 'max_rx_buf_length' is properly aligned (4). */
 	if (uf_info->max_rx_buf_length & (UCC_FAST_MRBLR_ALIGNMENT - 1)) {
 		printk(KERN_ERR "%s: max_rx_buf_length not aligned\n",
-			__FUNCTION__);
+			__func__);
 		return -EINVAL;
 	}
 
 	/* Validate Virtual Fifo register values */
 	if (uf_info->urfs < UCC_FAST_URFS_MIN_VAL) {
-		printk(KERN_ERR "%s: urfs is too small\n", __FUNCTION__);
+		printk(KERN_ERR "%s: urfs is too small\n", __func__);
 		return -EINVAL;
 	}
 
 	if (uf_info->urfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-		printk(KERN_ERR "%s: urfs is not aligned\n", __FUNCTION__);
+		printk(KERN_ERR "%s: urfs is not aligned\n", __func__);
 		return -EINVAL;
 	}
 
 	if (uf_info->urfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-		printk(KERN_ERR "%s: urfet is not aligned.\n", __FUNCTION__);
+		printk(KERN_ERR "%s: urfet is not aligned.\n", __func__);
 		return -EINVAL;
 	}
 
 	if (uf_info->urfset & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-		printk(KERN_ERR "%s: urfset is not aligned\n", __FUNCTION__);
+		printk(KERN_ERR "%s: urfset is not aligned\n", __func__);
 		return -EINVAL;
 	}
 
 	if (uf_info->utfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-		printk(KERN_ERR "%s: utfs is not aligned\n", __FUNCTION__);
+		printk(KERN_ERR "%s: utfs is not aligned\n", __func__);
 		return -EINVAL;
 	}
 
 	if (uf_info->utfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-		printk(KERN_ERR "%s: utfet is not aligned\n", __FUNCTION__);
+		printk(KERN_ERR "%s: utfet is not aligned\n", __func__);
 		return -EINVAL;
 	}
 
 	if (uf_info->utftt & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-		printk(KERN_ERR "%s: utftt is not aligned\n", __FUNCTION__);
+		printk(KERN_ERR "%s: utftt is not aligned\n", __func__);
 		return -EINVAL;
 	}
 
 	uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL);
 	if (!uccf) {
 		printk(KERN_ERR "%s: Cannot allocate private data\n",
-			__FUNCTION__);
+			__func__);
 		return -ENOMEM;
 	}
 
@@ -207,7 +207,7 @@ int ucc_fast_init(struct ucc_fast_info *
 	/* Set the PHY base address */
 	uccf->uf_regs = ioremap(uf_info->regs, sizeof(struct ucc_fast));
 	if (uccf->uf_regs == NULL) {
-		printk(KERN_ERR "%s: Cannot map UCC registers\n", __FUNCTION__);
+		printk(KERN_ERR "%s: Cannot map UCC registers\n", __func__);
 		return -ENOMEM;
 	}
 
@@ -230,7 +230,7 @@ int ucc_fast_init(struct ucc_fast_info *
 	/* Set UCC to fast type */
 	ret = ucc_set_type(uf_info->ucc_num, UCC_SPEED_TYPE_FAST);
 	if (ret) {
-		printk(KERN_ERR "%s: cannot set UCC type\n", __FUNCTION__);
+		printk(KERN_ERR "%s: cannot set UCC type\n", __func__);
 		ucc_fast_free(uccf);
 		return ret;
 	}
@@ -270,7 +270,7 @@ int ucc_fast_init(struct ucc_fast_info *
 	    qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
 	if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO\n",
-			__FUNCTION__);
+			__func__);
 		uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
 		ucc_fast_free(uccf);
 		return -ENOMEM;
@@ -283,7 +283,7 @@ int ucc_fast_init(struct ucc_fast_info *
 			   UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
 	if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO\n",
-			__FUNCTION__);
+			__func__);
 		uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
 		ucc_fast_free(uccf);
 		return -ENOMEM;
@@ -314,7 +314,7 @@ int ucc_fast_init(struct ucc_fast_info *
 		    ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->rx_clock,
 					COMM_DIR_RX)) {
 			printk(KERN_ERR "%s: illegal value for RX clock\n",
-			       __FUNCTION__);
+			       __func__);
 			ucc_fast_free(uccf);
 			return -EINVAL;
 		}
@@ -323,7 +323,7 @@ int ucc_fast_init(struct ucc_fast_info *
 		    ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->tx_clock,
 					COMM_DIR_TX)) {
 			printk(KERN_ERR "%s: illegal value for TX clock\n",
-			       __FUNCTION__);
+			       __func__);
 			ucc_fast_free(uccf);
 			return -EINVAL;
 		}
diff -puN arch/powerpc/sysdev/qe_lib/ucc_slow.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/sysdev/qe_lib/ucc_slow.c
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -142,7 +142,7 @@ int ucc_slow_init(struct ucc_slow_info *
 
 	/* check if the UCC port number is in range. */
 	if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) {
-		printk(KERN_ERR "%s: illegal UCC number\n", __FUNCTION__);
+		printk(KERN_ERR "%s: illegal UCC number\n", __func__);
 		return -EINVAL;
 	}
 
@@ -161,7 +161,7 @@ int ucc_slow_init(struct ucc_slow_info *
 	uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL);
 	if (!uccs) {
 		printk(KERN_ERR "%s: Cannot allocate private data\n",
-			__FUNCTION__);
+			__func__);
 		return -ENOMEM;
 	}
 
@@ -170,7 +170,7 @@ int ucc_slow_init(struct ucc_slow_info *
 	/* Set the PHY base address */
 	uccs->us_regs = ioremap(us_info->regs, sizeof(struct ucc_slow));
 	if (uccs->us_regs == NULL) {
-		printk(KERN_ERR "%s: Cannot map UCC registers\n", __FUNCTION__);
+		printk(KERN_ERR "%s: Cannot map UCC registers\n", __func__);
 		return -ENOMEM;
 	}
 
@@ -189,7 +189,7 @@ int ucc_slow_init(struct ucc_slow_info *
 	uccs->us_pram_offset =
 		qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
 	if (IS_ERR_VALUE(uccs->us_pram_offset)) {
-		printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__);
+		printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __func__);
 		ucc_slow_free(uccs);
 		return -ENOMEM;
 	}
@@ -202,7 +202,7 @@ int ucc_slow_init(struct ucc_slow_info *
 	/* Set UCC to slow type */
 	ret = ucc_set_type(us_info->ucc_num, UCC_SPEED_TYPE_SLOW);
 	if (ret) {
-		printk(KERN_ERR "%s: cannot set UCC type", __FUNCTION__);
+		printk(KERN_ERR "%s: cannot set UCC type", __func__);
 		ucc_slow_free(uccs);
 		return ret;
 	}
@@ -216,7 +216,7 @@ int ucc_slow_init(struct ucc_slow_info *
 		qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
 				QE_ALIGNMENT_OF_BD);
 	if (IS_ERR_VALUE(uccs->rx_base_offset)) {
-		printk(KERN_ERR "%s: cannot allocate %u RX BDs\n", __FUNCTION__,
+		printk(KERN_ERR "%s: cannot allocate %u RX BDs\n", __func__,
 			us_info->rx_bd_ring_len);
 		uccs->rx_base_offset = 0;
 		ucc_slow_free(uccs);
@@ -227,7 +227,7 @@ int ucc_slow_init(struct ucc_slow_info *
 		qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
 			QE_ALIGNMENT_OF_BD);
 	if (IS_ERR_VALUE(uccs->tx_base_offset)) {
-		printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);
+		printk(KERN_ERR "%s: cannot allocate TX BDs", __func__);
 		uccs->tx_base_offset = 0;
 		ucc_slow_free(uccs);
 		return -ENOMEM;
@@ -317,7 +317,7 @@ int ucc_slow_init(struct ucc_slow_info *
 		if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->rx_clock,
 					COMM_DIR_RX)) {
 			printk(KERN_ERR "%s: illegal value for RX clock\n",
-			       __FUNCTION__);
+			       __func__);
 			ucc_slow_free(uccs);
 			return -EINVAL;
 		}
@@ -325,7 +325,7 @@ int ucc_slow_init(struct ucc_slow_info *
 		if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->tx_clock,
 					COMM_DIR_TX)) {
 			printk(KERN_ERR "%s: illegal value for TX clock\n",
-			       __FUNCTION__);
+			       __func__);
 			ucc_slow_free(uccs);
 			return -EINVAL;
 		}
diff -puN arch/powerpc/sysdev/tsi108_dev.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/sysdev/tsi108_dev.c
--- a/arch/powerpc/sysdev/tsi108_dev.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/sysdev/tsi108_dev.c
@@ -84,7 +84,7 @@ static int __init tsi108_eth_of_init(voi
 
 		ret = of_address_to_resource(np, 0, &r[0]);
 		DBG("%s: name:start->end = %s:0x%lx-> 0x%lx\n",
-			__FUNCTION__,r[0].name, r[0].start, r[0].end);
+			__func__,r[0].name, r[0].start, r[0].end);
 		if (ret)
 			goto err;
 
@@ -93,7 +93,7 @@ static int __init tsi108_eth_of_init(voi
 		r[1].end = irq_of_parse_and_map(np, 0);
 		r[1].flags = IORESOURCE_IRQ;
 		DBG("%s: name:start->end = %s:0x%lx-> 0x%lx\n",
-			__FUNCTION__,r[1].name, r[1].start, r[1].end);
+			__func__,r[1].name, r[1].start, r[1].end);
 
 		tsi_eth_dev =
 		    platform_device_register_simple("tsi-ethernet", i++, &r[0],
diff -puN arch/powerpc/sysdev/tsi108_pci.c~powerpc-replace-remaining-__function__-occurences arch/powerpc/sysdev/tsi108_pci.c
--- a/arch/powerpc/sysdev/tsi108_pci.c~powerpc-replace-remaining-__function__-occurences
+++ a/arch/powerpc/sysdev/tsi108_pci.c
@@ -207,7 +207,7 @@ int __init tsi108_setup_pci(struct devic
 	/* PCI Config mapping */
 	tsi108_pci_cfg_base = (u32)ioremap(cfg_phys, TSI108_PCI_CFG_SIZE);
 	tsi108_pci_cfg_phys = cfg_phys;
-	DBG("TSI_PCI: %s tsi108_pci_cfg_base=0x%x\n", __FUNCTION__,
+	DBG("TSI_PCI: %s tsi108_pci_cfg_base=0x%x\n", __func__,
 	    tsi108_pci_cfg_base);
 
 	/* Fetch host bridge registers address */
@@ -395,7 +395,7 @@ static int pci_irq_host_xlate(struct irq
 static int pci_irq_host_map(struct irq_host *h, unsigned int virq,
 			  irq_hw_number_t hw)
 {	unsigned int irq;
-	DBG("%s(%d, 0x%lx)\n", __FUNCTION__, virq, hw);
+	DBG("%s(%d, 0x%lx)\n", __func__, virq, hw);
 	if ((virq >= 1) && (virq <= 4)){
 		irq = virq + IRQ_PCI_INTAD_BASE - 1;
 		get_irq_desc(irq)->status |= IRQ_LEVEL;
_

^ permalink raw reply

* [patch 02/24] ppc: replace remaining __FUNCTION__ occurrences
From: akpm @ 2008-03-28 21:21 UTC (permalink / raw)
  To: paulus; +Cc: akpm, harvey.harrison, linuxppc-dev

From: Harvey Harrison <harvey.harrison@gmail.com>

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/ppc/8xx_io/fec.c               |    4 ++--
 arch/ppc/platforms/radstone_ppc7d.c |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff -puN arch/ppc/8xx_io/fec.c~ppc-replace-remaining-__function__-occurences arch/ppc/8xx_io/fec.c
--- a/arch/ppc/8xx_io/fec.c~ppc-replace-remaining-__function__-occurences
+++ a/arch/ppc/8xx_io/fec.c
@@ -520,7 +520,7 @@ fec_enet_interrupt(int irq, void * dev_i
 #ifdef	CONFIG_USE_MDIO
 			fec_enet_mii(dev);
 #else
-printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTION__);
+printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__, __LINE__, __func__);
 #endif	/* CONFIG_USE_MDIO */
 		}
 
@@ -1441,7 +1441,7 @@ irqreturn_t mii_link_interrupt(int irq, 
 		fecp->fec_ecntrl = ecntrl;	/* restore old settings */
 	}
 #else
-printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__);
+printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__, __LINE__, __func__);
 #endif	/* CONFIG_USE_MDIO */
 
 #ifndef CONFIG_RPXCLASSIC
diff -puN arch/ppc/platforms/radstone_ppc7d.c~ppc-replace-remaining-__function__-occurences arch/ppc/platforms/radstone_ppc7d.c
--- a/arch/ppc/platforms/radstone_ppc7d.c~ppc-replace-remaining-__function__-occurences
+++ a/arch/ppc/platforms/radstone_ppc7d.c
@@ -512,7 +512,7 @@ static void __init ppc7d_init_irq(void)
 {
 	int irq;
 
-	pr_debug("%s\n", __FUNCTION__);
+	pr_debug("%s\n", __func__);
 	i8259_init(0, 0);
 	mv64360_init_irq();
 
@@ -569,7 +569,7 @@ static int __init ppc7d_map_irq(struct p
 	};
 	const long min_idsel = 10, max_idsel = 14, irqs_per_slot = 4;
 
-	pr_debug("%s: %04x/%04x/%x: idsel=%hx pin=%hu\n", __FUNCTION__,
+	pr_debug("%s: %04x/%04x/%x: idsel=%hx pin=%hu\n", __func__,
 		 dev->vendor, dev->device, PCI_FUNC(dev->devfn), idsel, pin);
 
 	return PCI_IRQ_TABLE_LOOKUP;
@@ -1300,7 +1300,7 @@ static void ppc7d_init2(void)
 	u32 data;
 	u8 data8;
 
-	pr_debug("%s: enter\n", __FUNCTION__);
+	pr_debug("%s: enter\n", __func__);
 
 	/* Wait for debugger? */
 	if (ppc7d_wait_debugger) {
@@ -1333,7 +1333,7 @@ static void ppc7d_init2(void)
         ppc_md.set_rtc_time = ppc7d_set_rtc_time;
         ppc_md.get_rtc_time = ppc7d_get_rtc_time;
 
-	pr_debug("%s: exit\n", __FUNCTION__);
+	pr_debug("%s: exit\n", __func__);
 }
 
 /* Called from machine_init(), early, before any of the __init functions
_

^ permalink raw reply

* [PATCH] [POWERPC] 85xx: Add support for relocatble kernel (and booting at non-zero)
From: Kumar Gala @ 2008-03-28 20:54 UTC (permalink / raw)
  To: linuxppc-dev

Added support to allow an 85xx kernel to be run from a non-zero physical
address (useful for cooperative asymmetric multiprocessing situations) and
kdump.  The support can either be at compile time or runtime
(CONFIG_RELOCATABLE).

Currently we are limited to running at a physical address that is module
256M.  This is due to how we map TLBs to cover lowmem and should be fixed
up to allow 64M or maybe even 16M alignment in the future.

All the magic for this support is accomplished by proper initializating
of the kernel memory subsystem properly and ARCH_PFN_OFFSET.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/Kconfig                 |   69 ++++++++++++++++++++++++++++++++-
 arch/powerpc/boot/Makefile           |    4 +-
 arch/powerpc/kernel/head_fsl_booke.S |   11 +++++
 arch/powerpc/kernel/prom.c           |    4 ++
 arch/powerpc/kernel/setup_64.c       |    2 +-
 arch/powerpc/mm/init_32.c            |    4 +-
 arch/powerpc/mm/init_64.c            |    3 +-
 arch/powerpc/mm/mem.c                |    5 +-
 include/asm-powerpc/kdump.h          |    5 --
 include/asm-powerpc/page.h           |   43 +++++++++++++++++---
 include/asm-powerpc/page_32.h        |    4 ++
 include/asm-powerpc/pgtable-ppc32.h  |    5 +--
 12 files changed, 133 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4d9ced2..42c22f7 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -619,21 +619,76 @@ config LOWMEM_SIZE
 	hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
 	default "0x30000000"

+config RELOCATABLE
+	bool "Build a relocatable kernel (EXPERIMENTAL)"
+	depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && FSL_BOOKE
+	help
+	  This builds a kernel image that is capable of running at the
+	  location the kernel is loaded at (some alignment restrictions may
+	  exist).
+
+	  One use is for the kexec on panic case where the recovery kernel
+	  must live at a different physical address than the primary
+	  kernel.
+
+	  Note: If CONFIG_RELOCATABLE=y, then the kernel runs from the address
+	  it has been loaded at and the compile time physical addresses
+	  CONFIG_PHYSICAL_START is ignored.  However CONFIG_PHYSICAL_START
+	  setting can still be useful to bootwrappers that need to know the
+	  load location of the kernel (eg. u-boot/mkimage).
+
+config PAGE_OFFSET_BOOL
+	bool "Set custom page offset address"
+	depends on ADVANCED_OPTIONS
+	help
+	  This option allows you to set the kernel virtual address at which
+	  the kernel will map low memory.  This can be useful in optimizing
+	  the virtual memory layout of the system.
+
+	  Say N here unless you know what you are doing.
+
+config PAGE_OFFSET
+	hex "Virtual address of memory base" if PAGE_OFFSET_BOOL
+	default "0xc0000000"
+
 config KERNEL_START_BOOL
 	bool "Set custom kernel base address"
 	depends on ADVANCED_OPTIONS
 	help
 	  This option allows you to set the kernel virtual address at which
-	  the kernel will map low memory (the kernel image will be linked at
-	  this address).  This can be useful in optimizing the virtual memory
-	  layout of the system.
+	  the kernel will be loaded.  Normally this should match PAGE_OFFSET
+	  however there are times (like kdump) that one might not want them
+	  to be the same.

 	  Say N here unless you know what you are doing.

 config KERNEL_START
 	hex "Virtual address of kernel base" if KERNEL_START_BOOL
+	default PAGE_OFFSET if PAGE_OFFSET_BOOL
+	default "0xc2000000" if CRASH_DUMP
 	default "0xc0000000"

+config PHYSICAL_START_BOOL
+	bool "Set physical address where the kernel is loaded"
+	depends on ADVANCED_OPTIONS && FLATMEM && FSL_BOOKE
+	help
+	  This gives the physical address where the kernel is loaded.
+
+	  Say N here unless you know what you are doing.
+
+config PHYSICAL_START
+	hex "Physical address where the kernel is loaded" if PHYSICAL_START_BOOL
+	default "0x02000000" if PPC_STD_MMU && CRASH_DUMP
+	default "0x00000000"
+
+config PHYSICAL_ALIGN
+	hex
+	default "0x10000000" if FSL_BOOKE
+	help
+	  This value puts the alignment restrictions on physical address
+	  where kernel is loaded and run from. Kernel is compiled for an
+	  address which meets above alignment restriction.
+
 config TASK_SIZE_BOOL
 	bool "Set custom user task size"
 	depends on ADVANCED_OPTIONS
@@ -680,9 +735,17 @@ config PIN_TLB
 endmenu

 if PPC64
+config PAGE_OFFSET
+	hex
+	default "0xc000000000000000"
 config KERNEL_START
 	hex
+	default "0xc000000002000000" if CRASH_DUMP
 	default "0xc000000000000000"
+config PHYSICAL_START
+	hex
+	default "0x02000000" if CRASH_DUMP
+	default "0x00000000"
 endif

 source "net/Kconfig"
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 3c80858..c7c2a9d 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -35,8 +35,8 @@ endif

 BOOTCFLAGS	+= -I$(obj) -I$(srctree)/$(obj) -I$(srctree)/$(src)/libfdt

-ifdef CONFIG_MEMORY_START
-MEMBASE=$(CONFIG_MEMORY_START)
+ifdef CONFIG_PHYSICAL_START
+MEMBASE=$(CONFIG_PHYSICAL_START)
 else
 MEMBASE=0x00000000
 endif
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 9f40b3e..4d0336b 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -368,6 +368,17 @@ skpinv:	addi	r6,r6,1				/* Increment */

 	bl	early_init

+#ifdef CONFIG_RELOCATABLE
+	lis	r3,kernstart_addr@ha
+	la	r3,kernstart_addr@l(r3)
+#ifdef CONFIG_PHYS_64BIT
+	stw	r23,0(r3)
+	stw	r25,4(r3)
+#else
+	stw	r25,0(r3)
+#endif
+#endif
+
 	mfspr	r3,SPRN_TLB1CFG
 	andi.	r3,r3,0xfff
 	lis	r4,num_tlbcam_entries@ha
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 60ef7d1..988cbde 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -53,6 +53,7 @@
 #include <asm/pci-bridge.h>
 #include <asm/phyp_dump.h>
 #include <asm/kexec.h>
+#include <mm/mmu_decl.h>

 #ifdef DEBUG
 #define DBG(fmt...) printk(KERN_ERR fmt)
@@ -978,7 +979,10 @@ static int __init early_init_dt_scan_memory(unsigned long node,
 		}
 #endif
 		lmb_add(base, size);
+
+		memstart_addr = min((u64)memstart_addr, base);
 	}
+
 	return 0;
 }

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 0205d40..9087e7a 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -431,7 +431,7 @@ void __init setup_system(void)
 		printk("htab_address                  = 0x%p\n", htab_address);
 	printk("htab_hash_mask                = 0x%lx\n", htab_hash_mask);
 #if PHYSICAL_START > 0
-	printk("physical_start                = 0x%x\n", PHYSICAL_START);
+	printk("physical_start                = 0x%lx\n", PHYSICAL_START);
 #endif
 	printk("-----------------------------------------------------\n");

diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 555bb7e..68ba60c 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -59,8 +59,10 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 unsigned long total_memory;
 unsigned long total_lowmem;

-phys_addr_t memstart_addr;
+phys_addr_t memstart_addr = (phys_addr_t)~0ull;
 EXPORT_SYMBOL(memstart_addr);
+phys_addr_t kernstart_addr;
+EXPORT_SYMBOL(kernstart_addr);
 phys_addr_t lowmem_end_addr;

 int boot_mapsize;
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index f18b203..7fbbafd 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -75,7 +75,8 @@
 /* max amount of RAM to use */
 unsigned long __max_memory;

-phys_addr_t memstart_addr;
+phys_addr_t memstart_addr = ~0;
+phys_addr_t kernstart_addr;

 void free_initmem(void)
 {
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 9c10b14..3ec7814 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -217,7 +217,7 @@ void __init do_init_bootmem(void)
 	unsigned long total_pages;
 	int boot_mapsize;

-	max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
+	max_low_pfn = max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
 	total_pages = (lmb_end_of_DRAM() - memstart_addr) >> PAGE_SHIFT;
 #ifdef CONFIG_HIGHMEM
 	total_pages = total_lowmem >> PAGE_SHIFT;
@@ -233,7 +233,8 @@ void __init do_init_bootmem(void)

 	start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE);

-	boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
+	min_low_pfn = MEMORY_START >> PAGE_SHIFT;
+	boot_mapsize = init_bootmem_node(NODE_DATA(0), start >> PAGE_SHIFT, min_low_pfn, max_low_pfn);

 	/* Add active regions with valid PFNs */
 	for (i = 0; i < lmb.memory.cnt; i++) {
diff --git a/include/asm-powerpc/kdump.h b/include/asm-powerpc/kdump.h
index 10e8eb1..f6c93c7 100644
--- a/include/asm-powerpc/kdump.h
+++ b/include/asm-powerpc/kdump.h
@@ -11,16 +11,11 @@

 #ifdef CONFIG_CRASH_DUMP

-#define PHYSICAL_START	KDUMP_KERNELBASE
 #define KDUMP_TRAMPOLINE_START	0x0100
 #define KDUMP_TRAMPOLINE_END	0x3000

 #define KDUMP_MIN_TCE_ENTRIES	2048

-#else /* !CONFIG_CRASH_DUMP */
-
-#define PHYSICAL_START	0x0
-
 #endif /* CONFIG_CRASH_DUMP */

 #ifndef __ASSEMBLY__
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index df47bbb..adf0591 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -12,6 +12,7 @@

 #include <asm/asm-compat.h>
 #include <asm/kdump.h>
+#include <asm/types.h>

 /*
  * On PPC32 page size is 4K. For PPC64 we support either 4K or 64K software
@@ -42,8 +43,23 @@
  *
  * The kdump dump kernel is one example where KERNELBASE != PAGE_OFFSET.
  *
- * To get a physical address from a virtual one you subtract PAGE_OFFSET,
- * _not_ KERNELBASE.
+ * PAGE_OFFSET is the virtual address of the start of lowmem.
+ *
+ * PHYSICAL_START is the physical address of the start of the kernel.
+ *
+ * MEMORY_START is the physical address of the start of lowmem.
+ *
+ * KERNELBASE, PAGE_OFFSET, and PHYSICAL_START are all configurable on
+ * ppc32 and based on how they are set we determine MEMORY_START.
+ *
+ * For the linear mapping the following equation should be true:
+ * KERNELBASE - PAGE_OFFSET = PHYSICAL_START - MEMORY_START
+ *
+ * Also, KERNELBASE >= PAGE_OFFSET and PHYSICAL_START >= MEMORY_START
+ *
+ * There are two was to determine a physical address from a virtual one:
+ * va = pa + PAGE_OFFSET - MEMORY_START
+ * va = pa + KERNELBASE - PHYSICAL_START
  *
  * If you want to know something's offset from the start of the kernel you
  * should subtract KERNELBASE.
@@ -51,19 +67,32 @@
  * If you want to test if something's a kernel address, use is_kernel_addr().
  */

-#define PAGE_OFFSET     ASM_CONST(CONFIG_KERNEL_START)
-#define KERNELBASE      (PAGE_OFFSET + PHYSICAL_START)
+#define KERNELBASE      ASM_CONST(CONFIG_KERNEL_START)
+#define PAGE_OFFSET	ASM_CONST(CONFIG_PAGE_OFFSET)
+
+#if defined(CONFIG_RELOCATABLE) && defined(CONFIG_FLATMEM)
+#ifndef __ASSEMBLY__
+extern phys_addr_t memstart_addr;
+extern phys_addr_t kernstart_addr;
+#endif
+#define PHYSICAL_START	kernstart_addr
+#define MEMORY_START	memstart_addr
+#else
+#define PHYSICAL_START	ASM_CONST(CONFIG_PHYSICAL_START)
+#define MEMORY_START	(PHYSICAL_START + PAGE_OFFSET - KERNELBASE)
+#endif

 #ifdef CONFIG_FLATMEM
-#define pfn_valid(pfn)		((pfn) < max_mapnr)
+#define ARCH_PFN_OFFSET		(MEMORY_START >> PAGE_SHIFT)
+#define pfn_valid(pfn)		((pfn) >= ARCH_PFN_OFFSET && (pfn) < (ARCH_PFN_OFFSET + max_mapnr))
 #endif

 #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
 #define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)

-#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
-#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
+#define __va(x) ((void *)((unsigned long)(x) - PHYSICAL_START + KERNELBASE))
+#define __pa(x) ((unsigned long)(x) + PHYSICAL_START - KERNELBASE)

 /*
  * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI,
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h
index 51f8134..2605507 100644
--- a/include/asm-powerpc/page_32.h
+++ b/include/asm-powerpc/page_32.h
@@ -1,6 +1,10 @@
 #ifndef _ASM_POWERPC_PAGE_32_H
 #define _ASM_POWERPC_PAGE_32_H

+#if (CONFIG_PHYSICAL_START % CONFIG_PHYSICAL_ALIGN) != 0
+#error "CONFIG_PHYSICAL_START must be a multiple of CONFIG_PHYSICAL_ALIGN"
+#endif
+
 #define VM_DATA_DEFAULT_FLAGS	VM_DATA_DEFAULT_FLAGS32

 #ifdef CONFIG_NOT_COHERENT_CACHE
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h
index 2c79f55..dbd1875 100644
--- a/include/asm-powerpc/pgtable-ppc32.h
+++ b/include/asm-powerpc/pgtable-ppc32.h
@@ -98,9 +98,6 @@ extern int icache_44x_need_flush;
 #define USER_PTRS_PER_PGD	(TASK_SIZE / PGDIR_SIZE)
 #define FIRST_USER_ADDRESS	0

-#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
-#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
-
 #define pte_ERROR(e) \
 	printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \
 		(unsigned long long)pte_val(e))
@@ -692,7 +689,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 #define pmd_page_vaddr(pmd)	\
 	((unsigned long) (pmd_val(pmd) & PAGE_MASK))
 #define pmd_page(pmd)		\
-	(mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT))
+	(mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT) - ARCH_PFN_OFFSET)
 #endif

 /* to find an entry in a kernel page-table-directory */
-- 
1.5.4.1

^ permalink raw reply related

* [PATCH] powerpc: add kernel parameter to set l3cr for MPC745x
From: Robert Brose @ 2008-03-28 20:20 UTC (permalink / raw)
  To: linuxppc-dev

Sorry for the resend, the list software stripped my text attachment.

Old-world powermacs don't set L2CR or L3CR on processor upgrade cards.
This simple patch allows the setting of L3CR via a kernel parameter
(like the existing kernel parameter to set L2CR).

This is the first time I've posted a patch, please excuse me if I've
broken protocol or done this improperly in any way.

Signed-off-by: Robert Brose <bob@qbjnet.com>

--- linux-2.6.24/arch/powerpc/kernel/setup_32.c.orig	2008-03-10 11:24:16.566354597 -0500
+++ linux-2.6.24/arch/powerpc/kernel/setup_32.c	2008-03-10 11:22:22.711626305 -0500
@@ -172,6 +172,18 @@ int __init ppc_setup_l2cr(char *str)
 }
 __setup("l2cr=", ppc_setup_l2cr);
 
+/* Checks "l3cr=xxxx" command-line option */
+int __init ppc_setup_l3cr(char *str)
+{
+	if (cpu_has_feature(CPU_FTR_L3CR)) {
+		unsigned long val = simple_strtoul(str, NULL, 0);
+		printk(KERN_INFO "l3cr set to %lx\n", val);
+		_set_L3CR(val);		/* and enable it */
+	}
+	return 1;
+}
+__setup("l3cr=", ppc_setup_l3cr);
+
 #ifdef CONFIG_GENERIC_NVRAM
 
 /* Generic nvram hooks used by drivers/char/gen_nvram.c */

--- linux-2.6.24/Documentation/kernel-parameters.txt.orig	2008-03-25 12:30:09.688082305 -0500
+++ linux-2.6.24/Documentation/kernel-parameters.txt	2008-03-25 12:30:29.816083202 -0500
@@ -877,6 +877,8 @@ and is between 256 and 4096 characters. 
 
 	l2cr=		[PPC]
 
+	l3cr=		[PPC]
+
 	lapic		[X86-32,APIC] Enable the local APIC even if BIOS
 			disabled it.
 

^ permalink raw reply

* Re: [PATCH 15/18] ide: remove broken/dangerous HDIO_[UNREGISTER, SCAN]_HWIF ioctls
From: Mark Lord @ 2008-03-28 19:14 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-ide, linux-kernel, Bartlomiej Zolnierkiewicz, linuxppc-dev
In-Reply-To: <47EBDBAA.2020308@ru.mvista.com>

Sergei Shtylyov wrote:
> Bartlomiej Zolnierkiewicz wrote:
> 
>> hdparm explicitely marks HDIO_[UNREGISTER,SCAN]_HWIF ioctls as DANGEROUS
>> and given the number of bugs we can assume that there are no real users:
..

There is the odd user of these, actually.

But the most recent to email me (a few weeks ago),
reported that the SCAN function was no longer working on his kernel.

I'll remove the -R and -U flags completely from hdparm-8.7.

Cheers

^ permalink raw reply

* Re: [PATCH 1/3] mpc83xx: fix usb phy_type in mpc837x rdb device trees
From: Kim Phillips @ 2008-03-28 19:46 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <163986FE-1FE0-4FAB-AACA-6E2605CF4094@kernel.crashing.org>

On Fri, 28 Mar 2008 14:37:51 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:

> 
> On Mar 28, 2008, at 11:44 AM, Anton Vorontsov wrote:
> > On Fri, Mar 28, 2008 at 10:51:25AM -0500, Kim Phillips wrote:
> >> the mpc837x rdb board uses low pin count interfaces (ULPI) to connect
> >> to the USB PHY.
> >
> > I've sent this fix two weeks ago...
> >
> > http://ozlabs.org/pipermail/linuxppc-dev/2008-March/052926.html
> >
> >> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> 
> I'll apply Anton's version and add a signed-off-by Kim.

agreed, thanks!

Kim

^ permalink raw reply

* Re: [PATCH 1/3] mpc83xx: fix usb phy_type in mpc837x rdb device trees
From: Kumar Gala @ 2008-03-28 19:37 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080328164441.GA7146@localhost.localdomain>


On Mar 28, 2008, at 11:44 AM, Anton Vorontsov wrote:
> On Fri, Mar 28, 2008 at 10:51:25AM -0500, Kim Phillips wrote:
>> the mpc837x rdb board uses low pin count interfaces (ULPI) to connect
>> to the USB PHY.
>
> I've sent this fix two weeks ago...
>
> http://ozlabs.org/pipermail/linuxppc-dev/2008-March/052926.html
>
>> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

I'll apply Anton's version and add a signed-off-by Kim.

- k

^ permalink raw reply

* Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs during nand write [was: Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X]
From: Scott Wood @ 2008-03-28 19:15 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev, linux-mtd
In-Reply-To: <20080328191054.GA30765@localhost.localdomain>

Anton Vorontsov wrote:
> From: Anton Vorontsov <avorontsov@ru.mvista.com>
> Subject: mtd/nand/fsl_elbc_nand: workaround for hangs during nand write
> 
> Using current driver elbc sometimes hangs during nand write. Reading back
> last byte helps though (thanks to Scott Wood for the idea).
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

^ permalink raw reply

* [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs during nand write [was: Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X]
From: Anton Vorontsov @ 2008-03-28 19:10 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, linux-mtd
In-Reply-To: <47ED3EC5.8030508@freescale.com>

On Fri, Mar 28, 2008 at 01:53:57PM -0500, Scott Wood wrote:
> Anton Vorontsov wrote:
> >@@ -495,6 +495,16 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, 
> >const u8 *buf, int len)
> > 	}
> > 
> > 	memcpy_toio(&ctrl->addr[ctrl->index], buf, len);
> >+#ifdef CONFIG_PPC_MPC837x
> >+	/*
> >+	 * This is workaround for the weird elbc hangs on the MPC837X CPUs,
> >+	 * Scott Wood says: "...perhaps difference in how long it takes a
> >+	 * write to make it through the localbus compared to a write to IMMR
> >+	 * is causing problems, and sync isn't helping for some reason."
> >+	 * Reading back the last byte helps though.
> >+	 */
> >+	in_8(&ctrl->addr[ctrl->index] + len - 1);
> >+#endif
> 
> Let's do it regardless of chip -- odds are the issue exists on all 
> implementations, and it's just a function of what frequencies things are 
> running at.

Ok.

- - - -
From: Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: mtd/nand/fsl_elbc_nand: workaround for hangs during nand write

Using current driver elbc sometimes hangs during nand write. Reading back
last byte helps though (thanks to Scott Wood for the idea).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/mtd/nand/fsl_elbc_nand.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 378b7aa..2f4ce2a 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -480,7 +480,7 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 	struct fsl_elbc_ctrl *ctrl = priv->ctrl;
 	unsigned int bufsize = mtd->writesize + mtd->oobsize;
 
-	if (len < 0) {
+	if (len <= 0) {
 		dev_err(ctrl->dev, "write_buf of %d bytes", len);
 		ctrl->status = 0;
 		return;
@@ -495,6 +495,15 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 	}
 
 	memcpy_toio(&ctrl->addr[ctrl->index], buf, len);
+	/*
+	 * This is workaround for the weird elbc hangs during nand write,
+	 * Scott Wood says: "...perhaps difference in how long it takes a
+	 * write to make it through the localbus compared to a write to IMMR
+	 * is causing problems, and sync isn't helping for some reason."
+	 * Reading back the last byte helps though.
+	 */
+	in_8(&ctrl->addr[ctrl->index] + len - 1);
+
 	ctrl->index += len;
 }
 
-- 
1.5.2.2

^ permalink raw reply related

* Re: [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X
From: Scott Wood @ 2008-03-28 18:53 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linuxppc-dev, linux-mtd
In-Reply-To: <20080328184303.GA25882@localhost.localdomain>

Anton Vorontsov wrote:
> @@ -495,6 +495,16 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
>  	}
>  
>  	memcpy_toio(&ctrl->addr[ctrl->index], buf, len);
> +#ifdef CONFIG_PPC_MPC837x
> +	/*
> +	 * This is workaround for the weird elbc hangs on the MPC837X CPUs,
> +	 * Scott Wood says: "...perhaps difference in how long it takes a
> +	 * write to make it through the localbus compared to a write to IMMR
> +	 * is causing problems, and sync isn't helping for some reason."
> +	 * Reading back the last byte helps though.
> +	 */
> +	in_8(&ctrl->addr[ctrl->index] + len - 1);
> +#endif

Let's do it regardless of chip -- odds are the issue exists on all 
implementations, and it's just a function of what frequencies things are 
running at.

-Scott

^ permalink raw reply

* [PATCH] mtd/nand/fsl_elbc_nand: workaround for hangs on MPC837X
From: Anton Vorontsov @ 2008-03-28 18:43 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: Scott Wood

Using current driver on the MPC837X CPUs elbc hangs during nand write.
Reading last byte helps though (thanks to Scott Wood for the idea).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/mtd/nand/fsl_elbc_nand.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 378b7aa..be4c05d 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -480,7 +480,7 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 	struct fsl_elbc_ctrl *ctrl = priv->ctrl;
 	unsigned int bufsize = mtd->writesize + mtd->oobsize;
 
-	if (len < 0) {
+	if (len <= 0) {
 		dev_err(ctrl->dev, "write_buf of %d bytes", len);
 		ctrl->status = 0;
 		return;
@@ -495,6 +495,16 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 	}
 
 	memcpy_toio(&ctrl->addr[ctrl->index], buf, len);
+#ifdef CONFIG_PPC_MPC837x
+	/*
+	 * This is workaround for the weird elbc hangs on the MPC837X CPUs,
+	 * Scott Wood says: "...perhaps difference in how long it takes a
+	 * write to make it through the localbus compared to a write to IMMR
+	 * is causing problems, and sync isn't helping for some reason."
+	 * Reading back the last byte helps though.
+	 */
+	in_8(&ctrl->addr[ctrl->index] + len - 1);
+#endif
 	ctrl->index += len;
 }
 
-- 
1.5.2.2

^ permalink raw reply related

* [PATCH] [POWERPC] Move phys_addr_t definition into asm/types.h
From: Kumar Gala @ 2008-03-28 18:38 UTC (permalink / raw)
  To: linuxppc-dev

Moved phys_addr_t out of mmu-*.h and into asm/types.h so we can use it in
places that before would have caused recursive includes.

For example to use phys_addr_t in <asm/page.h> we would have included
<asm/mmu.h> which would have possibly included <asm/mmu-hash64.h> which
includes <asm/page.h>.  Wheeee recursive include.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 include/asm-powerpc/mmu-40x.h       |    2 --
 include/asm-powerpc/mmu-44x.h       |    2 --
 include/asm-powerpc/mmu-8xx.h       |    2 --
 include/asm-powerpc/mmu-fsl-booke.h |    6 ------
 include/asm-powerpc/mmu-hash32.h    |    2 --
 include/asm-powerpc/mmu-hash64.h    |    3 ---
 include/asm-powerpc/types.h         |    7 +++++++
 7 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/include/asm-powerpc/mmu-40x.h b/include/asm-powerpc/mmu-40x.h
index 7d37f77..3d10867 100644
--- a/include/asm-powerpc/mmu-40x.h
+++ b/include/asm-powerpc/mmu-40x.h
@@ -53,8 +53,6 @@

 #ifndef __ASSEMBLY__

-typedef unsigned long phys_addr_t;
-
 typedef struct {
 	unsigned long id;
 	unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
index 62772ae..c8b02d9 100644
--- a/include/asm-powerpc/mmu-44x.h
+++ b/include/asm-powerpc/mmu-44x.h
@@ -53,8 +53,6 @@

 #ifndef __ASSEMBLY__

-typedef unsigned long long phys_addr_t;
-
 typedef struct {
 	unsigned long id;
 	unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-8xx.h b/include/asm-powerpc/mmu-8xx.h
index 952bd88..9db877e 100644
--- a/include/asm-powerpc/mmu-8xx.h
+++ b/include/asm-powerpc/mmu-8xx.h
@@ -136,8 +136,6 @@
 #define SPRN_M_TW	799

 #ifndef __ASSEMBLY__
-typedef unsigned long phys_addr_t;
-
 typedef struct {
 	unsigned long id;
 	unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-fsl-booke.h b/include/asm-powerpc/mmu-fsl-booke.h
index 3758000..925d93c 100644
--- a/include/asm-powerpc/mmu-fsl-booke.h
+++ b/include/asm-powerpc/mmu-fsl-booke.h
@@ -73,12 +73,6 @@

 #ifndef __ASSEMBLY__

-#ifndef CONFIG_PHYS_64BIT
-typedef unsigned long phys_addr_t;
-#else
-typedef unsigned long long phys_addr_t;
-#endif
-
 typedef struct {
 	unsigned long id;
 	unsigned long vdso_base;
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
index 4bd735b..6e21ca6 100644
--- a/include/asm-powerpc/mmu-hash32.h
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -84,8 +84,6 @@ typedef struct {
 	unsigned long vdso_base;
 } mm_context_t;

-typedef unsigned long phys_addr_t;
-
 #endif /* !__ASSEMBLY__ */

 #endif /* _ASM_POWERPC_MMU_HASH32_H_ */
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 2864fa3..0dff767 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -469,9 +469,6 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
 				 VSID_MODULUS_256M)
 #define KERNEL_VSID(ea)		VSID_SCRAMBLE(GET_ESID(ea))

-/* Physical address used by some IO functions */
-typedef unsigned long phys_addr_t;
-
 #endif /* __ASSEMBLY__ */

 #endif /* _ASM_POWERPC_MMU_HASH64_H_ */
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index 903fd19..020db52 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -50,6 +50,13 @@ typedef struct {
 	__u32 u[4];
 } __attribute__((aligned(16))) __vector128;

+/* Physical address used by some IO functions */
+#ifndef CONFIG_PHYS_64BIT
+typedef unsigned long phys_addr_t;
+#else
+typedef unsigned long long phys_addr_t;
+#endif
+
 #endif /* __ASSEMBLY__ */

 #ifdef __KERNEL__
-- 
1.5.4.1

^ permalink raw reply related

* Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU
From: York Sun @ 2008-03-28 18:18 UTC (permalink / raw)
  To: avorontsov
  Cc: linux-fbdev-devel, a.p.zijlstra, linux-kernel, linuxppc-dev,
	Scott Wood, akpm, Timur Tabi
In-Reply-To: <20080328174853.GA1438@localhost.localdomain>

On Fri, 2008-03-28 at 20:48 +0300, Anton Vorontsov wrote:
> > >+		if (copy_from_user(&pix_fmt, (void __user *)arg,
> > >+				sizeof(pix_fmt)))
> > 
> > OK, you fixed the cast here...
> 
> Maybe better would be to define "buf" at the top of this function as
> void __user *buf = (void __user *)arg;, i.e. just once?

I think it is a good idea.

> 
> > 
> > >+			return -EFAULT;
> > >+		ad->pix_fmt = pix_fmt;
> > >+		pr_debug("Set pixel format to 0x%08x\n", ad->pix_fmt);
> > >+		break;
> > >+	case MFB_GET_PIXFMT:
> > >+		if (!arg)
> > >+			return -EINVAL;
> 
> This if (!arg) appears to be everywhere except default: label, maybe
> this could be placed on top too?
Will do that, too.

York

^ permalink raw reply

* Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU
From: Scott Wood @ 2008-03-28 18:09 UTC (permalink / raw)
  To: Timur Tabi
  Cc: linux-fbdev-devel, a.p.zijlstra, linux-kernel, linuxppc-dev, akpm,
	York Sun
In-Reply-To: <47ED33C6.3090202@freescale.com>

Timur Tabi wrote:
> Scott Wood wrote:
> 
>> ...but not anywhere else.  All user pointers should have a __user 
>> annotation.
> 
> Even in a typecast?

Yes.  Otherwise, as far as sparse sees, you're passing a kernel pointer 
to something expecting a user pointer.

-Scott

^ permalink raw reply

* Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU
From: Timur Tabi @ 2008-03-28 18:07 UTC (permalink / raw)
  To: Scott Wood
  Cc: linux-fbdev-devel, a.p.zijlstra, linux-kernel, linuxppc-dev, akpm,
	York Sun
In-Reply-To: <47ED2B35.4030601@freescale.com>

Scott Wood wrote:

> ...but not anywhere else.  All user pointers should have a __user 
> annotation.

Even in a typecast?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
From: Scott Wood @ 2008-03-28 18:07 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev
In-Reply-To: <200803281854.28595.laurentp@cse-semaphore.com>

Laurent Pinchart wrote:
> On Friday 28 March 2008 18:11, Scott Wood wrote:
>> Laurent Pinchart wrote:
>>> Locating the end of the muram isn't as straightforward as it
>>> could be. As the current code already uses the beginning of the
>>> muram to store the BDs and data buffers, should I really bother
>>> locating the end or can I store the SMC parameter ram at the
>>> beginning as well ?
>> Maybe, but the end would be safer.  What's the problem with finding
>> the end?
> 
> That requires manual parsing of all the cells in the reg property.
> The device-tree API doesn't provide a way to get the length of a
> property,

Sure it does.  Do a getprop with an insufficiently large buffer, and it
tells you how much you really need. :-)

> so I'll have to use a big enough pre-allocated buffer. I'm also not
> sure if resources are guaranteed to be sorted in increasing order.

Ah, good point.

> This doesn't make finding the end of the muram really difficult. I
> was just wondering if the increased code complexity was worth it,
> especially seeing how the cpm_serial code in the boot wrapper seem
> quite unstable.

Unstable in what way?

> I'm not familiar with the boot wrapper code so I'm sometimes not very
>  confident in my assumptions, but isn't the handling of the
> virtual-reg property in cpm_console_init broken ?

Not as far as I can see.

> If I'm not mistaken, getprop will return the address and size of the
> first resource and not the addresses of the first two resources.

No, it'll get as much of the virtual-reg property as will fit in the 
buffer.  There's no size in virtual-reg.

> What is virtual-reg used for ? To report the virtual address without
> requiring a device tree walk ? Does it provide any information that
> dt_xlate_reg can't find ?

Yes, it tells you the virtual address when it's not an identity mapping. 
  It's not currently used on CPM platforms, but might be used down the 
road with a QE device on 85xx.

>> Even the end of the first reg resource would be OK.
> 
> If I use the end of the first resource, can I assume it spans 0x0000
> - 0x8000 to set the default tx BD address in Kconfig ?

No, especially seeing as it doesn't on any existing boards. :-)

You could set the default to just before 0x2000 with board-specific 
exceptions, though.

-Scott

^ permalink raw reply

* Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
From: Laurent Pinchart @ 2008-03-28 17:54 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <47ED26BE.2080507@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 2621 bytes --]

On Friday 28 March 2008 18:11, Scott Wood wrote:
> Laurent Pinchart wrote:
> > Locating the end of the muram isn't as straightforward as it could be. As
> > the current code already uses the beginning of the muram to store the BDs
> > and data buffers, should I really bother locating the end or can I store
> > the SMC parameter ram at the beginning as well ?
> 
> Maybe, but the end would be safer.  What's the problem with finding the 
> end?

That requires manual parsing of all the cells in the reg property. The 
device-tree API doesn't provide a way to get the length of a property, so 
I'll have to use a big enough pre-allocated buffer. I'm also not sure if 
resources are guaranteed to be sorted in increasing order.

This doesn't make finding the end of the muram really difficult. I was just 
wondering if the increased code complexity was worth it, especially seeing 
how the cpm_serial code in the boot wrapper seem quite unstable.

I'm not familiar with the boot wrapper code so I'm sometimes not very 
confident in my assumptions, but isn't the handling of the virtual-reg 
property in cpm_console_init broken ?

        void *reg_virt[2];

	...

        n = getprop(devp, "virtual-reg", reg_virt, sizeof(reg_virt));
        if (n < (int)sizeof(reg_virt)) {
                for (n = 0; n < 2; n++) {
                        if (!dt_xlate_reg(devp, n, &reg_phys, NULL))
                                return -1;

                        reg_virt[n] = (void *)reg_phys;
                }
        }

        if (is_smc)
                smc = reg_virt[0];
        else
                scc = reg_virt[0];

        param = reg_virt[1];

If I'm not mistaken, getprop will return the address and size of the first 
resource and not the addresses of the first two resources. What is 
virtual-reg used for ? To report the virtual address without requiring a 
device tree walk ? Does it provide any information that dt_xlate_reg can't 
find ?

> Even the end of the first reg resource would be OK. 

If I use the end of the first resource, can I assume it spans 0x0000 - 0x8000 
to set the default tx BD address in Kconfig ?

> > If I'm not mistaken, once the SMC parameter ram gets relocated to the 
> > beginning/end of the muram, the boot loader preallocated space can be 
> > reclaimed and can be added to the muram in the device tree like I did in
> > my previous patch. Is that correct ?
> 
> Yes.

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU
From: Anton Vorontsov @ 2008-03-28 17:48 UTC (permalink / raw)
  To: Scott Wood
  Cc: linux-fbdev-devel, a.p.zijlstra, linux-kernel, Timur Tabi,
	linuxppc-dev, akpm, York Sun
In-Reply-To: <47ED2B35.4030601@freescale.com>

On Fri, Mar 28, 2008 at 12:30:29PM -0500, Scott Wood wrote:
> York Sun wrote:
> >+static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
> >+		       unsigned long arg)
> >+{
> >+	struct mfb_info *mfbi = info->par;
> >+	struct diu_ad *ad = mfbi->ad;
> >+	struct mfb_chroma_key ck;
> >+	unsigned char global_alpha;
> >+	struct aoi_display_offset aoi_d;
> >+	__u32 pix_fmt;
> >+
> >+	switch (cmd) {
> >+	case MFB_SET_PIXFMT:
> >+		if (!arg)
> >+			return -EINVAL;
> >+		if (copy_from_user(&pix_fmt, (void __user *)arg,
> >+				sizeof(pix_fmt)))
> 
> OK, you fixed the cast here...

Maybe better would be to define "buf" at the top of this function as
void __user *buf = (void __user *)arg;, i.e. just once?

> 
> >+			return -EFAULT;
> >+		ad->pix_fmt = pix_fmt;
> >+		pr_debug("Set pixel format to 0x%08x\n", ad->pix_fmt);
> >+		break;
> >+	case MFB_GET_PIXFMT:
> >+		if (!arg)
> >+			return -EINVAL;

This if (!arg) appears to be everywhere except default: label, maybe
this could be placed on top too?

> >+		pix_fmt = ad->pix_fmt;
> >+		if (copy_to_user((void *)arg, &pix_fmt, sizeof(pix_fmt)))
> >+			return -EFAULT;
> >+		pr_debug("get pixel format 0x%08x\n", ad->pix_fmt);
> >+		break;
> >+	case MFB_SET_AOID:
> >+		if (!arg)
> >+			return -EINVAL;
> >+		if (copy_from_user(&aoi_d, (void *)arg, sizeof(aoi_d)))
> >+			return -EFAULT;
> 
> ...but not anywhere else.  All user pointers should have a __user 
> annotation.

-- 
Anton Vorontsov
email: cboumailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH 1/2 v4] Driver for Freescale 8610 and 5121 DIU
From: Scott Wood @ 2008-03-28 17:30 UTC (permalink / raw)
  To: York Sun
  Cc: linux-fbdev-devel, a.p.zijlstra, linux-kernel, linuxppc-dev, akpm,
	Timur Tabi
In-Reply-To: <12066720572314-git-send-email-yorksun@freescale.com>

York Sun wrote:
> +static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
> +		       unsigned long arg)
> +{
> +	struct mfb_info *mfbi = info->par;
> +	struct diu_ad *ad = mfbi->ad;
> +	struct mfb_chroma_key ck;
> +	unsigned char global_alpha;
> +	struct aoi_display_offset aoi_d;
> +	__u32 pix_fmt;
> +
> +	switch (cmd) {
> +	case MFB_SET_PIXFMT:
> +		if (!arg)
> +			return -EINVAL;
> +		if (copy_from_user(&pix_fmt, (void __user *)arg,
> +				sizeof(pix_fmt)))

OK, you fixed the cast here...

> +			return -EFAULT;
> +		ad->pix_fmt = pix_fmt;
> +		pr_debug("Set pixel format to 0x%08x\n", ad->pix_fmt);
> +		break;
> +	case MFB_GET_PIXFMT:
> +		if (!arg)
> +			return -EINVAL;
> +		pix_fmt = ad->pix_fmt;
> +		if (copy_to_user((void *)arg, &pix_fmt, sizeof(pix_fmt)))
> +			return -EFAULT;
> +		pr_debug("get pixel format 0x%08x\n", ad->pix_fmt);
> +		break;
> +	case MFB_SET_AOID:
> +		if (!arg)
> +			return -EINVAL;
> +		if (copy_from_user(&aoi_d, (void *)arg, sizeof(aoi_d)))
> +			return -EFAULT;

...but not anywhere else.  All user pointers should have a __user 
annotation.

> +	default:
> +		printk(KERN_ERR "Unknown ioctl command (0x%08X)\n", cmd);
> +		return 0;

return -ENOIOCTLCMD;

> +	/* Read to clear the status */
> +	status = in_be32(&(hw->int_status));
> +
> +	ret = request_irq(irq, fsl_diu_isr, 0, "diu", 0);
> +	if (ret)
> +		pr_info("Request diu IRQ failed.\n");
> +	else {
> +		ints = INT_PARERR | INT_LS_BF_VS;
> +#if !defined(CONFIG_NOT_COHERENT_CACHE)
> +		ints |=	INT_VSYNC;
> +#endif
> +		if (dr.mode == MFB_MODE2 || dr.mode == MFB_MODE3)
> +			ints |= INT_VSYNC_WB;
> +
> +		/* Read to clear the status */
> +		status = in_be32(&(hw->int_status));
> +		out_be32(&(hw->int_mask), ints);

These parentheses are unnecessary; just do &hw->int_mask, etc.

-Scott

^ permalink raw reply

* Re: [PATCH 2/2 v4] Add DIU platform code for MPC8610HPCD
From: Scott Wood @ 2008-03-28 17:19 UTC (permalink / raw)
  To: York Sun
  Cc: linux-fbdev-devel, a.p.zijlstra, linux-kernel, linuxppc-dev, akpm,
	Timur Tabi
In-Reply-To: <1206672058321-git-send-email-yorksun@freescale.com>

York Sun wrote:
> +	np = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis");
> +	if (np) {
> +		of_address_to_resource(np, 0, &r);
> +		of_node_put(np);
> +		pixis_bdcfg0 = ioremap(r.start + 0x00000008, sizeof(u8));
> +		if (!pixis_bdcfg0) {
> +			printk(KERN_ERR "Err: can't map FPGA cfg register!\n");
> +			return;
> +		}
> +		pixis_arch = ioremap(r.start + 0x00000001, sizeof(u8));
> +		if (!pixis_arch) {
> +			printk(KERN_ERR "Err: can't map FPGA arch register!\n");
> +			return;
> +		}

Just of_iomap() the whole resource, rather than doing it a byte at a time.

> +int __init preallocate_diu_videomemory(void)
> +{
> +	pr_debug("diu_size=%lu\n", diu_ops.diu_size);
> +
> +	diu_ops.diu_mem = __alloc_bootmem(diu_ops.diu_size, 8, 0);
> +	if (!diu_ops.diu_mem) {
> +		printk(KERN_ERR "fsl-diu: cannot allocate %lu bytes\n",
> +			diu_ops.diu_size);
> +		return -ENOMEM;
> +	}
> +
> +	printk(KERN_INFO "%s: diu_mem=%p\n", __func__, diu_ops.diu_mem);

The pr_debug line is more useful information than the KERN_INFO line...

-Scott

^ permalink raw reply

* Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
From: Scott Wood @ 2008-03-28 17:11 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev
In-Reply-To: <200803281726.47566.laurentp@cse-semaphore.com>

Laurent Pinchart wrote:
> Locating the end of the muram isn't as straightforward as it could be. As the 
> current code already uses the beginning of the muram to store the BDs and 
> data buffers, should I really bother locating the end or can I store the SMC 
> parameter ram at the beginning as well ?

Maybe, but the end would be safer.  What's the problem with finding the 
end?  Even the end of the first reg resource would be OK.

> If I'm not mistaken, once the SMC parameter ram gets relocated to the 
> beginning/end of the muram, the boot loader preallocated space can be 
> reclaimed and can be added to the muram in the device tree like I did in my 
> previous patch. Is that correct ?

Yes.

-Scott

^ permalink raw reply

* video driver problems on set top box board
From: BAK @ 2008-03-28 17:01 UTC (permalink / raw)
  To: linuxppc-embedded


I am using a set top box board : MB442 based on STi7109 chip. I use STAPI
(drivers provided by ST) with STlinux kernell. I have some problems with a
module (named mme_host) which must be inserted with arguments (insmod
mme_host.ko transport0=<arguments_to_be_used>). This operation causes the
following error :
insmod: error inserting '/home/bakhaled/modules/mme/mme_host.ko': -1
Operation not permitted
I tried to insert the module without arguments (insmod mme_host.ko) and
this was successful. But when I try to run a test program for video ,
after inserting that mme module without arguments, the system crash down.
(don't execute console commands).
Has any one experienced this type of problems?
Have you any solutions ?
-- 
View this message in context: http://www.nabble.com/video-driver-problems-on-set-top-box-board-tp16354810p16354810.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* [patch] PS3: Split device setup for static vs. dynamic devices
From: Geoff Levand @ 2008-03-28 16:53 UTC (permalink / raw)
  To: paulus; +Cc: Geert Uytterhoeven, linuxppc-dev
In-Reply-To: <47EAEC2B.1000006@am.sony.com>


From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>

Split the device setup code in ps3_register_repository_device() in two
routines:
  1. ps3_setup_static_device(), to handle the setup of static devices in the
     PS3 repository, which can be __init,
  2. ps3_setup_dynamic_device(), to handle the setup of storage devices that
     may appear later in the PS3 repository.

This fixes a few section mismatch warnings.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---

Hi Paul,

Here is another one for 2.6.26 that Geert just sent me.  Please apply.

-Geoff

 arch/powerpc/platforms/ps3/device-init.c |   78 ++++++++++++++++++-------------
 1 file changed, 46 insertions(+), 32 deletions(-)

--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -499,41 +499,14 @@ static int __init ps3_register_graphics_
 }
 
 /**
- * ps3_register_repository_device - Register a device from the repositiory info.
- *
+ * ps3_setup_dynamic_device - Setup a dynamic device from the repository
  */
 
-static int ps3_register_repository_device(
-	const struct ps3_repository_device *repo)
+static int ps3_setup_dynamic_device(const struct ps3_repository_device *repo)
 {
 	int result;
 
 	switch (repo->dev_type) {
-	case PS3_DEV_TYPE_SB_GELIC:
-		result = ps3_setup_gelic_device(repo);
-		if (result) {
-			pr_debug("%s:%d ps3_setup_gelic_device failed\n",
-				__func__, __LINE__);
-		}
-		break;
-	case PS3_DEV_TYPE_SB_USB:
-
-		/* Each USB device has both an EHCI and an OHCI HC */
-
-		result = ps3_setup_ehci_device(repo);
-
-		if (result) {
-			pr_debug("%s:%d ps3_setup_ehci_device failed\n",
-				__func__, __LINE__);
-		}
-
-		result = ps3_setup_ohci_device(repo);
-
-		if (result) {
-			pr_debug("%s:%d ps3_setup_ohci_device failed\n",
-				__func__, __LINE__);
-		}
-		break;
 	case PS3_DEV_TYPE_STOR_DISK:
 		result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK);
 
@@ -572,6 +545,48 @@ static int ps3_register_repository_devic
 	return result;
 }
 
+/**
+ * ps3_setup_static_device - Setup a static device from the repository
+ */
+
+static int __init ps3_setup_static_device(const struct ps3_repository_device *repo)
+{
+	int result;
+
+	switch (repo->dev_type) {
+	case PS3_DEV_TYPE_SB_GELIC:
+		result = ps3_setup_gelic_device(repo);
+		if (result) {
+			pr_debug("%s:%d ps3_setup_gelic_device failed\n",
+				__func__, __LINE__);
+		}
+		break;
+	case PS3_DEV_TYPE_SB_USB:
+
+		/* Each USB device has both an EHCI and an OHCI HC */
+
+		result = ps3_setup_ehci_device(repo);
+
+		if (result) {
+			pr_debug("%s:%d ps3_setup_ehci_device failed\n",
+				__func__, __LINE__);
+		}
+
+		result = ps3_setup_ohci_device(repo);
+
+		if (result) {
+			pr_debug("%s:%d ps3_setup_ohci_device failed\n",
+				__func__, __LINE__);
+		}
+		break;
+
+	default:
+		return ps3_setup_dynamic_device(repo);
+	}
+
+	return result;
+}
+
 static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
 {
 	struct ps3_repository_device repo;
@@ -601,7 +616,7 @@ found:
 		pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
 			 __func__, __LINE__, bus_id, dev_id, retries);
 
-	ps3_register_repository_device(&repo);
+	ps3_setup_dynamic_device(&repo);
 	return;
 }
 
@@ -905,8 +920,7 @@ static int __init ps3_register_devices(v
 
 	ps3_register_graphics_devices();
 
-	ps3_repository_find_devices(PS3_BUS_TYPE_SB,
-		ps3_register_repository_device);
+	ps3_repository_find_devices(PS3_BUS_TYPE_SB, ps3_setup_static_device);
 
 	ps3_register_sound_devices();
 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox