Skip to contentSkip to conversation

Translate printk to dev_* and break lines with more than 80 char

PATCH In review Eduardo Valentin 3 participants 5 messages Sep 13, 2007 – Sep 17, 2007 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 Translate printk to dev_* and break lines with more than 80 char

From: Eduardo Valentin <[email protected]>

This patch:

- Translates printk to dev_*
- Breaks lines with more than 80 columns

---
 arch/arm/mach-omap1/mmu.c       |   10 ++--
 arch/arm/mach-omap2/mmu.c       |   29 ++++++----
 arch/arm/plat-omap/mmu.c        |  107 +++++++++++++++++++--------------------
 include/asm-arm/arch-omap/mmu.h |   15 ++++--
 4 files changed, 85 insertions(+), 76 deletions(-)
arch/arm/mach-omap1/mmu.c +5 -5
index 66aa0d4..baa8c16 100644
@@ -201,8 +201,8 @@ static int omap1_mmu_startup(struct omap_mmu *mmu)
 {
 	dspvect_page = (void *)__get_dma_pages(GFP_KERNEL, 0);
 	if (dspvect_page == NULL) {
-		printk(KERN_ERR "MMU: failed to allocate memory "
-				"for dsp vector table\n");
+		dev_err(&mmu->dev, "MMU: failed to allocate memory "
+			"for dsp vector table\n");
 		return -ENOMEM;
 	}
 
@@ -238,13 +238,13 @@ static inline unsigned long omap1_mmu_cam_va(struct cam_ram_regset *cr)
 }
 
 static struct cam_ram_regset *
