public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* swsusp: more small fixes
@ 2005-01-12 13:10 Pavel Machek
  2005-01-12 20:06 ` Domen Puncer
  2005-01-12 22:10 ` Pavel Machek
  0 siblings, 2 replies; 4+ messages in thread
From: Pavel Machek @ 2005-01-12 13:10 UTC (permalink / raw)
  To: Andrew Morton, kernel list

Hi!

This adds few missing statics to swsusp.c, prints errors even when
non-debugging and fixes last "pmdisk: " message. Fixed few comments. 
Please apply,

								Pavel

--- clean/kernel/power/swsusp.c	2005-01-12 11:07:40.000000000 +0100
+++ linux/kernel/power/swsusp.c	2005-01-12 11:35:42.000000000 +0100
@@ -420,7 +419,7 @@
 	struct highmem_page *next;
 };
 
-struct highmem_page *highmem_copy = NULL;
+static struct highmem_page *highmem_copy = NULL;
 
 static int save_highmem_zone(struct zone *zone)
 {
@@ -753,21 +753,21 @@
 		return -ENOSPC;
 
 	if ((error = alloc_pagedir())) {
-		pr_debug("suspend: Allocating pagedir failed.\n");
+		printk("suspend: Allocating pagedir failed.\n");
 		return error;
 	}
 	if ((error = alloc_image_pages())) {
-		pr_debug("suspend: Allocating image pages failed.\n");
+		printk("suspend: Allocating image pages failed.\n");
 		swsusp_free();
 		return error;
 	}
 
 	nr_copy_pages_check = nr_copy_pages;
 	pagedir_order_check = pagedir_order;
 	return 0;
 }
 
-int suspend_prepare_image(void)
+static int suspend_prepare_image(void)
 {
 	int error;
 
@@ -931,7 +921,7 @@
 			addr = get_zeroed_page(GFP_ATOMIC);
 			if(!addr)
 				return -ENOMEM;
-		} while (does_collide(addr));
+		} while (does_collide_order(addr, 0));
 
 		(pagedir_nosave+i)->address = addr;
 	}
@@ -1050,12 +1058,12 @@
 	return error;
 }
 
-int bio_read_page(pgoff_t page_off, void * page)
+static int bio_read_page(pgoff_t page_off, void * page)
 {
 	return submit(READ, page_off, page);
 }
 
-int bio_write_page(pgoff_t page_off, void * page)
+static int bio_write_page(pgoff_t page_off, void * page)
 {
 	return submit(WRITE, page_off, page);
 }
@@ -1172,7 +1180,7 @@
 		return -ENOMEM;
 	pagedir_nosave = (struct pbe *)addr;
 
-	pr_debug("pmdisk: Reading pagedir (%d Pages)\n",n);
+	pr_debug("swsusp: Reading pagedir (%d Pages)\n",n);
 
 	for (i = 0; i < n && !error; i++, addr += PAGE_SIZE) {
 		unsigned long offset = swp_offset(swsusp_info.pagedir[i]);


--- clean/kernel/power/main.c	2004-12-25 13:35:03.000000000 +0100
+++ linux/kernel/power/main.c	2005-01-12 10:57:23.000000000 +0100
@@ -99,7 +100,7 @@
  *	@state:		State we're coming out of.
  *
  *	Call platform code to clean up, restart processes, and free the 
- *	console that we've allocated.
+ *	console that we've allocated. This is not called for suspend-to-disk.
  */
 
 static void suspend_finish(suspend_state_t state)


--- clean/kernel/power/disk.c	2004-12-25 13:35:03.000000000 +0100
+++ linux/kernel/power/disk.c	2005-01-12 10:57:23.000000000 +0100
@@ -163,7 +167,7 @@
  *
  *	If we're going through the firmware, then get it over with quickly.
  *
- *	If not, then call swsusp to do it's thing, then figure out how
+ *	If not, then call swsusp to do its thing, then figure out how
  *	to power down the system.
  */
 
@@ -201,7 +205,7 @@
  *	software_resume - Resume from a saved image.
  *
  *	Called as a late_initcall (so all devices are discovered and
- *	initialized), we call pmdisk to see if we have a saved image or not.
+ *	initialized), we call swsusp to see if we have a saved image or not.
  *	If so, we quiesce devices, the restore the saved image. We will
  *	return above (in pm_suspend_disk() ) if everything goes well.
  *	Otherwise, we fail gracefully and return to the normally
