From: matt mooney <mfm@muteddisk.com> To: Greg Kroah-Hartman <greg@kroah.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 07/16] staging: usbip: usbip_event.c: coding style cleanup Date: Fri, 6 May 2011 03:47:47 -0700 [thread overview] Message-ID: <abed1c2c2d74725f88e5f1e2c3dd9bf83cb2bae7.1304676742.git.mfm@muteddisk.com> (raw) In-Reply-To: <cover.1304676742.git.mfm@muteddisk.com> Fix a few alignment issues and remove extraneous lines. Signed-off-by: matt mooney <mfm@muteddisk.com> --- drivers/staging/usbip/usbip_event.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c index f4b287e..8861e3b 100644 --- a/drivers/staging/usbip/usbip_event.c +++ b/drivers/staging/usbip/usbip_event.c @@ -17,8 +17,8 @@ * USA. */ -#include "usbip_common.h" #include <linux/kthread.h> +#include "usbip_common.h" static int event_handler(struct usbip_device *ud) { @@ -36,21 +36,18 @@ static int event_handler(struct usbip_device *ud) */ if (ud->event & USBIP_EH_SHUTDOWN) { ud->eh_ops.shutdown(ud); - ud->event &= ~USBIP_EH_SHUTDOWN; } /* Reset the device. */ if (ud->event & USBIP_EH_RESET) { ud->eh_ops.reset(ud); - ud->event &= ~USBIP_EH_RESET; } /* Mark the device as unusable. */ if (ud->event & USBIP_EH_UNUSABLE) { ud->eh_ops.unusable(ud); - ud->event &= ~USBIP_EH_UNUSABLE; } @@ -68,13 +65,14 @@ static int event_handler_loop(void *data) while (!kthread_should_stop()) { wait_event_interruptible(ud->eh_waitq, - usbip_event_happened(ud) || - kthread_should_stop()); + usbip_event_happened(ud) || + kthread_should_stop()); usbip_dbg_eh("wakeup\n"); if (event_handler(ud) < 0) break; } + return 0; } @@ -86,9 +84,10 @@ int usbip_start_eh(struct usbip_device *ud) ud->eh = kthread_run(event_handler_loop, ud, "usbip_eh"); if (IS_ERR(ud->eh)) { printk(KERN_WARNING - "Unable to start control thread\n"); + "Unable to start control thread\n"); return PTR_ERR(ud->eh); } + return 0; } EXPORT_SYMBOL_GPL(usbip_start_eh); @@ -106,11 +105,8 @@ EXPORT_SYMBOL_GPL(usbip_stop_eh); void usbip_event_add(struct usbip_device *ud, unsigned long event) { spin_lock(&ud->lock); - ud->event |= event; - wake_up(&ud->eh_waitq); - spin_unlock(&ud->lock); } EXPORT_SYMBOL_GPL(usbip_event_add); @@ -120,10 +116,8 @@ int usbip_event_happened(struct usbip_device *ud) int happened = 0; spin_lock(&ud->lock); - if (ud->event != 0) happened = 1; - spin_unlock(&ud->lock); return happened; -- 1.7.5.1
WARNING: multiple messages have this Message-ID (diff)
From: matt mooney <mfm@muteddisk.com> To: Greg Kroah-Hartman <greg@kroah.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 07/16] staging: usbip: usbip_event.c: coding style cleanup Date: Fri, 06 May 2011 10:47:47 +0000 [thread overview] Message-ID: <abed1c2c2d74725f88e5f1e2c3dd9bf83cb2bae7.1304676742.git.mfm@muteddisk.com> (raw) In-Reply-To: <cover.1304676742.git.mfm@muteddisk.com> Fix a few alignment issues and remove extraneous lines. Signed-off-by: matt mooney <mfm@muteddisk.com> --- drivers/staging/usbip/usbip_event.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c index f4b287e..8861e3b 100644 --- a/drivers/staging/usbip/usbip_event.c +++ b/drivers/staging/usbip/usbip_event.c @@ -17,8 +17,8 @@ * USA. */ -#include "usbip_common.h" #include <linux/kthread.h> +#include "usbip_common.h" static int event_handler(struct usbip_device *ud) { @@ -36,21 +36,18 @@ static int event_handler(struct usbip_device *ud) */ if (ud->event & USBIP_EH_SHUTDOWN) { ud->eh_ops.shutdown(ud); - ud->event &= ~USBIP_EH_SHUTDOWN; } /* Reset the device. */ if (ud->event & USBIP_EH_RESET) { ud->eh_ops.reset(ud); - ud->event &= ~USBIP_EH_RESET; } /* Mark the device as unusable. */ if (ud->event & USBIP_EH_UNUSABLE) { ud->eh_ops.unusable(ud); - ud->event &= ~USBIP_EH_UNUSABLE; } @@ -68,13 +65,14 @@ static int event_handler_loop(void *data) while (!kthread_should_stop()) { wait_event_interruptible(ud->eh_waitq, - usbip_event_happened(ud) || - kthread_should_stop()); + usbip_event_happened(ud) || + kthread_should_stop()); usbip_dbg_eh("wakeup\n"); if (event_handler(ud) < 0) break; } + return 0; } @@ -86,9 +84,10 @@ int usbip_start_eh(struct usbip_device *ud) ud->eh = kthread_run(event_handler_loop, ud, "usbip_eh"); if (IS_ERR(ud->eh)) { printk(KERN_WARNING - "Unable to start control thread\n"); + "Unable to start control thread\n"); return PTR_ERR(ud->eh); } + return 0; } EXPORT_SYMBOL_GPL(usbip_start_eh); @@ -106,11 +105,8 @@ EXPORT_SYMBOL_GPL(usbip_stop_eh); void usbip_event_add(struct usbip_device *ud, unsigned long event) { spin_lock(&ud->lock); - ud->event |= event; - wake_up(&ud->eh_waitq); - spin_unlock(&ud->lock); } EXPORT_SYMBOL_GPL(usbip_event_add); @@ -120,10 +116,8 @@ int usbip_event_happened(struct usbip_device *ud) int happened = 0; spin_lock(&ud->lock); - if (ud->event != 0) happened = 1; - spin_unlock(&ud->lock); return happened; -- 1.7.5.1
next prev parent reply other threads:[~2011-05-06 10:57 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-05-06 10:47 [PATCH 00/16] staging: usbip: cleanup matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 01/16] staging: usbip: stub_dev.c: coding style cleanup matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 02/16] staging: usbip: stub_main.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 03/16] staging: usbip: stub_rx.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 04/16] staging: usbip: stub_tx.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 05/16] staging: usbip: usbip_common.h: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 06/16] staging: usbip: usbip_common.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` matt mooney [this message] 2011-05-06 10:47 ` [PATCH 07/16] staging: usbip: usbip_event.c: " matt mooney 2011-05-06 10:47 ` [PATCH 08/16] staging: usbip: stub.h: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 09/16] staging: usbip: vhci.h: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 10/16] staging: usbip: vhci_hcd.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 11/16] staging: usbip: vhci_rx.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 12/16] staging: usbip: vhci_sysfs.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 13/16] staging: usbip: vhci_tx.c: " matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 14/16] staging: usbip: add break to default case in switch statements matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 15/16] staging: usbip: remove section dividers matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 10:47 ` [PATCH 16/16] staging: usbip: fixup MODULE_ macros matt mooney 2011-05-06 10:47 ` matt mooney 2011-05-06 21:27 ` [PATCH 00/16] staging: usbip: cleanup Greg KH 2011-05-06 21:27 ` Greg KH
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=abed1c2c2d74725f88e5f1e2c3dd9bf83cb2bae7.1304676742.git.mfm@muteddisk.com \ --to=mfm@muteddisk.com \ --cc=greg@kroah.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-kernel@vger.kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.