* [Patch] drivers/mtd/maps/tqm8xxl.c: Style cleanups
@ 2007-07-12 15:01 WANG Cong
2007-07-12 16:11 ` Josh Boyer
0 siblings, 1 reply; 9+ messages in thread
From: WANG Cong @ 2007-07-12 15:01 UTC (permalink / raw)
To: kirk, dwmw2; +Cc: akpm, linux-mtd, LKML
Change C++ style comments into K&R's.
Cut long lines into pieces.
This patch is against 2.6.22.1, and can be also applied to
the last -mm tree.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
---
tqm8xxl.c | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
Index: linux-2.6.22.1/drivers/mtd/maps/tqm8xxl.c
===================================================================
--- a/drivers/mtd/maps/tqm8xxl.c 2007-04-26 11:08:32.000000000 +0800
+++ b/drivers/mtd/maps/tqm8xxl.c 2007-07-05 00:16:16.000000000 +0800
@@ -38,7 +38,7 @@
#define FLASH_SIZE 0x00800000
#define FLASH_BANK_MAX 4
-// trivial struct to describe partition information
+/* trivial struct to describe partition information*/
struct mtd_part_def
{
int nums;
@@ -46,7 +46,7 @@
struct mtd_partition* mtd_part;
};
-//static struct mtd_info *mymtd;
+/*static struct mtd_info *mymtd;*/
static struct mtd_info* mtd_banks[FLASH_BANK_MAX];
static struct map_info* map_banks[FLASH_BANK_MAX];
static struct mtd_part_def part_banks[FLASH_BANK_MAX];
@@ -106,7 +106,7 @@
.name = "jffs",
.offset = 0x00200000,
.size = 0x00200000,
- //.size = MTDPART_SIZ_FULL,
+ /*.size = MTDPART_SIZ_FULL,*/
}
};
#endif
@@ -121,10 +121,11 @@
flash_addr = bd->bi_flashstart;
flash_size = bd->bi_flashsize;
- //request maximum flash size address space
+ /*request maximum flash size address space*/
start_scan_addr = ioremap(flash_addr, flash_size);
if (!start_scan_addr) {
- printk(KERN_WARNING "%s:Failed to ioremap address:0x%x\n", __FUNCTION__, flash_addr);
+ printk(KERN_WARNING "%s:Failed to ioremap address:0x%x\n",
+ __FUNCTION__, flash_addr);
return -EIO;
}
@@ -132,12 +133,14 @@
if(mtd_size >= flash_size)
break;
- printk(KERN_INFO "%s: chip probing count %d\n", __FUNCTION__, idx);
+ printk(KERN_INFO "%s: chip probing count %d\n", __FUNCTION__,
+ idx);
map_banks[idx] = kzalloc(sizeof(struct map_info), GFP_KERNEL);
if(map_banks[idx] == NULL) {
ret = -ENOMEM;
- /* FIXME: What if some MTD devices were probed already? */
+ /* FIXME: What if some MTD devices were probed
+ already? */
goto error_mem;
}
@@ -145,7 +148,8 @@
if (!map_banks[idx]->name) {
ret = -ENOMEM;
- /* FIXME: What if some MTD devices were probed already? */
+ /* FIXME: What if some MTD devices were probed
+ already? */
goto error_mem;
}
sprintf(map_banks[idx]->name, "TQM8xxL%d", idx);
@@ -170,7 +174,7 @@
map_banks[idx]->phys += mtd_banks[idx-1]->size;
}
- //start to probe flash chips
+ /*start to probe flash chips*/
mtd_banks[idx] = do_map_probe("cfi_probe", map_banks[idx]);
if (mtd_banks[idx]) {
@@ -178,7 +182,8 @@
mtd_size += mtd_banks[idx]->size;
num_banks++;
- printk(KERN_INFO "%s: bank%d, name:%s, size:%dbytes \n", __FUNCTION__, num_banks,
+ printk(KERN_INFO "%s: bank%d, name:%s, size:%dbytes \n",
+ __FUNCTION__, num_banks,
mtd_banks[idx]->name, mtd_banks[idx]->size);
}
}
@@ -204,17 +209,21 @@
for(idx = 0; idx < num_banks ; idx++) {
if (part_banks[idx].nums == 0) {
- printk(KERN_NOTICE "TQM flash%d: no partition info available, registering whole flash at once\n", idx);
+ printk(KERN_NOTICE "TQM flash%d: no partition info "
+ "available, registering whole flash at once\n",
+ idx);
add_mtd_device(mtd_banks[idx]);
} else {
- printk(KERN_NOTICE "TQM flash%d: Using %s partition definition\n",
- idx, part_banks[idx].type);
- add_mtd_partitions(mtd_banks[idx], part_banks[idx].mtd_part,
- part_banks[idx].nums);
+ printk(KERN_NOTICE "TQM flash%d: Using %s partition "
+ "definition\n",
+ idx, part_banks[idx].type);
+ add_mtd_partitions(mtd_banks[idx],
+ part_banks[idx].mtd_part, part_banks[idx].nums);
}
}
#else
- printk(KERN_NOTICE "TQM flash: registering %d whole flash banks at once\n", num_banks);
+ printk(KERN_NOTICE "TQM flash: registering %d whole flash banks at "
+ "once\n", num_banks);
for(idx = 0 ; idx < num_banks ; idx++)
add_mtd_device(mtd_banks[idx]);
#endif
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Patch] drivers/mtd/maps/tqm8xxl.c: Style cleanups 2007-07-12 15:01 [Patch] drivers/mtd/maps/tqm8xxl.c: Style cleanups WANG Cong @ 2007-07-12 16:11 ` Josh Boyer [not found] ` <20070713034822.GA2370@localhost.localdomain> 0 siblings, 1 reply; 9+ messages in thread From: Josh Boyer @ 2007-07-12 16:11 UTC (permalink / raw) To: WANG Cong; +Cc: kirk, akpm, dwmw2, LKML, linux-mtd On Thu, 2007-07-12 at 23:01 +0800, WANG Cong wrote: > Change C++ style comments into K&R's. > Cut long lines into pieces. > > This patch is against 2.6.22.1, and can be also applied to > the last -mm tree. > > Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> > > --- > > tqm8xxl.c | 41 +++++++++++++++++++++++++---------------- > 1 file changed, 25 insertions(+), 16 deletions(-) > > Index: linux-2.6.22.1/drivers/mtd/maps/tqm8xxl.c > =================================================================== > --- a/drivers/mtd/maps/tqm8xxl.c 2007-04-26 11:08:32.000000000 +0800 > +++ b/drivers/mtd/maps/tqm8xxl.c 2007-07-05 00:16:16.000000000 +0800 > @@ -38,7 +38,7 @@ > #define FLASH_SIZE 0x00800000 > #define FLASH_BANK_MAX 4 > > -// trivial struct to describe partition information > +/* trivial struct to describe partition information*/ Needs a space at the end. > struct mtd_part_def > { > int nums; > @@ -46,7 +46,7 @@ > struct mtd_partition* mtd_part; > }; > > -//static struct mtd_info *mymtd; > +/*static struct mtd_info *mymtd;*/ Just delete this... > static struct mtd_info* mtd_banks[FLASH_BANK_MAX]; > static struct map_info* map_banks[FLASH_BANK_MAX]; > static struct mtd_part_def part_banks[FLASH_BANK_MAX]; > @@ -106,7 +106,7 @@ > .name = "jffs", > .offset = 0x00200000, > .size = 0x00200000, > - //.size = MTDPART_SIZ_FULL, > + /*.size = MTDPART_SIZ_FULL,*/ Delete it... > } > }; > #endif > @@ -121,10 +121,11 @@ > flash_addr = bd->bi_flashstart; > flash_size = bd->bi_flashsize; > > - //request maximum flash size address space > + /*request maximum flash size address space*/ Spaces needed (repeat for the rest of the ones that don't have spaces either). josh ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20070713034822.GA2370@localhost.localdomain>]
* Re: [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups [not found] ` <20070713034822.GA2370@localhost.localdomain> @ 2007-07-13 9:56 ` David Woodhouse 2007-07-13 13:14 ` WANG Cong 0 siblings, 1 reply; 9+ messages in thread From: David Woodhouse @ 2007-07-13 9:56 UTC (permalink / raw) To: WANG Cong; +Cc: kirk, akpm, LKML, linux-mtd On Fri, 2007-07-13 at 11:48 +0800, WANG Cong wrote: > if(map_banks[idx] == NULL) { > ret = -ENOMEM; > - /* FIXME: What if some MTD devices were probed already? */ > + /* FIXME: What if some MTD devices were probed > + already? */ > goto error_mem; > } That's just horrid. Leave it as it was. -- dwmw2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups 2007-07-13 9:56 ` [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups David Woodhouse @ 2007-07-13 13:14 ` WANG Cong 2007-07-13 13:38 ` David Woodhouse 0 siblings, 1 reply; 9+ messages in thread From: WANG Cong @ 2007-07-13 13:14 UTC (permalink / raw) To: David Woodhouse; +Cc: kirk, akpm, LKML, linux-mtd On Fri, Jul 13, 2007 at 10:56:42AM +0100, David Woodhouse wrote: >On Fri, 2007-07-13 at 11:48 +0800, WANG Cong wrote: >> if(map_banks[idx] == NULL) { >> ret = -ENOMEM; >> - /* FIXME: What if some MTD devices were probed already? */ >> + /* FIXME: What if some MTD devices were probed >> + already? */ >> goto error_mem; >> } > > >That's just horrid. Leave it as it was. > Sorry, I can't fully understand you. You mean only the above change is horrid or the entire patch? I have some questions about mtd/maps drivers. Even when I use `make allyesconfig`, I still can't compile some drivers. I should add the corresponding CONFIGs manually. Why this? And I still got some errors and warnings, such as: drivers/mtd/maps/pmcmsp-flash.c:40:22: error: msp_prom.h: No such file or directory drivers/mtd/maps/pmcmsp-flash.c:41:22: error: msp_regs.h: No such file or directory drivers/mtd/maps/pmcmsp-flash.c: In function 'init_msp_flash': drivers/mtd/maps/pmcmsp-flash.c:62: error: 'DEV_ID_REG' undeclared (first use in this function) drivers/mtd/maps/pmcmsp-flash.c:62: error: (Each undeclared identifier is reported only once drivers/mtd/maps/pmcmsp-flash.c:62: error: for each function it appears in.) drivers/mtd/maps/pmcmsp-flash.c:62: error: 'DEV_ID_SINGLE_PC' undeclared (first use in this function) drivers/mtd/maps/pmcmsp-flash.c:63: error: 'ELB_1PC_EN_REG' undeclared (first use in this function) drivers/mtd/maps/pmcmsp-flash.c:63: error: 'SINGLE_PCCARD' undeclared (first use in this function) Did I miss something? Thanks! -- If loving computers is wrong, I don't want to be right. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups 2007-07-13 13:14 ` WANG Cong @ 2007-07-13 13:38 ` David Woodhouse 2007-07-13 14:24 ` Ralf Baechle 0 siblings, 1 reply; 9+ messages in thread From: David Woodhouse @ 2007-07-13 13:38 UTC (permalink / raw) To: WANG Cong; +Cc: akpm, LKML, ralf, kirk, linux-mtd On Fri, 2007-07-13 at 21:14 +0800, WANG Cong wrote: > On Fri, Jul 13, 2007 at 10:56:42AM +0100, David Woodhouse wrote: > >On Fri, 2007-07-13 at 11:48 +0800, WANG Cong wrote: > >> if(map_banks[idx] == NULL) { > >> ret = -ENOMEM; > >> - /* FIXME: What if some MTD devices were probed already? */ > >> + /* FIXME: What if some MTD devices were probed > >> + already? */ > >> goto error_mem; > >> } > > > > > >That's just horrid. Leave it as it was. > > > > Sorry, I can't fully understand you. You mean only the above change is horrid or > the entire patch? Just the above change. See Linus' comments about strict limits on 80 columns being a Nazi dream. > I have some questions about mtd/maps drivers. Even when I use `make allyesconfig`, > I still can't compile some drivers. I should add the corresponding CONFIGs manually. > Why this? And I still got some errors and warnings, such as: > > drivers/mtd/maps/pmcmsp-flash.c:40:22: error: msp_prom.h: No such file or directory > drivers/mtd/maps/pmcmsp-flash.c:41:22: error: msp_regs.h: No such file or directory > drivers/mtd/maps/pmcmsp-flash.c: In function 'init_msp_flash': > drivers/mtd/maps/pmcmsp-flash.c:62: error: 'DEV_ID_REG' undeclared (first use in this function) > drivers/mtd/maps/pmcmsp-flash.c:62: error: (Each undeclared identifier is reported only once > drivers/mtd/maps/pmcmsp-flash.c:62: error: for each function it appears in.) > drivers/mtd/maps/pmcmsp-flash.c:62: error: 'DEV_ID_SINGLE_PC' undeclared (first use in this function) > drivers/mtd/maps/pmcmsp-flash.c:63: error: 'ELB_1PC_EN_REG' undeclared (first use in this function) > drivers/mtd/maps/pmcmsp-flash.c:63: error: 'SINGLE_PCCARD' undeclared (first use in this function) > > Did I miss something? I think that map driver should probably depend on CONFIG_PMC_MSP. Ralf? -- dwmw2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups 2007-07-13 13:38 ` David Woodhouse @ 2007-07-13 14:24 ` Ralf Baechle 2007-07-13 14:31 ` David Woodhouse 2007-07-13 15:05 ` WANG Cong 0 siblings, 2 replies; 9+ messages in thread From: Ralf Baechle @ 2007-07-13 14:24 UTC (permalink / raw) To: David Woodhouse; +Cc: akpm, LKML, kirk, linux-mtd, WANG Cong On Fri, Jul 13, 2007 at 02:38:03PM +0100, David Woodhouse wrote: > > drivers/mtd/maps/pmcmsp-flash.c:63: error: 'ELB_1PC_EN_REG' undeclared (first use in this function) > > drivers/mtd/maps/pmcmsp-flash.c:63: error: 'SINGLE_PCCARD' undeclared (first use in this function) > > > > Did I miss something? > > I think that map driver should probably depend on CONFIG_PMC_MSP. Ralf? *confused* 68aa0fa87f6d4b2f5e8ad39ecaec8bba9137bb3d did add: +config MTD_PMC_MSP_EVM + tristate "CFI Flash device mapped on PMC-Sierra MSP" + depends on PMC_MSP && MTD_CFI + select MTD_PARTITIONS drivers/mtd/maps/Makefile:obj-$(CONFIG_MTD_PMC_MSP_EVM) += pmcmsp-flash.o Is he trying to build something else than very recent kernel.org tree? Ralf ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups 2007-07-13 14:24 ` Ralf Baechle @ 2007-07-13 14:31 ` David Woodhouse 2007-07-13 15:11 ` WANG Cong 2007-07-13 15:05 ` WANG Cong 1 sibling, 1 reply; 9+ messages in thread From: David Woodhouse @ 2007-07-13 14:31 UTC (permalink / raw) To: Ralf Baechle; +Cc: akpm, LKML, kirk, linux-mtd, WANG Cong On Fri, 2007-07-13 at 15:24 +0100, Ralf Baechle wrote: > +config MTD_PMC_MSP_EVM > + tristate "CFI Flash device mapped on PMC-Sierra MSP" > + depends on PMC_MSP && MTD_CFI > + select MTD_PARTITIONS > > drivers/mtd/maps/Makefile:obj-$(CONFIG_MTD_PMC_MSP_EVM) += > pmcmsp-flash.o > > Is he trying to build something else than very recent kernel.org > tree? Hm. His mail did say "Even when I use `make allyesconfig`, I still can't compile some drivers. I should add the corresponding CONFIGs manually." I wonder if he disabled the correct conditions and then tried building it in an i386 kernel? -- dwmw2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups 2007-07-13 14:31 ` David Woodhouse @ 2007-07-13 15:11 ` WANG Cong 0 siblings, 0 replies; 9+ messages in thread From: WANG Cong @ 2007-07-13 15:11 UTC (permalink / raw) To: David Woodhouse; +Cc: akpm, LKML, Ralf Baechle, kirk, linux-mtd On Fri, Jul 13, 2007 at 03:31:29PM +0100, David Woodhouse wrote: >On Fri, 2007-07-13 at 15:24 +0100, Ralf Baechle wrote: >> +config MTD_PMC_MSP_EVM >> + tristate "CFI Flash device mapped on PMC-Sierra MSP" >> + depends on PMC_MSP && MTD_CFI >> + select MTD_PARTITIONS >> >> drivers/mtd/maps/Makefile:obj-$(CONFIG_MTD_PMC_MSP_EVM) += >> pmcmsp-flash.o >> >> Is he trying to build something else than very recent kernel.org >> tree? > >Hm. His mail did say "Even when I use `make allyesconfig`, I still can't >compile some drivers. I should add the corresponding CONFIGs manually." > >I wonder if he disabled the correct conditions and then tried building >it in an i386 kernel? > Er, I first used 'make allyesconfig', then added CONFIG_MTD_PMC_MSP_EVM=y manually. And yes, I am on i386. -- If loving computers is wrong, I don't want to be right. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups 2007-07-13 14:24 ` Ralf Baechle 2007-07-13 14:31 ` David Woodhouse @ 2007-07-13 15:05 ` WANG Cong 1 sibling, 0 replies; 9+ messages in thread From: WANG Cong @ 2007-07-13 15:05 UTC (permalink / raw) To: Ralf Baechle; +Cc: akpm, LKML, kirk, linux-mtd, David Woodhouse On Fri, Jul 13, 2007 at 03:24:43PM +0100, Ralf Baechle wrote: >On Fri, Jul 13, 2007 at 02:38:03PM +0100, David Woodhouse wrote: > >> > drivers/mtd/maps/pmcmsp-flash.c:63: error: 'ELB_1PC_EN_REG' undeclared (first use in this function) >> > drivers/mtd/maps/pmcmsp-flash.c:63: error: 'SINGLE_PCCARD' undeclared (first use in this function) >> > >> > Did I miss something? >> >> I think that map driver should probably depend on CONFIG_PMC_MSP. Ralf? > >*confused* > >68aa0fa87f6d4b2f5e8ad39ecaec8bba9137bb3d did add: > >+config MTD_PMC_MSP_EVM >+ tristate "CFI Flash device mapped on PMC-Sierra MSP" >+ depends on PMC_MSP && MTD_CFI >+ select MTD_PARTITIONS > >drivers/mtd/maps/Makefile:obj-$(CONFIG_MTD_PMC_MSP_EVM) += pmcmsp-flash.o > >Is he trying to build something else than very recent kernel.org tree? > Yes. very recent, 2.6.22.1. -- If loving computers is wrong, I don't want to be right. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-07-13 15:08 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-12 15:01 [Patch] drivers/mtd/maps/tqm8xxl.c: Style cleanups WANG Cong
2007-07-12 16:11 ` Josh Boyer
[not found] ` <20070713034822.GA2370@localhost.localdomain>
2007-07-13 9:56 ` [Resend][Patch] drivers/mtd/maps/tqm8xxl.c: Do some cleanups David Woodhouse
2007-07-13 13:14 ` WANG Cong
2007-07-13 13:38 ` David Woodhouse
2007-07-13 14:24 ` Ralf Baechle
2007-07-13 14:31 ` David Woodhouse
2007-07-13 15:11 ` WANG Cong
2007-07-13 15:05 ` WANG Cong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox