Skip to contentSkip to conversation

make drivers/mtd/cmdlinepart.c:mtdpart_setup() static

PATCH In review Adrian Bunk 4 participants 7 messages Jun 26, 2006 – Jul 10, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make drivers/mtd/cmdlinepart.c:mtdpart_setup() static

This patch makes the needlessly global mtdpart_setup() static.

drivers/mtd/cmdlinepart.c renamed from drivers/mtd/cmdlinepart.c.old +1 -1
@@ -346,7 +346,7 @@
  *
  * This function needs to be visible for bootloaders.
  */
-int mtdpart_setup(char *s)
+static int mtdpart_setup(char *s)
 {
 	cmdline = s;
 	return 1;
#1 lore raw

drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 line 349

Quoted 12 lines · Adrian Bunk

This patch makes the needlessly global mtdpart_setup() static.

drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 renamed from drivers/mtd/cmdlinepart.c.old 2006-06-26 23:18:39.000000000 +0200 +1 -1
@@ -346,7 +346,7 @@
  *
  * This function needs to be visible for bootloaders.
  */
-int mtdpart_setup(char *s)
+static int mtdpart_setup(char *s) 

Patch lacks sufficient explanation. Explain the relevance of the comment immediately above the function declaration, in the context of your patch. Explain your decision to change the behaviour, but not change the comment itself.

Think. Or you will be replaced with a small shell script.

Signature · 1 line
dwmw2
#2 lore raw
Quoted 5 lines · David Woodhouse
Quoted 4 lines · Adrian Bunk

This patch makes the needlessly global mtdpart_setup() static.

Quoted 13 lines

drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 line 349

Quoted 8 lines
drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 renamed from drivers/mtd/cmdlinepart.c.old 2006-06-26 23:18:39.000000000 +0200 +1 -1
@@ -346,7 +346,7 @@
  *
  * This function needs to be visible for bootloaders.
  */
-int mtdpart_setup(char *s)
+static int mtdpart_setup(char *s) 

Patch lacks sufficient explanation. Explain the relevance of the comment immediately above the function declaration, in the context of your patch. Explain your decision to change the behaviour, but not change the comment itself.

My explanation regarding the relevance of the comment is that it seems to be nonsense.

Do I miss something, or why and how should a bootloader access in-kernel functions?

Quoted 1 line

Think. Or you will be replaced with a small shell script.

No problem, I'm waiting for your submission of Adrian 1.0 ;-)

Quoted 1 line

dwmw2

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 20 lines · Adrian Bunk
Quoted 5 lines · David Woodhouse
Quoted 4 lines · Adrian Bunk

This patch makes the needlessly global mtdpart_setup() static.

Quoted 13 lines

drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 line 349

Quoted 8 lines
drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 renamed from drivers/mtd/cmdlinepart.c.old 2006-06-26 23:18:39.000000000 +0200 +1 -1
@@ -346,7 +346,7 @@
  *
  * This function needs to be visible for bootloaders.
  */
-int mtdpart_setup(char *s)
+static int mtdpart_setup(char *s) 

Patch lacks sufficient explanation. Explain the relevance of the comment immediately above the function declaration, in the context of your patch. Explain your decision to change the behaviour, but not change the comment itself.

Quoted 5 lines

My explanation regarding the relevance of the comment is that it seems to be nonsense.

Do I miss something, or why and how should a bootloader access in-kernel functions?

I'm not entirely sure, but allegedly it does -- Juha, can you elaborate?

Signature · 1 line
dwmw2
#4 lore raw
Quoted 12 lines · David Woodhouse
Quoted 12 lines
Quoted 12 lines

drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 line 349

Quoted 8 lines
drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 renamed from drivers/mtd/cmdlinepart.c.old 2006-06-26 23:18:39.000000000 +0200 +1 -1
@@ -346,7 +346,7 @@
  *
  * This function needs to be visible for bootloaders.
  */
-int mtdpart_setup(char *s)
+static int mtdpart_setup(char *s) 

Patch lacks sufficient explanation. Explain the relevance of the comment immediately above the function declaration, in the context of your patch. Explain your decision to change the behaviour, but not change the comment itself.

Quoted 5 lines
Quoted 3 lines

My explanation regarding the relevance of the comment is that it seems to be nonsense.

Do I miss something, or why and how should a bootloader access in-kernel functions?

I'm not entirely sure, but allegedly it does -- Juha, can you elaborate?

Our bootloader doesn't access in-kernel functions, for obvious reasons.
The comment in cmdlinepart.c is unfortunately inaccurate. The
bootloader does need a mechanism for passing the partition table to the kernel, though. Our partition table is generated on-the-fly by the bootloader to guarantee that each partition gets a certain number of non-bad NAND blocks.

We used to do this by passing the partition table in a string compatible with cmdlinepart syntax. The kernel NAND driver then just passed the string received from the bootloader to mtdpart_setup().

Nowadays there is a better way of doing this, so as far as we are concerned, mtdpart_setup() can be made static again. We'll migrate our MTD drivers to use the platform_data mechanism instead.

Cheers,
Juha

#5 lore raw
In reply to David Woodhouse

Hello.

Quoted 18 lines · David Woodhouse
Quoted 17 lines
Quoted 17 lines

drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 line 349

Quoted 12 lines

This patch makes the needlessly global mtdpart_setup() static.

drivers/mtd/cmdlinepart.c 2006-06-26 23:18:51.000000000 +0200 renamed from drivers/mtd/cmdlinepart.c.old 2006-06-26 23:18:39.000000000 +0200 +1 -1
@@ -346,7 +346,7 @@
 *
 * This function needs to be visible for bootloaders.
 */
-int mtdpart_setup(char *s)
+static int mtdpart_setup(char *s) 

Patch lacks sufficient explanation. Explain the relevance of the comment immediately above the function declaration, in the context of your patch. Explain your decision to change the behaviour, but not change the comment itself.

Quoted 5 lines
Quoted 3 lines

My explanation regarding the relevance of the comment is that it seems to be nonsense.

Do I miss something, or why and how should a bootloader access in-kernel functions?

I'm not entirely sure, but allegedly it does -- Juha, can you elaborate?

In addition, this function might be needed to support parsing of the
partition info extracted from the OF device tree (if this way of storing it there will be accepted)...

WBR, Sergei

#6 lore raw
Quoted 3 lines · Sergei Shtylyov

In addition, this function might be needed to support parsing of the
partition info extracted from the OF device tree (if this way of storing it there will be accepted)...

Yes, we should extend physmap to handle of_devices and partition information represented as a string. It won't be mtdpart_setup() which we use for that though.

Signature · 1 line
dwmw2