aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/basic/fixdep.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-12-07 01:28:35 -0500
committerFrederic Weisbecker <fweisbec@gmail.com>2009-12-07 01:29:22 -0500
commit6548698f929814375fa5d62ae1db96959b0418c1 (patch)
tree340924ae82cb0946aa15045b2b72186de52a8146 /scripts/basic/fixdep.c
parent1d2c6cfd40b2dece3bb958cbbc405a2c1536ab75 (diff)
parent22763c5cf3690a681551162c15d34d935308c8d7 (diff)
Merge commit 'v2.6.32' into reiserfs/kill-bkl
Merge-reason: The tree was based 2.6.31. It's better to be up to date with 2.6.32. Although no conflicting changes were made in between, it gives benchmarking results closer to the lastest kernel behaviour.
Diffstat (limited to 'scripts/basic/fixdep.c')
-rw-r--r--scripts/basic/fixdep.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 72c15205bb2b..6bf21f83837d 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -16,8 +16,7 @@
16 * tells make when to remake a file. 16 * tells make when to remake a file.
17 * 17 *
18 * To use this list as-is however has the drawback that virtually 18 * To use this list as-is however has the drawback that virtually
19 * every file in the kernel includes <linux/config.h> which then again 19 * every file in the kernel includes <linux/autoconf.h>.
20 * includes <linux/autoconf.h>
21 * 20 *
22 * If the user re-runs make *config, linux/autoconf.h will be 21 * If the user re-runs make *config, linux/autoconf.h will be
23 * regenerated. make notices that and will rebuild every file which 22 * regenerated. make notices that and will rebuild every file which
@@ -125,8 +124,7 @@ char *target;
125char *depfile; 124char *depfile;
126char *cmdline; 125char *cmdline;
127 126
128void usage(void) 127static void usage(void)
129
130{ 128{
131 fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n"); 129 fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
132 exit(1); 130 exit(1);
@@ -135,7 +133,7 @@ void usage(void)
135/* 133/*
136 * Print out the commandline prefixed with cmd_<target filename> := 134 * Print out the commandline prefixed with cmd_<target filename> :=
137 */ 135 */
138void print_cmdline(void) 136static void print_cmdline(void)
139{ 137{
140 printf("cmd_%s := %s\n\n", target, cmdline); 138 printf("cmd_%s := %s\n\n", target, cmdline);
141} 139}
@@ -148,7 +146,7 @@ int len_config = 0;
148 * Grow the configuration string to a desired length. 146 * Grow the configuration string to a desired length.
149 * Usually the first growth is plenty. 147 * Usually the first growth is plenty.
150 */ 148 */
151void grow_config(int len) 149static void grow_config(int len)
152{ 150{
153 while (len_config + len > size_config) { 151 while (len_config + len > size_config) {
154 if (size_config == 0) 152 if (size_config == 0)
@@ -164,7 +162,7 @@ void grow_config(int len)
164/* 162/*
165 * Lookup a value in the configuration string. 163 * Lookup a value in the configuration string.
166 */ 164 */
167int is_defined_config(const char * name, int len) 165static int is_defined_config(const char * name, int len)
168{ 166{
169 const char * pconfig; 167 const char * pconfig;
170 const char * plast = str_config + len_config - len; 168 const char * plast = str_config + len_config - len;
@@ -180,7 +178,7 @@ int is_defined_config(const char * name, int len)
180/* 178/*
181 * Add a new value to the configuration string. 179 * Add a new value to the configuration string.
182 */ 180 */
183void define_config(const char * name, int len) 181static void define_config(const char * name, int len)
184{ 182{
185 grow_config(len + 1); 183 grow_config(len + 1);
186 184
@@ -192,7 +190,7 @@ void define_config(const char * name, int len)
192/* 190/*
193 * Clear the set of configuration strings. 191 * Clear the set of configuration strings.
194 */ 192 */
195void clear_config(void) 193static void clear_config(void)
196{ 194{
197 len_config = 0; 195 len_config = 0;
198 define_config("", 0); 196 define_config("", 0);
@@ -201,7 +199,7 @@ void clear_config(void)
201/* 199/*
202 * Record the use of a CONFIG_* word. 200 * Record the use of a CONFIG_* word.
203 */ 201 */
204void use_config(char *m, int slen) 202static void use_config(char *m, int slen)
205{ 203{
206 char s[PATH_MAX]; 204 char s[PATH_MAX];
207 char *p; 205 char *p;
@@ -222,7 +220,7 @@ void use_config(char *m, int slen)
222 printf(" $(wildcard include/config/%s.h) \\\n", s); 220 printf(" $(wildcard include/config/%s.h) \\\n", s);
223} 221}
224 222
225void parse_config_file(char *map, size_t len) 223static void parse_config_file(char *map, size_t len)
226{ 224{
227 int *end = (int *) (map + len); 225 int *end = (int *) (map + len);
228 /* start at +1, so that p can never be < map */ 226 /* start at +1, so that p can never be < map */
@@ -256,7 +254,7 @@ void parse_config_file(char *map, size_t len)
256} 254}
257 255
258/* test is s ends in sub */ 256/* test is s ends in sub */
259int strrcmp(char *s, char *sub) 257static int strrcmp(char *s, char *sub)
260{ 258{
261 int slen = strlen(s); 259 int slen = strlen(s);
262 int sublen = strlen(sub); 260 int sublen = strlen(sub);
@@ -267,7 +265,7 @@ int strrcmp(char *s, char *sub)
267 return memcmp(s + slen - sublen, sub, sublen); 265 return memcmp(s + slen - sublen, sub, sublen);
268} 266}
269 267
270void do_config_file(char *filename) 268static void do_config_file(char *filename)
271{ 269{
272 struct stat st; 270 struct stat st;
273 int fd; 271 int fd;
@@ -298,7 +296,7 @@ void do_config_file(char *filename)
298 close(fd); 296 close(fd);
299} 297}
300 298
301void parse_dep_file(void *map, size_t len) 299static void parse_dep_file(void *map, size_t len)
302{ 300{
303 char *m = map; 301 char *m = map;
304 char *end = m + len; 302 char *end = m + len;
@@ -338,7 +336,7 @@ void parse_dep_file(void *map, size_t len)
338 printf("$(deps_%s):\n", target); 336 printf("$(deps_%s):\n", target);
339} 337}
340 338
341void print_deps(void) 339static void print_deps(void)
342{ 340{
343 struct stat st; 341 struct stat st;
344 int fd; 342 int fd;
@@ -370,7 +368,7 @@ void print_deps(void)
370 close(fd); 368 close(fd);
371} 369}
372 370
373void traps(void) 371static void traps(void)
374{ 372{
375 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; 373 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
376 int *p = (int *)test; 374 int *p = (int *)test;