Re: [PATCH 7/8] pseries: phyp dump: Unregister and print dump areas.
From: Stephen Rothwell <hidden>
Date: 2008-01-08 04:26:04
Hi Manish, Just more trivial stuff. On Mon, 07 Jan 2008 18:37:31 -0600 Manish Ahuja [off-list ref] wrote:
static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
{
int rc;
- ph->cpu_data.destination_address += addr;
- ph->hpte_data.destination_address += addr;
- ph->kernel_data.destination_address += addr;
+ /* Add addr value if not initialized before */
+ if (ph->cpu_data.destination_address == 0) {
+ ph->cpu_data.destination_address += addr;Could be just '=' like further down, right?
+static void invalidate_last_dump(struct phyp_dump_header *ph, unsigned long addr)
+{+ if (rc)
+ {
We prefer
if (rc) {
+static void unregister_dump_area(struct phyp_dump_header *ph)
+{+ if (rc)
+ {And again.
static ssize_t show_release_region(struct kset * kset, char *buf)
We normally put the function name on the same line as the type.
{
- return sprintf(buf, "ola\n");
+ u64 second_addr_range;
+
+ /* total reserved size - start of scratch area */
+ second_addr_range = phdr.cpu_data.destination_address -
+ phyp_dump_info->init_reserve_size;
+ return sprintf(buf, "CPU:0x%lx-0x%lx: HPTE:0x%lx-0x%lx:"
+ " DUMP:0x%lx-0x%lx, 0x%lx-0x%lx:\n",
+ phdr.cpu_data.destination_address, phdr.cpu_data.length_copied,
+ phdr.hpte_data.destination_address, phdr.hpte_data.length_copied,
+ phdr.kernel_data.destination_address, phdr.kernel_data.length_copied,
+ phyp_dump_info->init_reserve_start, second_addr_range);This indentation should be (probably) two tabs.
+ /* re-register the dump area, if old dump was invalid */
+ if ((dump_header) && (dump_header->status & DUMP_ERROR_FLAG)) {^ ^ Extra parentheses.
+ invalidate_last_dump (&phdr, dump_area_start); + register_dump_area (&phdr, dump_area_start);
No spaces after function names. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/
Attachments
- (unnamed) [application/pgp-signature] 189 bytes