2014-07-15 18:18:34

by Nicholas Krause

[permalink] [raw]
Subject: [PATCH 1/6] alpha: Remove whiterrors related to uneeded characters and lines

This file has multipe cleanpatch errors. This patch is the first in
a series to clean them up. This one removes uneeded characters and
lines from this file.
---
arch/alpha/boot/bootpz.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index d6ad191..64a0da6 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -70,7 +70,7 @@ find_pa(unsigned long address)
result <<= 13;
result |= address & 0x1fff;
return result;
-}
+}

int
check_range(unsigned long vstart, unsigned long vend,
@@ -199,14 +199,14 @@ extern char _end;

START_ADDR KSEG address of the entry point of kernel code.

- ZERO_PGE KSEG address of page full of zeroes, but
+ ZERO_PGE KSEG address of page full of zeroes, but
upon entry to kerne cvan be expected
to hold the parameter list and possible
INTRD information.

These are used in the local defines below.
*/
-
+

/* Virtual addresses for the BOOTP image. Note that this includes the
bootstrapper code as well as the compressed kernel image, and
@@ -229,7 +229,7 @@ extern char _end;
#define V_DATA_START KERNEL_ORIGIN
#define V_INITRD_START (KERNEL_ORIGIN + KERNEL_Z_SIZE)
#define V_INTRD_END (V_INITRD_START + REAL_INITRD_SIZE)
-#define V_DATA_END V_BOOT_IMAGE_END
+#define V_DATA_END V_BOOT_IMAGE_END

/* KSEG addresses for the uncompressed kernel.

@@ -296,7 +296,7 @@ start_kernel(void)
/* Validity check the HWRPB. */
if (INIT_HWRPB->pagesize != 8192) {
srm_printk("Expected 8kB pages, got %ldkB\n",
- INIT_HWRPB->pagesize >> 10);
+ INIT_HWRPB->pagesize >> 10);
return;
}
if (INIT_HWRPB->vptb != (unsigned long) VPTB) {
@@ -443,7 +443,7 @@ start_kernel(void)
memcpy((void *)K_KERNEL_IMAGE_START,
(void *)uncompressed_image_start, KERNEL_SIZE);
}
-
+
/* Clear the zero page, then move the argument list in. */
#ifdef DEBUG_LAST_STEPS
srm_printk("Preparing ZERO_PGE...\n");
--
1.9.1


2014-07-15 18:18:44

by Nicholas Krause

[permalink] [raw]
Subject: [PATCH 2/6] alpha: Fix spaces to tabs

This patch fixes all errors for this file related to using spaces
instead of tabs.
---
arch/alpha/boot/bootpz.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index 64a0da6..15c16fe 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -252,11 +252,11 @@ extern char _end;
#define K_COPY_IMAGE_START NEXT_PAGE(K_KERNEL_IMAGE_END)
/* Reserve one page below INITRD for the new stack. */
#define K_INITRD_START \
- NEXT_PAGE(K_COPY_IMAGE_START + KERNEL_SIZE + PAGE_SIZE)
+ NEXT_PAGE(K_COPY_IMAGE_START + KERNEL_SIZE + PAGE_SIZE)
#define K_COPY_IMAGE_END \
- (K_INITRD_START + REAL_INITRD_SIZE + MALLOC_AREA_SIZE)
+ (K_INITRD_START + REAL_INITRD_SIZE + MALLOC_AREA_SIZE)
#define K_COPY_IMAGE_SIZE \
- NEXT_PAGE(K_COPY_IMAGE_END - K_COPY_IMAGE_START)
+ NEXT_PAGE(K_COPY_IMAGE_END - K_COPY_IMAGE_START)