@@ -221,7 +225,7 @@
 		return 0;
 	}
 
-	pr_debug("PM: Reading pmdisk image.\n");
+	pr_debug("PM: Reading swsusp image.\n");
 
 	if ((error = swsusp_read()))
 		goto Done;
@@ -284,7 +288,7 @@
 
 static ssize_t disk_show(struct subsystem * subsys, char * buf)
 {
-	return sprintf(buf,"%s\n",pm_disk_modes[pm_disk_mode]);
+	return sprintf(buf, "%s\n", pm_disk_modes[pm_disk_mode]);
 }
 
 

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: swsusp: more small fixes
  2005-01-12 13:10 swsusp: more small fixes Pavel Machek
@ 2005-01-12 20:06 ` Domen Puncer
  2005-01-12 20:52   ` Pavel Machek
  2005-01-12 22:10 ` Pavel Machek
  1 sibling, 1 reply; 4+ messages in thread
From: Domen Puncer @ 2005-01-12 20:06 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, kernel list

On 12/01/05 14:10 +0100, Pavel Machek wrote:
> Hi!
> 
> This adds few missing statics to swsusp.c, prints errors even when
> non-debugging and fixes last "pmdisk: " message. Fixed few comments. 
> Please apply,

Some nitpicking...
> 
> --- clean/kernel/power/swsusp.c	2005-01-12 11:07:40.000000000 +0100
> +++ linux/kernel/power/swsusp.c	2005-01-12 11:35:42.000000000 +0100
> @@ -420,7 +419,7 @@
>  	struct highmem_page *next;
>  };
>  
> -struct highmem_page *highmem_copy = NULL;
> +static struct highmem_page *highmem_copy = NULL;

You could remove explicit initialization (so pointer would go into bss
instead of data, IIRC).


> @@ -753,21 +753,21 @@
>  		return -ENOSPC;
>  
>  	if ((error = alloc_pagedir())) {
> -		pr_debug("suspend: Allocating pagedir failed.\n");
> +		printk("suspend: Allocating pagedir failed.\n");

Missing KERN_ constant.

>  		return error;
>  	}
>  	if ((error = alloc_image_pages())) {
> -		pr_debug("suspend: Allocating image pages failed.\n");
> +		printk("suspend: Allocating image pages failed.\n");

Same here.


	Domen

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: swsusp: more small fixes
  2005-01-12 20:06 ` Domen Puncer
@ 2005-01-12 20:52   ` Pavel Machek
  0 siblings, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2005-01-12 20:52 UTC (permalink / raw)
  To: Domen Puncer; +Cc: Andrew Morton, kernel list

Hi!

> > -struct highmem_page *highmem_copy = NULL;
> > +static struct highmem_page *highmem_copy = NULL;
> 
> You could remove explicit initialization (so pointer would go into bss
> instead of data, IIRC).
> 
> > -		pr_debug("suspend: Allocating pagedir failed.\n");
> > +		printk("suspend: Allocating pagedir failed.\n");
> 
> Missing KERN_ constant.

> > -		pr_debug("suspend: Allocating image pages failed.\n");
> > +		printk("suspend: Allocating image pages failed.\n");
> 
> Same here.

Fixed, but I'd prefer to have this applied and fix it with followup
patch.
								Pavel
-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: swsusp: more small fixes
  2005-01-12 13:10 swsusp: more small fixes Pavel Machek
  2005-01-12 20:06 ` Domen Puncer
