From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262147AbVDWW04 (ORCPT ); Sat, 23 Apr 2005 18:26:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262158AbVDWWZp (ORCPT ); Sat, 23 Apr 2005 18:25:45 -0400 Received: from gprs189-60.eurotel.cz ([160.218.189.60]:50146 "EHLO amd.ucw.cz") by vger.kernel.org with ESMTP id S262147AbVDWWS4 (ORCPT ); Sat, 23 Apr 2005 18:18:56 -0400 Date: Sun, 24 Apr 2005 00:18:26 +0200 From: Pavel Machek To: "Rafael J. Wysocki" Cc: LKML Subject: Re: [PATCH] swsusp: misc cleanups [3/4] Message-ID: <20050423221826.GE1884@elf.ucw.cz> References: <200504232320.54477.rjw@sisk.pl> <200504232334.17343.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200504232334.17343.rjw@sisk.pl> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.6+20040907i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi! > The following patch cleans up whitespace in swsusp.c (a bit): > - removes any trailing whitespace > - adds spaces after if, for, for_each_pbe, for_each_zone etc., wherever > necessary. > > Please consider for applying. Few hunks rejected, so I just applied those that work. This is the result.... Pavel Index: kernel/power/swsusp.c =================================================================== --- 32777ae73f5bb73dc108d3848153adb77b8a424a/kernel/power/swsusp.c (mode:100644 sha1:cb4a01ed956eba4369ac1c21fa52901f13ac2cd5) +++ uncommitted/kernel/power/swsusp.c (mode:100644) @@ -10,12 +10,12 @@ * This file is released under the GPLv2. * * I'd like to thank the following people for their work: - * + * * Pavel Machek : * Modifications, defectiveness pointing, being with me at the very beginning, * suspend to swap space, stop all tasks. Port to 2.4.18-ac and 2.5.17. * - * Steve Doddi : + * Steve Doddi : * Support the possibility of hardware state restoring. * * Raph : @@ -97,11 +97,11 @@ unsigned int nr_copy_pages __nosavedata = 0; /* Suspend pagedir is allocated before final copy, therefore it - must be freed after resume + must be freed after resume Warning: this is evil. There are actually two pagedirs at time of resume. One is "pagedir_save", which is empty frame allocated at - time of suspend, that must be freed. Second is "pagedir_nosave", + time of suspend, that must be freed. Second is "pagedir_nosave", allocated at time of resume, that travels through memory not to collide with anything. @@ -206,7 +206,7 @@ { int error; - rw_swap_page_sync(READ, + rw_swap_page_sync(READ, swp_entry(root_swap, 0), virt_to_page((unsigned long)&swsusp_header)); if (!memcmp("SWAP-SPACE",swsusp_header.sig, 10) || @@ -218,7 +218,7 @@ memcpy(swsusp_header.iv, iv, MAXIV); #endif swsusp_header.swsusp_info = prev; - error = rw_swap_page_sync(WRITE, + error = rw_swap_page_sync(WRITE, swp_entry(root_swap, 0), virt_to_page((unsigned long) &swsusp_header)); @@ -252,22 +252,22 @@ static int swsusp_swap_check(void) /* This is called before saving image */ { int i, len; - + len=strlen(resume_file); root_swap = 0xFFFF; - + swap_list_lock(); - for(i=0; iaddress) { ClearPageNosave(virt_to_page(p->address)); free_page(p->address); @@ -825,7 +825,7 @@ { struct pbe * p; - for_each_pbe(p, pagedir_save) { + for_each_pbe (p, pagedir_save) { p->address = get_zeroed_page(GFP_ATOMIC | __GFP_COLD); if (!p->address) return -ENOMEM; @@ -846,7 +846,7 @@ /** * enough_free_mem - Make sure we enough free memory to snapshot. * - * Returns TRUE or FALSE after checking the number of available + * Returns TRUE or FALSE after checking the number of available * free pages. */ @@ -864,11 +864,11 @@ /** * enough_swap - Make sure we have enough swap to save the image. * - * Returns TRUE or FALSE after checking the total amount of swap + * Returns TRUE or FALSE after checking the total amount of swap * space avaiable. * * FIXME: si_swapinfo(&i) returns all swap devices information. - * We should only consider resume_device. + * We should only consider resume_device. */ static int enough_swap(void) @@ -933,8 +933,8 @@ error = swsusp_alloc(); if (error) return error; - - /* During allocating of suspend pagedir, new cold pages may appear. + + /* During allocating of suspend pagedir, new cold pages may appear. * Kill them. */ drain_local_pages(); @@ -1150,7 +1150,7 @@ /* Set page flags */ - for_each_zone(zone) { + for_each_zone (zone) { for (zone_pfn = 0; zone_pfn < zone->spanned_pages; ++zone_pfn) SetPageNosaveFree(pfn_to_page(zone_pfn + zone->zone_start_pfn)); -- Boycott Kodak -- for their patent abuse against Java.