void
start_kernel(void)
@@ -400,7 +400,7 @@ start_kernel(void)
uncompressed_image_start,
KERNEL_SIZE);
#endif
- decompress_kernel((void *)uncompressed_image_start,
+ decompress_kernel((void *)uncompressed_image_start,
(void *)V_DATA_START,
KERNEL_SIZE, KERNEL_Z_SIZE);

--
1.9.1

2014-07-15 18:18:40

by Nicholas Krause

[permalink] [raw]
Subject: [PATCH 6/6] alpha: Join lines 90 and 91

This fixes the checkpatch error I get in this file relating to a
quoted string needed to be joined to the line above it.
---
arch/alpha/boot/bootpz.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index 6fc840d..a9e127b 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -87,8 +87,7 @@ check_range(unsigned long vstart, unsigned long vend,
kaddr = (find_pa(vaddr) | PAGE_OFFSET);
if (kaddr >= kstart && kaddr <= kend) {
#ifdef DEBUG_CHECK_RANGE
- srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx"
- " [0x%lx:0x%lx]\n",
+ srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx" " [0x%lx:0x%lx]\n",
vaddr, kaddr, kstart, kend);
#endif
return 1;
--
1.9.1

2014-07-15 18:19:13

by Nicholas Krause

[permalink] [raw]
Subject: [PATCH 4/6] alpha: Remove bracket errors in bootpz.c

This patch removes all errors related to brackets not being placed
correctly in this file as declared when running checkpatch on it.
---
arch/alpha/boot/bootpz.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index 0b5c978..6dd34e4 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -83,11 +83,9 @@ check_range(unsigned long vstart, unsigned long vend,
vstart, vend, kstart, kend);
#endif
/* do some range checking for detecting an overlap... */
- for (vaddr = vstart; vaddr <= vend; vaddr += PAGE_SIZE)
- {
+ for (vaddr = vstart; vaddr <= vend; vaddr += PAGE_SIZE) {
kaddr = (find_pa(vaddr) | PAGE_OFFSET);
- if (kaddr >= kstart && kaddr <= kend)
- {
+ if (kaddr >= kstart && kaddr <= kend) {
#ifdef DEBUG_CHECK_RANGE
srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx"
" [0x%lx:0x%lx]\n",
@@ -310,9 +308,8 @@ start_kernel(void)

/* Get the parameter list from the console environment variable. */
nbytes = callback_getenv(ENV_BOOTED_OSFLAGS, envval, sizeof(envval));
- if (nbytes < 0 || nbytes >= sizeof(envval)) {
+ if (nbytes < 0 || nbytes >= sizeof(envval))
nbytes = 0;
- }
envval[nbytes] = '\0';

#ifdef DEBUG_ADDRESSES
@@ -346,8 +343,7 @@ start_kernel(void)
in conflict.
*/
if (check_range(V_BOOTSTRAPPER_START, V_BOOTSTRAPPER_END,
- K_KERNEL_DATA_START, K_KERNEL_IMAGE_END))
- {
+ K_KERNEL_DATA_START, K_KERNEL_IMAGE_END)) {
srm_printk("FATAL ERROR: overlap of bootstrapper code\n");
__halt();
}
@@ -359,8 +355,7 @@ start_kernel(void)
execution.
*/
if (check_range(V_DATA_START, V_DATA_END,
- K_KERNEL_IMAGE_START, K_COPY_IMAGE_END))
- {
+ K_KERNEL_IMAGE_START, K_COPY_IMAGE_END)) {
#ifdef DEBUG_ADDRESSES
srm_printk("OVERLAP: cannot decompress in place\n");
#endif
@@ -376,8 +371,7 @@ start_kernel(void)
*/
while (check_range(V_DATA_START, V_DATA_END,
uncompressed_image_start,
- uncompressed_image_end))
- {
+ uncompressed_image_end)) {
#if 0
uncompressed_image_start += K_COPY_IMAGE_SIZE;
uncompressed_image_end += K_COPY_IMAGE_SIZE;
--
1.9.1

2014-07-15 18:19:16

by Nicholas Krause

[permalink] [raw]
Subject: [PATCH 3/6] alpha: Remove all errors for checkpatch foo* bar

This patch changes all issues with checkpatch relating to the asterisk
not being put next to the variable or structrue name and rather the
type of the declaring statement.
---
arch/alpha/boot/bootpz.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index 15c16fe..0b5c978 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -42,10 +42,10 @@
#undef DEBUG_LAST_STEPS

extern unsigned long switch_to_osf_pal(unsigned long nr,
- struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa,
+ struct pcb_struct *pcb_va, struct pcb_struct *pcb_pa,
unsigned long *vptb);

-extern int decompress_kernel(void* destination, void *source,
+extern int decompress_kernel(void *destination, void *source,
size_t ksize, size_t kzsize);

extern void move_stack(unsigned long new_stack);
@@ -116,8 +116,8 @@ void
pal_init(void)
{
unsigned long i, rev;
- struct percpu_struct * percpu;
- struct pcb_struct * pcb_pa;
+ struct percpu_struct *percpu;
+ struct pcb_struct *pcb_pa;

/* Create the dummy PCB. */
pcb_va->ksp = 0;
@@ -448,8 +448,8 @@ start_kernel(void)
#ifdef DEBUG_LAST_STEPS
srm_printk("Preparing ZERO_PGE...\n");
#endif
- memset((char*)ZERO_PGE, 0, PAGE_SIZE);
- strcpy((char*)ZERO_PGE, envval);
+ memset((char *)ZERO_PGE, 0, PAGE_SIZE);
+ strcpy((char *)ZERO_PGE, envval);

#ifdef INITRD_IMAGE_SIZE

--
1.9.1

2014-07-15 18:19:10

by Nicholas Krause

[permalink] [raw]
Subject: [PATCH 5/6] alpha: Add line below declartion on line 287

This patch adds a line before the declartion of asm_sp in order
to fix a checkpatch error I get when running it on this file.
---
arch/alpha/boot/bootpz.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index 6dd34e4..6fc840d 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -285,6 +285,7 @@ start_kernel(void)
*/
static long nbytes;
static char envval[256] __attribute__((aligned(8)));
+
register unsigned long asm_sp asm("30");

SP_on_entry = asm_sp;
--
1.9.1

2014-07-15 19:02:23

by Måns Rullgård

[permalink] [raw]
Subject: Re: [PATCH 6/6] alpha: Join lines 90 and 91

Nicholas Krause <[email protected]> writes:

> This fixes the checkpatch error I get in this file relating to a
> quoted string needed to be joined to the line above it.
> ---
> arch/alpha/boot/bootpz.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
> index 6fc840d..a9e127b 100644
> --- a/arch/alpha/boot/bootpz.c
> +++ b/arch/alpha/boot/bootpz.c
> @@ -87,8 +87,7 @@ check_range(unsigned long vstart, unsigned long vend,
> kaddr = (find_pa(vaddr) | PAGE_OFFSET);
> if (kaddr >= kstart && kaddr <= kend) {
> #ifdef DEBUG_CHECK_RANGE
> - srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx"
> - " [0x%lx:0x%lx]\n",
> + srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx" " [0x%lx:0x%lx]\n",
> vaddr, kaddr, kstart, kend);
> #endif

If you're doing this, you should merge the strings too.

--
M?ns Rullg?rd
[email protected]

2014-07-15 19:19:44

by Nicholas Krause

[permalink] [raw]
Subject: Re: [PATCH 6/6] alpha: Join lines 90 and 91

On Tue, Jul 15, 2014 at 2:54 PM, Måns Rullgård <[email protected]> wrote:
> Nicholas Krause <[email protected]> writes:
>
>> This fixes the checkpatch error I get in this file relating to a
>> quoted string needed to be joined to the line above it.
>> ---
>> arch/alpha/boot/bootpz.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
>> index 6fc840d..a9e127b 100644
>> --- a/arch/alpha/boot/bootpz.c
>> +++ b/arch/alpha/boot/bootpz.c
>> @@ -87,8 +87,7 @@ check_range(unsigned long vstart, unsigned long vend,
>> kaddr = (find_pa(vaddr) | PAGE_OFFSET);
>> if (kaddr >= kstart && kaddr <= kend) {
>> #ifdef DEBUG_CHECK_RANGE
>> - srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx"
>> - " [0x%lx:0x%lx]\n",
>> + srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx" " [0x%lx:0x%lx]\n",
>> vaddr, kaddr, kstart, kend);
>> #endif
>
> If you're doing this, you should merge the strings too.
>
> --
> Måns Rullgård
> [email protected]

Very well,
I will merge the strings for this statement.
Nick

2014-07-15 19:20:25

by Nicholas Krause

[permalink] [raw]
Subject: Re: [PATCH 6/6] alpha: Join lines 90 and 91

On Tue, Jul 15, 2014 at 3:19 PM, Nick Krause <[email protected]> wrote:
> On Tue, Jul 15, 2014 at 2:54 PM, Måns Rullgård <[email protected]> wrote:
>> Nicholas Krause <[email protected]> writes:
>>
>>> This fixes the checkpatch error I get in this file relating to a
>>> quoted string needed to be joined to the line above it.
>>> ---
>>> arch/alpha/boot/bootpz.c | 3 +--
>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
>>> index 6fc840d..a9e127b 100644
>>> --- a/arch/alpha/boot/bootpz.c
>>> +++ b/arch/alpha/boot/bootpz.c
>>> @@ -87,8 +87,7 @@ check_range(unsigned long vstart, unsigned long vend,
>>> kaddr = (find_pa(vaddr) | PAGE_OFFSET);
>>> if (kaddr >= kstart && kaddr <= kend) {
>>> #ifdef DEBUG_CHECK_RANGE
>>> - srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx"
>>> - " [0x%lx:0x%lx]\n",
>>> + srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx" " [0x%lx:0x%lx]\n",
>>> vaddr, kaddr, kstart, kend);
>>> #endif
>>
>> If you're doing this, you should merge the strings too.
>>
>> --
>> Måns Rullgård
>> [email protected]
>
> Very well,
> I will merge the strings for this statement.
> Nick
Our my other patches Ok through? Please let me know.
Thanks Nick