From: Anton Blanchard <anton@samba.org>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org
Subject: [PATCH] [ppc64] Fix chrp_progress mismerge
Date: Thu, 5 Aug 2004 09:35:55 +1000 [thread overview]
Message-ID: <20040804233555.GD30253@krispykreme> (raw)
Due to a mismerge, some code in chrp_progress appears twice. While here,
clean up some formatting issues.
Signed-off-by: Anton Blanchard <anton@samba.org>
diff -puN arch/ppc64/kernel/chrp_setup.c~progress-fix arch/ppc64/kernel/chrp_setup.c
--- linux-2.6.8-rc2-mm2/arch/ppc64/kernel/chrp_setup.c~progress-fix 2004-08-04 17:46:44.258756677 -0500
+++ linux-2.6.8-rc2-mm2-anton/arch/ppc64/kernel/chrp_setup.c 2004-08-04 17:46:44.270754770 -0500
@@ -298,8 +298,7 @@ chrp_init(unsigned long r3, unsigned lon
cur_cpu_spec->firmware_features);
}
-void
-chrp_progress(char *s, unsigned short hex)
+void chrp_progress(char *s, unsigned short hex)
{
struct device_node *root;
int width, *p;
@@ -313,60 +312,55 @@ chrp_progress(char *s, unsigned short he
return;
if (max_width == 0) {
- if ( (root = find_path_device("/rtas")) &&
+ if ((root = find_path_device("/rtas")) &&
(p = (unsigned int *)get_property(root,
"ibm,display-line-length",
- NULL)) )
+ NULL)))
max_width = *p;
else
max_width = 0x10;
display_character = rtas_token("display-character");
set_indicator = rtas_token("set-indicator");
}
- if (display_character == RTAS_UNKNOWN_SERVICE) {
- /* use hex display */
- if (set_indicator == RTAS_UNKNOWN_SERVICE)
- return;
- rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex);
- return;
- }
- if(display_character == RTAS_UNKNOWN_SERVICE) {
+ if (display_character == RTAS_UNKNOWN_SERVICE) {
/* use hex display if available */
- if(set_indicator != RTAS_UNKNOWN_SERVICE)
+ if (set_indicator != RTAS_UNKNOWN_SERVICE)
rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex);
return;
}
spin_lock(&progress_lock);
- /* Last write ended with newline, but we didn't print it since
+ /*
+ * Last write ended with newline, but we didn't print it since
* it would just clear the bottom line of output. Print it now
* instead.
*
* If no newline is pending, print a CR to start output at the
* beginning of the line.
*/
- if(pending_newline) {
+ if (pending_newline) {
rtas_call(display_character, 1, 1, NULL, '\r');
rtas_call(display_character, 1, 1, NULL, '\n');
pending_newline = 0;
- } else
+ } else {
rtas_call(display_character, 1, 1, NULL, '\r');
+ }
width = max_width;
os = s;
while (*os) {
- if(*os == '\n' || *os == '\r') {
+ if (*os == '\n' || *os == '\r') {
/* Blank to end of line. */
- while(width-- > 0)
+ while (width-- > 0)
rtas_call(display_character, 1, 1, NULL, ' ');
/* If newline is the last character, save it
* until next call to avoid bumping up the
* display output.
*/
- if(*os == '\n' && !os[1]) {
+ if (*os == '\n' && !os[1]) {
pending_newline = 1;
spin_unlock(&progress_lock);
return;
@@ -374,7 +368,7 @@ chrp_progress(char *s, unsigned short he
/* RTAS wants CR-LF, not just LF */
- if(*os == '\n') {
+ if (*os == '\n') {
rtas_call(display_character, 1, 1, NULL, '\r');
rtas_call(display_character, 1, 1, NULL, '\n');
} else {
@@ -393,14 +387,14 @@ chrp_progress(char *s, unsigned short he
os++;
/* if we overwrite the screen length */
- if ( width <= 0 )
- while ( (*os != 0) && (*os != '\n') && (*os != '\r') )
+ if (width <= 0)
+ while ((*os != 0) && (*os != '\n') && (*os != '\r'))
os++;
}
/* Blank to end of line. */
- while ( width-- > 0 )
- rtas_call(display_character, 1, 1, NULL, ' ' );
+ while (width-- > 0)
+ rtas_call(display_character, 1, 1, NULL, ' ');
spin_unlock(&progress_lock);
}
_
reply other threads:[~2004-08-04 23:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040804233555.GD30253@krispykreme \
--to=anton@samba.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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