From: "Art Haas" <ahaas@airmail.net>
To: sparclinux@vger.kernel.org
Subject: [PATCH] Small cleanup to kernel/setup.c
Date: Tue, 04 May 2004 13:21:04 +0000 [thread overview]
Message-ID: <20040504132104.GA23807@artsapartment.org> (raw)
Hi.
The following patch replaces unnecessary duplicated testing with a set
of if/else tests, and removes some unused variables in the same routine.
Maybe the 'highest_paddr' value was used in earlier versions of the
file, but it isn't used anywhere now. I've booted a 2.6.6-rc kernel with
this patch applied.
Art Haas
=== arch/sparc/kernel/setup.c 1.28 vs edited ==--- 1.28/arch/sparc/kernel/setup.c Sun Mar 21 16:43:34 2004
+++ edited/arch/sparc/kernel/setup.c Mon May 3 14:21:51 2004
@@ -257,7 +257,6 @@
void __init setup_arch(char **cmdline_p)
{
int i;
- unsigned long highest_paddr;
sparc_ttable = (struct tt_entry *) &start;
@@ -266,14 +265,23 @@
strcpy(saved_command_line, *cmdline_p);
/* Set sparc_cpu_model */
- sparc_cpu_model = sun_unknown;
- if(!strcmp(&cputypval,"sun4 ")) { sparc_cpu_model=sun4; }
- if(!strcmp(&cputypval,"sun4c")) { sparc_cpu_model=sun4c; }
- if(!strcmp(&cputypval,"sun4m")) { sparc_cpu_model=sun4m; }
- if(!strcmp(&cputypval,"sun4s")) { sparc_cpu_model=sun4m; } /* CP-1200 with PROM 2.30 -E */
- if(!strcmp(&cputypval,"sun4d")) { sparc_cpu_model=sun4d; }
- if(!strcmp(&cputypval,"sun4e")) { sparc_cpu_model=sun4e; }
- if(!strcmp(&cputypval,"sun4u")) { sparc_cpu_model=sun4u; }
+ if (!strcmp(&cputypval,"sun4 ")) {
+ sparc_cpu_model=sun4;
+ } else if (!strcmp(&cputypval,"sun4c")) {
+ sparc_cpu_model=sun4c;
+ } else if (!strcmp(&cputypval,"sun4m")) {
+ sparc_cpu_model=sun4m;
+ } else if (!strcmp(&cputypval,"sun4s")) {
+ sparc_cpu_model=sun4m; /* CP-1200 with PROM 2.30 -E */
+ } else if (!strcmp(&cputypval,"sun4d")) {
+ sparc_cpu_model=sun4d;
+ } else if (!strcmp(&cputypval,"sun4e")) {
+ sparc_cpu_model=sun4e;
+ } else if (!strcmp(&cputypval,"sun4u")) {
+ sparc_cpu_model=sun4u;
+ } else {
+ sparc_cpu_model = sun_unknown;
+ }
#ifdef CONFIG_SUN4
if (sparc_cpu_model != sun4) {
@@ -320,16 +328,9 @@
(void) prom_probe_memory();
phys_base = 0xffffffffUL;
- highest_paddr = 0UL;
for (i = 0; sp_banks[i].num_bytes != 0; i++) {
- unsigned long top;
-
if (sp_banks[i].base_addr < phys_base)
phys_base = sp_banks[i].base_addr;
- top = sp_banks[i].base_addr +
- sp_banks[i].num_bytes;
- if (highest_paddr < top)
- highest_paddr = top;
}
pfn_base = phys_base >> PAGE_SHIFT;
--
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.
-Thomas Jefferson to James Smith, 1822
next reply other threads:[~2004-05-04 13:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-04 13:21 Art Haas [this message]
2004-05-04 14:04 ` [PATCH] Small cleanup to kernel/setup.c Ben Collins
2004-05-04 14:21 ` Art Haas
2004-05-04 14:26 ` Ben Collins
2004-05-04 14:57 ` Keith M Wesolowski
2004-05-04 15:02 ` Art Haas
2004-05-04 15:39 ` Keith M Wesolowski
2004-05-04 16:11 ` Thomas Nemeth
2004-05-04 16:37 ` Keith M Wesolowski
2004-05-04 16:42 ` Art Haas
2004-05-04 18:09 ` Keith M Wesolowski
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=20040504132104.GA23807@artsapartment.org \
--to=ahaas@airmail.net \
--cc=sparclinux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.