@ 2005-01-12 22:10 ` Pavel Machek
  1 sibling, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2005-01-12 22:10 UTC (permalink / raw)
  To: Andrew Morton, kernel list


Hi!

> This adds few missing statics to swsusp.c, prints errors even when
> non-debugging and fixes last "pmdisk: " message. Fixed few comments. 
> Please apply,

Ouch, it would actually break compile due to does_collide_order
change. Please take this instead... It also fixes damen's comments.

[Heh, I'm thinking about adding Signed-off-by to my mail signature or
better to email headers ;-))))]

---cut here----

This adds few missing statics to swsusp.c, prints errors even when
non-debugging and fixes last "pmdisk: " message. Fixed few comments. 
Please apply,

Signed-off-by: Pavel Machek <pavel@suse.cz>
								Pavel


--- clean/kernel/power/swsusp.c	2005-01-12 11:07:40.000000000 +0100
+++ linux/kernel/power/swsusp.c	2005-01-12 11:35:42.000000000 +0100
@@ -420,7 +419,7 @@
 	struct highmem_page *next;
 };
 
-struct highmem_page *highmem_copy = NULL;
+static struct highmem_page *highmem_copy;
 
 static int save_highmem_zone(struct zone *zone)
 {
@@ -753,21 +753,21 @@
 		return -ENOSPC;
 
 	if ((error = alloc_pagedir())) {
-		pr_debug("suspend: Allocating pagedir failed.\n");
+		printk(KERN_ERR "suspend: Allocating pagedir failed.\n");
 		return error;
 	}
 	if ((error = alloc_image_pages())) {
-		pr_debug("suspend: Allocating image pages failed.\n");
+		printk(KERN_ERR "suspend: Allocating image pages failed.\n");
 		swsusp_free();
 		return error;
 	}
 
 	nr_copy_pages_check = nr_copy_pages;
 	pagedir_order_check = pagedir_order;
 	return 0;
 }
 
-int suspend_prepare_image(void)
+static int suspend_prepare_image(void)
 {
 	int error;
 
@@ -1050,12 +1058,12 @@
 	return error;
 }
 
-int bio_read_page(pgoff_t page_off, void * page)
+static int bio_read_page(pgoff_t page_off, void * page)
 {
 	return submit(READ, page_off, page);
 }
 
-int bio_write_page(pgoff_t page_off, void * page)
+static int bio_write_page(pgoff_t page_off, void * page)
 {
 	return submit(WRITE, page_off, page);
 }
@@ -1172,7 +1180,7 @@
 		return -ENOMEM;
 	pagedir_nosave = (struct pbe *)addr;
 
-	pr_debug("pmdisk: Reading pagedir (%d Pages)\n",n);
+	pr_debug("swsusp: Reading pagedir (%d Pages)\n",n);
 
 	for (i = 0; i < n && !error; i++, addr += PAGE_SIZE) {
 		unsigned long offset = swp_offset(swsusp_info.pagedir[i]);


--- clean/kernel/power/main.c	2004-12-25 13:35:03.000000000 +0100
+++ linux/kernel/power/main.c	2005-01-12 10:57:23.000000000 +0100
@@ -99,7 +100,7 @@
  *	@state:		State we're coming out of.
  *
  *	Call platform code to clean up, restart processes, and free the 
- *	console that we've allocated.
+ *	console that we've allocated. This is not called for suspend-to-disk.
  */
 
 static void suspend_finish(suspend_state_t state)


--- clean/kernel/power/disk.c	2004-12-25 13:35:03.000000000 +0100
+++ linux/kernel/power/disk.c	2005-01-12 10:57:23.000000000 +0100
@@ -163,7 +167,7 @@
  *
  *	If we're going through the firmware, then get it over with quickly.
  *
- *	If not, then call swsusp to do it's thing, then figure out how
+ *	If not, then call swsusp to do its thing, then figure out how
  *	to power down the system.
  */
 
@@ -201,7 +205,7 @@
  *	software_resume - Resume from a saved image.
  *
  *	Called as a late_initcall (so all devices are discovered and
- *	initialized), we call pmdisk to see if we have a saved image or not.
+ *	initialized), we call swsusp to see if we have a saved image or not.
  *	If so, we quiesce devices, the restore the saved image. We will
  *	return above (in pm_suspend_disk() ) if everything goes well.
  *	Otherwise, we fail gracefully and return to the normally
@@ -221,7 +225,7 @@
 		return 0;
 	}
 
-	pr_debug("PM: Reading pmdisk image.\n");
+	pr_debug("PM: Reading swsusp image.\n");
 
 	if ((error = swsusp_read()))
 		goto Done;
@@ -284,7 +288,7 @@
 
 static ssize_t disk_show(struct subsystem * subsys, char * buf)
 {
-	return sprintf(buf,"%s\n",pm_disk_modes[pm_disk_mode]);
+	return sprintf(buf, "%s\n", pm_disk_modes[pm_disk_mode]);
 }
 
 

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-12 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-12 13:10 swsusp: more small fixes Pavel Machek
2005-01-12 20:06 ` Domen Puncer
2005-01-12 20:52   ` Pavel Machek
2005-01-12 22:10 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox