mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/3] include: <linux/barebox-wrapper.h>: remove kthread 'replacements'
Date: Mon, 15 Feb 2021 11:27:38 +0100	[thread overview]
Message-ID: <20210215102740.30418-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20210215102740.30418-1-a.fatoum@pengutronix.de>

Replacing kthread_create, stop and wake_up_process with no-ops is not
always applicable. For example a threaded USB gadget could be ported
by blocking in kthread_run as external events come in via poller.

Allow porting kthread code that way by removing the noop
implementations. The only user is the UBIFS code, so move the
definitions there.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mtd/ubi/ubi-barebox.h   | 2 --
 fs/ubifs/misc.h                 | 3 +++
 include/linux/barebox-wrapper.h | 4 ----
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/ubi/ubi-barebox.h b/drivers/mtd/ubi/ubi-barebox.h
index 7ee87ffd3e10..01b84890f01e 100644
--- a/drivers/mtd/ubi/ubi-barebox.h
+++ b/drivers/mtd/ubi/ubi-barebox.h
@@ -42,8 +42,6 @@ static inline unsigned long copy_from_user(void *dest, const void *src,
 
 /* common */
 
-#define wake_up_process(...)	do { } while (0)
-
 #define BUS_ID_SIZE		20
 
 #define MAX_ERRNO		4095
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
index 82f922565757..5dafe7518be0 100644
--- a/fs/ubifs/misc.h
+++ b/fs/ubifs/misc.h
@@ -27,6 +27,9 @@
 #ifndef __UBIFS_MISC_H__
 #define __UBIFS_MISC_H__
 
+#define kthread_stop(...)	do { } while (0)
+#define wake_up_process(...)	do { } while (0)
+
 /**
  * ubifs_zn_dirty - check if znode is dirty.
  * @znode: znode to check
diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h
index 82c52dd93309..dfaec7b8a9b9 100644
--- a/include/linux/barebox-wrapper.h
+++ b/include/linux/barebox-wrapper.h
@@ -38,10 +38,6 @@ static inline void vfree(const void *addr)
 #define __init
 #define __exit
 
-#define kthread_create(...)	__builtin_return_address(0)
-#define kthread_stop(...)	do { } while (0)
-#define wake_up_process(...)	do { } while (0)
-
 typedef int irqreturn_t;
 #define IRQ_NONE 0
 #define IRQ_HANDLED 0
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2021-02-15 10:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 10:27 [PATCH 0/3] usbgadget: add support for blocking USB mass storage gadget Ahmad Fatoum
2021-02-15 10:27 ` Ahmad Fatoum [this message]
2021-02-15 10:27 ` [PATCH 2/3] console: unconditionally run poller_call in ctrlc() Ahmad Fatoum
2021-02-15 10:27 ` [PATCH 3/3] usbgadget: add support for USB mass storage gadget Ahmad Fatoum
2021-02-17 11:48   ` Ahmad Fatoum

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=20210215102740.30418-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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