Commit 04fc8bbc authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

kill DECLARE_MUTEX_LOCKED

DECLARE_MUTEX_LOCKED was used for semaphores used as completions and we've
got rid of them.  Well, except for one in libusual that the maintainer
explicitly wants to keep as semaphore.  So convert that useage to an
explicit sema_init and kill of DECLARE_MUTEX_LOCKED so that new code is
reminded to use a completion.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatar"Satyam Sharma" <satyam.sharma@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4029a917
...@@ -30,7 +30,7 @@ static atomic_t usu_bias = ATOMIC_INIT(USB_US_DEFAULT_BIAS); ...@@ -30,7 +30,7 @@ static atomic_t usu_bias = ATOMIC_INIT(USB_US_DEFAULT_BIAS);
#define BIAS_NAME_SIZE (sizeof("usb-storage")) #define BIAS_NAME_SIZE (sizeof("usb-storage"))
static const char *bias_names[3] = { "none", "usb-storage", "ub" }; static const char *bias_names[3] = { "none", "usb-storage", "ub" };
static DECLARE_MUTEX_LOCKED(usu_init_notify); static struct semaphore usu_init_notify;
static DECLARE_COMPLETION(usu_end_notify); static DECLARE_COMPLETION(usu_end_notify);
static atomic_t total_threads = ATOMIC_INIT(0); static atomic_t total_threads = ATOMIC_INIT(0);
...@@ -204,6 +204,8 @@ static int __init usb_usual_init(void) ...@@ -204,6 +204,8 @@ static int __init usb_usual_init(void)
{ {
int rc; int rc;
sema_init(&usu_init_notify, 0);
rc = usb_register(&usu_driver); rc = usb_register(&usu_driver);
up(&usu_init_notify); up(&usu_init_notify);
return rc; return rc;
......
...@@ -30,7 +30,6 @@ struct semaphore { ...@@ -30,7 +30,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init(struct semaphore *sem, int val) static inline void sema_init(struct semaphore *sem, int val)
{ {
......
...@@ -28,7 +28,6 @@ struct semaphore { ...@@ -28,7 +28,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INIT(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init(struct semaphore *sem, int val) static inline void sema_init(struct semaphore *sem, int val)
{ {
......
...@@ -36,7 +36,6 @@ struct semaphore { ...@@ -36,7 +36,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -35,7 +35,6 @@ struct semaphore { ...@@ -35,7 +35,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init(struct semaphore *sem, int val) static inline void sema_init(struct semaphore *sem, int val)
{ {
......
...@@ -35,7 +35,6 @@ struct semaphore { ...@@ -35,7 +35,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init(struct semaphore *sem, int val) static inline void sema_init(struct semaphore *sem, int val)
{ {
......
...@@ -49,7 +49,6 @@ struct semaphore { ...@@ -49,7 +49,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -39,7 +39,6 @@ struct semaphore { ...@@ -39,7 +39,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -28,7 +28,6 @@ struct semaphore { ...@@ -28,7 +28,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) struct semaphore name = __SEMAPHORE_INITIALIZER(name, count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
static inline void static inline void
sema_init (struct semaphore *sem, int val) sema_init (struct semaphore *sem, int val)
......
...@@ -35,7 +35,6 @@ struct semaphore { ...@@ -35,7 +35,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -40,7 +40,6 @@ struct semaphore { ...@@ -40,7 +40,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init(struct semaphore *sem, int val) static inline void sema_init(struct semaphore *sem, int val)
{ {
......
...@@ -39,7 +39,6 @@ struct semaphore { ...@@ -39,7 +39,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -49,7 +49,6 @@ struct semaphore { ...@@ -49,7 +49,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) struct semaphore name = __SEMAPHORE_INITIALIZER(name, count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
static inline void sema_init(struct semaphore *sem, int val) static inline void sema_init(struct semaphore *sem, int val)
{ {
......
...@@ -53,7 +53,6 @@ struct semaphore { ...@@ -53,7 +53,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
extern inline void sema_init (struct semaphore *sem, int val) extern inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -35,7 +35,6 @@ struct semaphore { ...@@ -35,7 +35,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -33,7 +33,6 @@ struct semaphore { ...@@ -33,7 +33,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -37,7 +37,6 @@ struct semaphore { ...@@ -37,7 +37,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -44,7 +44,6 @@ struct semaphore { ...@@ -44,7 +44,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -26,7 +26,6 @@ struct semaphore { ...@@ -26,7 +26,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -26,7 +26,6 @@ struct semaphore { ...@@ -26,7 +26,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -22,7 +22,6 @@ struct semaphore { ...@@ -22,7 +22,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER (name,count) struct semaphore name = __SEMAPHORE_INITIALIZER (name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC (name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -59,7 +59,6 @@ struct semaphore { ...@@ -59,7 +59,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -60,7 +60,6 @@ struct semaphore { ...@@ -60,7 +60,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
...@@ -33,7 +33,6 @@ struct semaphore { ...@@ -33,7 +33,6 @@ struct semaphore {
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
static inline void sema_init (struct semaphore *sem, int val) static inline void sema_init (struct semaphore *sem, int val)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment