From: Pavel Machek <pavel@ucw.cz>
To: Patrick Mochel <mochel@osdl.org>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [pm] Some typos
Date: Wed, 1 Oct 2003 23:51:11 +0200 [thread overview]
Message-ID: <20031001215110.GA5289@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.44.0310011236130.23925-100000@cherise>
Hi!
> > > I'll fix my scripts.
> > > Did you apply this and "add initcall" patches?
> >
> > Yes.
>
> Though, it produces a warning on compile:
>
> kernel/power/swsusp.c:1089: warning: initialization from incompatible pointer type
>
> ..which is because software_resume() returns void. Could you please fix
> this?
Yep. (Cc-ed to list in case I made some stupid mistake). Also added
check: buffer allocation might fail. Please apply,
Pavel
--- tmp/linux/kernel/power/swsusp.c 2003-10-01 23:24:42.000000000 +0200
+++ linux/kernel/power/swsusp.c 2003-10-01 23:18:27.000000000 +0200
@@ -283,6 +283,9 @@
unsigned long address;
struct page *page;
+ if (!buffer)
+ return -ENOMEM;
+
printk( "Writing data to swap (%d pages): ", nr_copy_pages );
for (i=0; i<nr_copy_pages; i++) {
if (!(i%100))
@@ -1046,23 +1051,23 @@
* scheduled program.
*
*/
-static void __init software_resume(void)
+static int __init software_resume(void)
{
if (num_online_cpus() > 1) {
printk(KERN_WARNING "Software Suspend has malfunctioning SMP support. Disabled :(\n");
- return;
+ return -EINVAL;
}
/* We enable the possibility of machine suspend */
software_suspend_enabled = 1;
if (!resume_status)
- return;
+ return 0;
printk( "%s", name_resume );
if (resume_status == NORESUME) {
if(resume_file[0])
read_suspend_image(resume_file, 1);
printk( "disabled\n" );
- return;
+ return 0;
}
MDELAY(1000);
@@ -1071,7 +1076,7 @@
if (!resume_file[0] && resume_status == RESUME_SPECIFIED) {
printk( "suspension device unspecified\n" );
- return;
+ return -EINVAL;
}
printk( "resuming from %s\n", resume_file);
@@ -1082,7 +1087,7 @@
read_failure:
pm_restore_console();
- return;
+ return 0;
}
late_initcall(software_resume);
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
next parent reply other threads:[~2003-10-01 21:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44.0310011217380.23925-100000@cherise>
[not found] ` <Pine.LNX.4.44.0310011236130.23925-100000@cherise>
2003-10-01 21:51 ` Pavel Machek [this message]
2003-10-03 21:28 ` Patrick Mochel
2003-09-28 21:37 Pavel Machek
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=20031001215110.GA5289@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.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
all inboxes | Powered by JetHome®