-omap1_mmu_cam_ram_alloc(struct omap_mmu_tlb_entry *entry)
+omap1_mmu_cam_ram_alloc(struct omap_mmu *mmu, struct omap_mmu_tlb_entry *entry)
 {
 	struct cam_ram_regset *cr;
 
 	if (entry->va & ~(get_cam_va_mask(entry->pgsz))) {
-		printk(KERN_ERR "MMU: mapping vadr (0x%06lx) is not on an "
-		       "aligned boundary\n", entry->va);
+		dev_err(&mmu->dev, "MMU: mapping vadr (0x%06lx) is not on an "
+			"aligned boundary\n", entry->va);
 		return ERR_PTR(-EINVAL);
 	}
 
arch/arm/mach-omap2/mmu.c +17 -12
index d505fb8..a4e7eb5 100644
@@ -64,7 +64,7 @@ static void exmap_setup_iomap_page(struct omap_mmu *mmu, unsigned long phys,
 
 	dspadr = (IOMAP_VAL << 18) + (dsp_io_adr << 1);
 	virt = omap_mmu_to_virt(mmu, dspadr);
-	exmap_set_armmmu((unsigned long)virt, phys, PAGE_SIZE);
+	exmap_set_armmmu(mmu, (unsigned long)virt, phys, PAGE_SIZE);
 	INIT_EXMAP_TBL_ENTRY_4KB_PRESERVED(mmu->exmap_tbl + index, NULL, virt);
 	INIT_TLB_ENTRY_4KB_ES32_PRESERVED(&tlb_ent, dspadr, phys);
 	omap_mmu_load_pte_entry(mmu, &tlb_ent);
@@ -78,7 +78,7 @@ static void exmap_clear_iomap_page(struct omap_mmu *mmu,
 
 	dspadr = (IOMAP_VAL << 18) + (dsp_io_adr << 1);
 	virt = omap_mmu_to_virt(mmu, dspadr);
-	exmap_clear_armmmu((unsigned long)virt, PAGE_SIZE);
+	exmap_clear_armmmu(mmu, (unsigned long)virt, PAGE_SIZE);
 	/* DSP MMU is shutting down. not handled here. */
 }
 
@@ -153,8 +153,8 @@ static int omap2_mmu_startup(struct omap_mmu *mmu)
 
 	dspvect_page = (void *)__get_dma_pages(GFP_KERNEL, 0);
 	if (dspvect_page == NULL) {
-		printk(KERN_ERR "MMU: failed to allocate memory "
-				"for dsp vector table\n");
+		dev_err(&mmu->dev, "MMU: failed to allocate memory "
+			"for dsp vector table\n");
 		return -ENOMEM;
 	}
 
@@ -261,13 +261,13 @@ static inline unsigned long omap2_mmu_cam_va(struct cam_ram_regset *cr)
 }
 
 static struct cam_ram_regset *
-omap2_mmu_cam_ram_alloc(struct omap_mmu_tlb_entry *entry)
+omap2_mmu_cam_ram_alloc(struct omap_mmu *mmu, struct omap_mmu_tlb_entry *entry)
 {
 	struct cam_ram_regset *cr;
 
 	if (entry->va & ~(get_cam_va_mask(entry->pgsz))) {
-		printk(KERN_ERR "MMU: mapping vadr (0x%06lx) is not on an "
-		       "aligned boundary\n", entry->va);
+		dev_err(&mmu->dev, "MMU: mapping vadr (0x%06lx) is not on an "
+			"aligned boundary\n", entry->va);
 		return ERR_PTR(-EINVAL);
 	}
 
@@ -292,11 +292,16 @@ static void omap2_mmu_interrupt(struct omap_mmu *mmu)
 	status = MMU_IRQ_MASK & omap_mmu_read_reg(mmu, OMAP_MMU_IRQSTATUS);
 	va = omap_mmu_read_reg(mmu, OMAP_MMU_FAULT_AD);
 
-	pr_info("%s\n", (status & OMAP_MMU_IRQ_MULTIHITFAULT)		? "multi hit":"");
-	pr_info("%s\n", (status & OMAP_MMU_IRQ_TABLEWALKFAULT)		? "table walk fault":"");
-	pr_info("%s\n", (status & OMAP_MMU_IRQ_EMUMISS)			? "EMU miss":"");
-	pr_info("%s\n", (status & OMAP_MMU_IRQ_TRANSLATIONFAULT)	? "translation fault":"");
-	pr_info("%s\n", (status & OMAP_MMU_IRQ_TLBMISS)			? "TLB miss":"");
+	pr_info("%s\n", (status & OMAP_MMU_IRQ_MULTIHITFAULT)?
+		"multi hit":"");
+	pr_info("%s\n", (status & OMAP_MMU_IRQ_TABLEWALKFAULT)?
+		"table walk fault":"");
+	pr_info("%s\n", (status & OMAP_MMU_IRQ_EMUMISS)?
+		"EMU miss":"");
+	pr_info("%s\n", (status & OMAP_MMU_IRQ_TRANSLATIONFAULT)?
+		"translation fault":"");
+	pr_info("%s\n", (status & OMAP_MMU_IRQ_TLBMISS)?
+		"TLB miss":"");
 	pr_info("fault address = %#08lx\n", va);
 
 	omap_mmu_disable(mmu);
arch/arm/plat-omap/mmu.c +53 -54

267 lines not on this page · raw message

include/asm-arm/arch-omap/mmu.h +10 -5
index eec5696..6c5869c 100644
@@ -69,7 +69,8 @@ struct omap_mmu_ops {
 	ssize_t (*show)(struct omap_mmu *, char *, struct omap_mmu_tlb_lock *);
 
 	/* CAM / RAM operations */
-	struct cam_ram_regset *(*cam_ram_alloc)(struct omap_mmu_tlb_entry *);
+	struct cam_ram_regset *(*cam_ram_alloc)(struct omap_mmu *,
+						struct omap_mmu_tlb_entry *);
 	int (*cam_ram_valid)(struct cam_ram_regset *);
 	unsigned long (*cam_va)(struct cam_ram_regset *);
 
@@ -182,15 +183,19 @@ void omap_mmu_exmap_flush(struct omap_mmu *mmu);
 void omap_mmu_exmap_use(struct omap_mmu *mmu, void *vadr, size_t len);
 void omap_mmu_exmap_unuse(struct omap_mmu *mmu, void *vadr, size_t len);
 
-int exmap_set_armmmu(unsigned long virt, unsigned long phys, unsigned long size);
-void exmap_clear_armmmu(unsigned long virt, unsigned long size);
+int exmap_set_armmmu(struct omap_mmu *mmu, unsigned long virt,
+		     unsigned long phys, unsigned long size);
+void exmap_clear_armmmu(struct omap_mmu *mmu, unsigned long virt,
+			unsigned long size);
 void exmap_setup_preserved_mem_page(struct omap_mmu *mmu, void *buf,
 				    unsigned long dspadr, int index);
 void exmap_clear_mem_page(struct omap_mmu *mmu, unsigned long dspadr);
 int exmap_valid(struct omap_mmu *mmu, void *vadr, size_t len);
 
 /* To be obsolete for backward compatibility */
-ssize_t __omap_mmu_mem_read(struct omap_mmu *mmu, struct bin_attribute *, char *buf, loff_t offset, size_t count);
-ssize_t __omap_mmu_mem_write(struct omap_mmu *mmu, struct bin_attribute *, char *buf, loff_t offset, size_t count);
+ssize_t __omap_mmu_mem_read(struct omap_mmu *mmu, struct bin_attribute *,
+			    char *buf, loff_t offset, size_t count);
+ssize_t __omap_mmu_mem_write(struct omap_mmu *mmu, struct bin_attribute *,
+			    char *buf, loff_t offset, size_t count);
 
 #endif /* __ARCH_OMAP_MMU_H */
Signature · 1 line
1.5.3.rc6.17.g1911
#2 lore raw

PATCH 2/2 Improve debug messages and removed DSP references from MMU FW code

From: Eduardo Valentin <[email protected]>

As the code is expected to work with another mmu other than DSP mmu; "DSP"
string was removed from the code in the following situations:

- Debug messages
- Local variables name
- Comments

Another improvement is done for debug messages. The MMU name is printed
in debug messages.

---
 arch/arm/mach-omap1/mmu.c |    8 ++--
 arch/arm/mach-omap2/mmu.c |    8 ++--
 arch/arm/plat-omap/mmu.c  |  116 +++++++++++++++++++++++----------------------
 3 files changed, 68 insertions(+), 64 deletions(-)
arch/arm/mach-omap1/mmu.c +4 -4
index baa8c16..f1b682a 100644
@@ -201,8 +201,8 @@ static int omap1_mmu_startup(struct omap_mmu *mmu)
 {
 	dspvect_page = (void *)__get_dma_pages(GFP_KERNEL, 0);
 	if (dspvect_page == NULL) {
-		dev_err(&mmu->dev, "MMU: failed to allocate memory "
-			"for dsp vector table\n");
+		dev_err(&mmu->dev, "MMU %s: failed to allocate memory "
+			"for vector table\n", mmu->name);
 		return -ENOMEM;
 	}
 
@@ -243,8 +243,8 @@ omap1_mmu_cam_ram_alloc(struct omap_mmu *mmu, struct omap_mmu_tlb_entry *entry)
 	struct cam_ram_regset *cr;
 
 	if (entry->va & ~(get_cam_va_mask(entry->pgsz))) {
-		dev_err(&mmu->dev, "MMU: mapping vadr (0x%06lx) is not on an "
-			"aligned boundary\n", entry->va);
+		dev_err(&mmu->dev, "MMU %s: mapping vadr (0x%06lx) is not on"
+			" an aligned boundary\n", mmu->name, entry->va);
 		return ERR_PTR(-EINVAL);
 	}
 
arch/arm/mach-omap2/mmu.c +4 -4
index a4e7eb5..08fbe6b 100644
@@ -153,8 +153,8 @@ static int omap2_mmu_startup(struct omap_mmu *mmu)
 
 	dspvect_page = (void *)__get_dma_pages(GFP_KERNEL, 0);
 	if (dspvect_page == NULL) {
-		dev_err(&mmu->dev, "MMU: failed to allocate memory "
-			"for dsp vector table\n");
+		dev_err(&mmu->dev, "MMU %s: failed to allocate memory "
+			"for vector table\n", mmu->name);
 		return -ENOMEM;
 	}
 
@@ -266,8 +266,8 @@ omap2_mmu_cam_ram_alloc(struct omap_mmu *mmu, struct omap_mmu_tlb_entry *entry)
 	struct cam_ram_regset *cr;
 
 	if (entry->va & ~(get_cam_va_mask(entry->pgsz))) {
-		dev_err(&mmu->dev, "MMU: mapping vadr (0x%06lx) is not on an "
-			"aligned boundary\n", entry->va);
+		dev_err(&mmu->dev, "MMU %s: mapping vadr (0x%06lx) is not on"
+			" an aligned boundary\n", mmu->name, entry->va);
 		return ERR_PTR(-EINVAL);
 	}
 
arch/arm/plat-omap/mmu.c +60 -56

306 lines not on this page · raw message

Signature · 1 line
1.5.3.rc6.17.g1911
#3 lore raw
In reply to Eduardo Valentin
Quoted 7 lines · Eduardo Valentin

From: Eduardo Valentin <[email protected]>

This patch:

- Translates printk to dev_*
- Breaks lines with more than 80 columns

Quoted 7 lines
---
 arch/arm/mach-omap1/mmu.c       |   10 ++--
 arch/arm/mach-omap2/mmu.c       |   29 ++++++----
 arch/arm/plat-omap/mmu.c        |  107 +++++++++++++++++++--------------------
 include/asm-arm/arch-omap/mmu.h |   15 ++++--
 4 files changed, 85 insertions(+), 76 deletions(-)

Is this an update of

http://linux.omap.com/pipermail/linux-omap-open-source/2007-August/011180.html

?

So above patch is outdated?

Just for my patch tracking ;)

Regards

Dirk

#4 lore raw

Hi Dirk,

Yes, the patch I sent last month is outdated. But this new one has
just little differences. I resent it as the last one was not merged and the second on the series is on top of this.

Cheers,

Quoted 30 lines · Dirk Behme
Quoted 7 lines · Eduardo Valentin

From: Eduardo Valentin <[email protected]>

This patch:

- Translates printk to dev_*
- Breaks lines with more than 80 columns

Quoted 7 lines
---
 arch/arm/mach-omap1/mmu.c       |   10 ++--
 arch/arm/mach-omap2/mmu.c       |   29 ++++++----
 arch/arm/plat-omap/mmu.c        |  107 +++++++++++++++++++--------------------
 include/asm-arm/arch-omap/mmu.h |   15 ++++--
 4 files changed, 85 insertions(+), 76 deletions(-)

Is this an update of

http://linux.omap.com/pipermail/linux-omap-open-source/2007-August/011180.html

?

So above patch is outdated?

Just for my patch tracking ;)

Regards

Dirk

Signature · 1 line
Eduardo Bezerra Valentin
maintainer
#5 lore raw
Quoted 6 lines · Eduardo Valentin

Hi Dirk,

Yes, the patch I sent last month is outdated. But this new one has
just little differences. I resent it as the last one was not merged and the second on the series is on top of this.

Pushing both of these today.

Tony