lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060726235902.GB9645@us.ibm.com>
Date:	Wed, 26 Jul 2006 16:59:02 -0700
From:	Sukadev Bhattiprolu <sukadev@...ibm.com>
To:	ranty@...ian.org, akpm@...l.org, linux-kernel@...r.kernel.org
Cc:	clg@...ibm.com, serue@...ibm.com, haveblue@...ibm.com,
	sukadev@...ibm.com
Subject: [PATCH] kthread: drivers/base/firmware_class.c

This patch replaces kernel_thread() call in drivers/base/firmware_class.c
with kthread_create() since kernel_thread() is deprecated in drivers.

Signed-off-by: Sukadev Bhattiprolu (sukadev@...ibm.com)
CC: Cedric Le Goater <clg@...ibm.com>
CC: Serge E. Hallyn <serue@...ibm.com>
CC: Dave Hansen <haveblue@...ibm.com>
CC: Manuel Estrada Sainz <ranty@...ian.org>

 drivers/base/firmware_class.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Index: linux-2.6.18-rc2/drivers/base/firmware_class.c
===================================================================
--- linux-2.6.18-rc2.orig/drivers/base/firmware_class.c	2006-07-20 17:41:56.000000000 -0700
+++ linux-2.6.18-rc2/drivers/base/firmware_class.c	2006-07-20 17:44:43.000000000 -0700
@@ -16,6 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/bitops.h>
 #include <linux/mutex.h>
+#include <linux/kthread.h>
 
 #include <linux/firmware.h>
 #include "base.h"
@@ -511,7 +512,6 @@ request_firmware_work_func(void *arg)
 		WARN_ON(1);
 		return 0;
 	}
-	daemonize("%s/%s", "firmware", fw_work->name);
 	ret = _request_firmware(&fw, fw_work->name, fw_work->device,
 		fw_work->uevent);
 	if (ret < 0)
@@ -546,9 +546,9 @@ request_firmware_nowait(
 	const char *name, struct device *device, void *context,
 	void (*cont)(const struct firmware *fw, void *context))
 {
+	struct task_struct *task;
 	struct firmware_work *fw_work = kmalloc(sizeof (struct firmware_work),
 						GFP_ATOMIC);
-	int ret;
 
 	if (!fw_work)
 		return -ENOMEM;
@@ -566,14 +566,14 @@ request_firmware_nowait(
 		.uevent = uevent,
 	};
 
-	ret = kernel_thread(request_firmware_work_func, fw_work,
-			    CLONE_FS | CLONE_FILES);
+	task = kthread_run(request_firmware_work_func, fw_work,
+			    "firmware/%s", name);
 
-	if (ret < 0) {
+	if (IS_ERR(task)) {
 		fw_work->cont(NULL, fw_work->context);
 		module_put(fw_work->module);
 		kfree(fw_work);
-		return ret;
+		return PTR_ERR(task);
 	}
 	return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