kexec/arch/ppc64/fs2dt.c <= 80 columns wide

Signed-off-by: Simon Horman <[EMAIL PROTECTED]>

Index: kexec-tools-testing/kexec/arch/ppc64/fs2dt.c
===================================================================
--- kexec-tools-testing.orig/kexec/arch/ppc64/fs2dt.c   2006-12-08 
11:18:11.000000000 +0900
+++ kexec-tools-testing/kexec/arch/ppc64/fs2dt.c        2006-12-08 
11:28:53.000000000 +0900
@@ -195,7 +195,7 @@
 void putprops(char *fn, struct dirent **nlist, int numlist)
 {
        struct dirent *dp;
-       int i = 0;
+       int i = 0, fd, len;
 
        for (i = 0; i < numlist; i++) {
                dp = nlist[i];
@@ -230,65 +230,66 @@
                        !strcmp(dp->d_name, "linux,initrd-end"))
                                continue;
 
-               if (S_ISREG(statbuf[0].st_mode)) {
-                       int fd, len = statbuf[0].st_size;
+               if (! S_ISREG(statbuf[0].st_mode))
+                       continue;
 
-                       *dt++ = 3;
-                       dt_len = dt;
-                       *dt++ = len;
-                       *dt++ = propnum(fn);
-
-                       if ((len >= 8) && ((unsigned long)dt & 0x4))
-                               dt++;
-
-                       fd = open(pathname, O_RDONLY);
-                       if (fd == -1)
-                               err(pathname, ERR_OPEN);
-
-                       if (read(fd, dt, len) != len)
-                               err(pathname, ERR_READ);
-
-                       checkprop(fn, dt);
-
-                       /* Get the cmdline from the device-tree and modify it */
-                       if (!strcmp(dp->d_name, "bootargs")) {
-                               int cmd_len;
-                               char temp_cmdline[COMMAND_LINE_SIZE] = { "" };
-                               char *param = NULL;
-                               cmd_len = strlen(local_cmdline);
-                               if (cmd_len != 0) {
-                                       param = strstr(local_cmdline,
-                                                       "crashkernel=");
-                                       if (param)
-                                               crash_param = 1;
-                                       param = strstr(local_cmdline, "root=");
-                               }
-                               if (!param) {
-                                       char *old_param;
-                                       memcpy(temp_cmdline, dt, len);
-                                       param = strstr(temp_cmdline, "root=");
-                                       if (param) {
-                                               old_param = strtok(param, " ");
-                                               if (cmd_len != 0)
-                                                       strcat(local_cmdline, " 
");
-                                               strcat(local_cmdline, 
old_param);
-                                       }
+               len = statbuf[0].st_size;
+
+               *dt++ = 3;
+               dt_len = dt;
+               *dt++ = len;
+               *dt++ = propnum(fn);
+
+               if ((len >= 8) && ((unsigned long)dt & 0x4))
+                       dt++;
+
+               fd = open(pathname, O_RDONLY);
+               if (fd == -1)
+                       err(pathname, ERR_OPEN);
+
+               if (read(fd, dt, len) != len)
+                       err(pathname, ERR_READ);
+
+               checkprop(fn, dt);
+
+               /* Get the cmdline from the device-tree and modify it */
+               if (!strcmp(dp->d_name, "bootargs")) {
+                       int cmd_len;
+                       char temp_cmdline[COMMAND_LINE_SIZE] = { "" };
+                       char *param = NULL;
+                       cmd_len = strlen(local_cmdline);
+                       if (cmd_len != 0) {
+                               param = strstr(local_cmdline, "crashkernel=");
+                               if (param)
+                                       crash_param = 1;
+                               param = strstr(local_cmdline, "root=");
+                       }
+                       if (!param) {
+                               char *old_param;
+                               memcpy(temp_cmdline, dt, len);
+                               param = strstr(temp_cmdline, "root=");
+                               if (param) {
+                                       old_param = strtok(param, " ");
+                                       if (cmd_len != 0)
+                                               strcat(local_cmdline, " ");
+                                       strcat(local_cmdline, old_param);
                                }
-                               strcat(local_cmdline, " ");
-                               cmd_len = strlen(local_cmdline);
-                               cmd_len = cmd_len + 1;
-                               memcpy(dt,local_cmdline,cmd_len);
-                               len = cmd_len;
-                               *dt_len = cmd_len;
-                               fprintf(stderr, "Modified cmdline:%s\n", 
local_cmdline);
                        }
-
-                       dt += (len + 3)/4;
-                       if (!strcmp(dp->d_name, "reg") && usablemem_rgns.size)
-                               add_usable_mem_property(fd, len);
-                       close(fd);
+                       strcat(local_cmdline, " ");
+                       cmd_len = strlen(local_cmdline);
+                       cmd_len = cmd_len + 1;
+                       memcpy(dt, local_cmdline,cmd_len);
+                       len = cmd_len;
+                       *dt_len = cmd_len;
+                       fprintf(stderr, "Modified cmdline:%s\n", local_cmdline);
                }
+
+               dt += (len + 3)/4;
+               if (!strcmp(dp->d_name, "reg") && usablemem_rgns.size)
+                       add_usable_mem_property(fd, len);
+               close(fd);
        }
+
        fn[0] = '\0';
        if(errno == ENOSYS)
                errno = 0;

--

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

_______________________________________________
fastboot mailing list
fastboot@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to