LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Leigh Brown" <leigh@solinno.co.uk>
To: "linuxppc-dev list" <linuxppc-dev@ozlabs.org>
Subject: cmd_line and cmd_preset in arch/ppc/boot/simple/misc.c
Date: Wed, 26 Jan 2005 18:55:13 -0000 (GMT)	[thread overview]
Message-ID: <32862.82.10.231.190.1106765713.squirrel@82.10.231.190> (raw)

Hi,

Could someone please confirm that I'm not going mad?  At least wrt
this ;-)  We have this code in misc.c:

#ifdef CONFIG_GEMINI
        /*
         * If cmd_line is empty and cmd_preset is not, copy cmd_preset
         * to cmd_line.  This way we can override cmd_preset with the
         * command line from Smon.
         */

        if ( (cmd_line[0] == '\0') && (cmd_preset[0] != '\0'))
                memcpy (cmd_line, cmd_preset, sizeof(cmd_preset));
#endif

        /* Display standard Linux/PPC boot prompt for kernel args */
        puts("\nLinux/PPC load: ");
        cp = cmd_line;
        memcpy (cmd_line, cmd_preset, sizeof(cmd_preset));


Surely the bit in the #ifdef is ineffective?  Also, as cmd_line is
initialised to zeros, I think this is better:

        /*
         * If cmd_line is empty and cmd_preset is not, copy cmd_preset
         * to cmd_line.  This way we can override cmd_preset with the
         * command line from Smon.
         */

        if ( (cmd_line[0] == '\0') && (cmd_preset[0] != '\0'))
                memcpy (cmd_line, cmd_preset, sizeof(cmd_preset));

        /* Display standard Linux/PPC boot prompt for kernel args */
        puts("\nLinux/PPC load: ");
        cp = cmd_line;

As, in the general case, cmd_line[0] will always be zero and
cmd_preset[0] will always be filled, so no need for an #ifdef.

If someone can confirm I'm not mistaken, I can send a patch...

             reply	other threads:[~2005-01-26 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-26 18:55 Leigh Brown [this message]
2005-01-27  0:28 ` cmd_line and cmd_preset in arch/ppc/boot/simple/misc.c Rob Baxter
2005-01-27 15:40   ` Leigh Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32862.82.10.231.190.1106765713.squirrel@82.10.231.190 \
    --to=leigh@solinno.co.uk \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox