* [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c
@ 2010-03-09 6:15 Eli Lindsey
2010-03-09 6:15 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Eli Lindsey
2010-04-08 20:20 ` [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c Greg KH
0 siblings, 2 replies; 6+ messages in thread
From: Eli Lindsey @ 2010-03-09 6:15 UTC (permalink / raw)
To: gregkh, d; +Cc: devel, linux-kernel, Eli Lindsey
This is a patch to tranzport.c that removes two cases of unnecessary whitespace
before a quoted newline found by the checkpatch.pl tool
Signed-off-by: Eli Lindsey <eli@siliconsprawl.com>
---
drivers/staging/frontier/tranzport.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/frontier/tranzport.c b/drivers/staging/frontier/tranzport.c
index 2f03f43..1f91001 100644
--- a/drivers/staging/frontier/tranzport.c
+++ b/drivers/staging/frontier/tranzport.c
@@ -255,7 +255,7 @@ static void usb_tranzport_interrupt_in_callback(struct urb *urb)
if (urb->actual_length != 8) {
dev_warn(&dev->intf->dev,
"Urb length was %d bytes!!"
- "Do something intelligent \n",
+ "Do something intelligent\n",
urb->actual_length);
} else {
dbg_info(&dev->intf->dev,
@@ -724,7 +724,7 @@ static ssize_t usb_tranzport_write(struct file *file,
}
if (dev->interrupt_out_endpoint == NULL) {
- err("Endpoint should not be be null! \n");
+ err("Endpoint should not be be null!\n");
goto unlock_exit;
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c
2010-03-09 6:15 [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c Eli Lindsey
@ 2010-03-09 6:15 ` Eli Lindsey
2010-03-09 6:15 ` [PATCH 3/4] staging: frontier: switch to strict_strtoul in tranzport.c Eli Lindsey
2010-04-08 20:21 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Greg KH
2010-04-08 20:20 ` [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c Greg KH
1 sibling, 2 replies; 6+ messages in thread
From: Eli Lindsey @ 2010-03-09 6:15 UTC (permalink / raw)
To: gregkh, d; +Cc: devel, linux-kernel, Eli Lindsey
This is a patch to alphatrack.c that removes three cases of unnecessary
whitespace before a quoted newline found by the checkpatch.pl tool
Signed-off-by: Eli Lindsey <eli@siliconsprawl.com>
---
drivers/staging/frontier/alphatrack.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
index a50a215..ce4d663 100644
--- a/drivers/staging/frontier/alphatrack.c
+++ b/drivers/staging/frontier/alphatrack.c
@@ -238,7 +238,7 @@ static void usb_alphatrack_interrupt_in_callback(struct urb *urb)
if (urb->actual_length != INPUT_CMD_SIZE) {
dev_warn(&dev->intf->dev,
"Urb length was %d bytes!!"
- "Do something intelligent \n", urb->actual_length);
+ "Do something intelligent\n", urb->actual_length);
} else {
alphatrack_ocmd_info(&dev->intf->dev,
&(*dev->ring_buffer)[dev->ring_tail].cmd,
@@ -599,7 +599,7 @@ static ssize_t usb_alphatrack_write(struct file *file,
}
if (dev->interrupt_out_endpoint == NULL) {
- err("Endpoint should not be be null! \n");
+ err("Endpoint should not be be null!\n");
goto unlock_exit;
}
@@ -771,7 +771,7 @@ static int usb_alphatrack_probe(struct usb_interface *intf,
kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);
if (!dev->write_buffer) {
- dev_err(&intf->dev, "Couldn't allocate write_buffer \n");
+ dev_err(&intf->dev, "Couldn't allocate write_buffer\n");
goto error;
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] staging: frontier: switch to strict_strtoul in tranzport.c
2010-03-09 6:15 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Eli Lindsey
@ 2010-03-09 6:15 ` Eli Lindsey
2010-03-09 6:15 ` [PATCH 4/4] staging: frontier: switch semaphores to mutexes Eli Lindsey
2010-04-08 20:21 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Greg KH
1 sibling, 1 reply; 6+ messages in thread
From: Eli Lindsey @ 2010-03-09 6:15 UTC (permalink / raw)
To: gregkh, d; +Cc: devel, linux-kernel, Eli Lindsey
This is a patch to tranzport.c that changes a use of simple_strtoul to
strict_strtoul at the suggestion of checkpatch.pl
Signed-off-by: Eli Lindsey <eli@siliconsprawl.com>
---
drivers/staging/frontier/tranzport.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/frontier/tranzport.c b/drivers/staging/frontier/tranzport.c
index 1f91001..f9ab4f3 100644
--- a/drivers/staging/frontier/tranzport.c
+++ b/drivers/staging/frontier/tranzport.c
@@ -198,7 +198,9 @@ static void usb_tranzport_abort_transfers(struct usb_tranzport *dev)
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_tranzport *t = usb_get_intfdata(intf); \
- int temp = simple_strtoul(buf, NULL, 10); \
+ unsigned long temp; \
+ if (strict_strtoul(buf, 10, &temp)) \
+ return -EINVAL; \
t->value = temp; \
return count; \
} \
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] staging: frontier: switch semaphores to mutexes
2010-03-09 6:15 ` [PATCH 3/4] staging: frontier: switch to strict_strtoul in tranzport.c Eli Lindsey
@ 2010-03-09 6:15 ` Eli Lindsey
0 siblings, 0 replies; 6+ messages in thread
From: Eli Lindsey @ 2010-03-09 6:15 UTC (permalink / raw)
To: gregkh, d; +Cc: devel, linux-kernel, Eli Lindsey
This patch changes the use of semaphores in alphatrack.c and tranzport.c to
mutexes at the suggestion of checkpatch.pl
Signed-off-by: Eli Lindsey <eli@siliconsprawl.com>
---
drivers/staging/frontier/alphatrack.c | 28 ++++++++++++++--------------
drivers/staging/frontier/tranzport.c | 28 ++++++++++++++--------------
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
index ce4d663..4e52105 100644
--- a/drivers/staging/frontier/alphatrack.c
+++ b/drivers/staging/frontier/alphatrack.c
@@ -134,7 +134,7 @@ MODULE_PARM_DESC(min_interrupt_out_interval,
/* Structure to hold all of our device specific stuff */
struct usb_alphatrack {
- struct semaphore sem; /* locks this structure */
+ struct mutex mtx; /* locks this structure */
struct usb_interface *intf; /* save off the usb interface pointer */
int open_count; /* number of times this port has been opened */
@@ -347,7 +347,7 @@ static int usb_alphatrack_open(struct inode *inode, struct file *file)
}
/* lock this device */
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto unlock_disconnect_exit;
}
@@ -390,7 +390,7 @@ static int usb_alphatrack_open(struct inode *inode, struct file *file)
file->private_data = dev;
unlock_exit:
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
unlock_disconnect_exit:
mutex_unlock(&disconnect_mutex);
@@ -413,7 +413,7 @@ static int usb_alphatrack_release(struct inode *inode, struct file *file)
goto exit;
}
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
@@ -425,7 +425,7 @@ static int usb_alphatrack_release(struct inode *inode, struct file *file)
if (dev->intf == NULL) {
/* the device was unplugged before the file was released */
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
/* unlock here as usb_alphatrack_delete frees dev */
usb_alphatrack_delete(dev);
retval = -ENODEV;
@@ -441,7 +441,7 @@ static int usb_alphatrack_release(struct inode *inode, struct file *file)
dev->open_count = 0;
unlock_exit:
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
exit:
return retval;
@@ -486,7 +486,7 @@ static ssize_t usb_alphatrack_read(struct file *file, char __user *buffer,
goto exit;
/* lock this object */
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
@@ -532,7 +532,7 @@ static ssize_t usb_alphatrack_read(struct file *file, char __user *buffer,
unlock_exit:
/* unlock the device */
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
exit:
return retval;
@@ -556,7 +556,7 @@ static ssize_t usb_alphatrack_write(struct file *file,
goto exit;
/* lock this object */
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
@@ -627,7 +627,7 @@ static ssize_t usb_alphatrack_write(struct file *file,
unlock_exit:
/* unlock the device */
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
exit:
return retval;
@@ -678,7 +678,7 @@ static int usb_alphatrack_probe(struct usb_interface *intf,
dev_err(&intf->dev, "Out of memory\n");
goto exit;
}
- init_MUTEX(&dev->sem);
+ mutex_init(&dev->mtx);
dev->intf = intf;
init_waitqueue_head(&dev->read_wait);
init_waitqueue_head(&dev->write_wait);
@@ -835,7 +835,7 @@ static void usb_alphatrack_disconnect(struct usb_interface *intf)
dev = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL);
- down(&dev->sem);
+ mutex_lock(&dev->mtx);
minor = intf->minor;
@@ -844,11 +844,11 @@ static void usb_alphatrack_disconnect(struct usb_interface *intf)
/* if the device is not opened, then we clean up right now */
if (!dev->open_count) {
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
usb_alphatrack_delete(dev);
} else {
dev->intf = NULL;
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
}
atomic_set(&dev->writes_pending, 0);
diff --git a/drivers/staging/frontier/tranzport.c b/drivers/staging/frontier/tranzport.c
index f9ab4f3..eed74f0 100644
--- a/drivers/staging/frontier/tranzport.c
+++ b/drivers/staging/frontier/tranzport.c
@@ -123,7 +123,7 @@ struct tranzport_cmd {
/* Structure to hold all of our device specific stuff */
struct usb_tranzport {
- struct semaphore sem; /* locks this structure */
+ struct mutex mtx; /* locks this structure */
struct usb_interface *intf; /* save off the usb interface pointer */
int open_count; /* number of times this port opened */
struct tranzport_cmd (*ring_buffer)[RING_BUFFER_SIZE];
@@ -367,7 +367,7 @@ static int usb_tranzport_open(struct inode *inode, struct file *file)
}
/* lock this device */
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto unlock_disconnect_exit;
}
@@ -411,7 +411,7 @@ static int usb_tranzport_open(struct inode *inode, struct file *file)
file->private_data = dev;
unlock_exit:
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
unlock_disconnect_exit:
mutex_unlock(&disconnect_mutex);
@@ -434,7 +434,7 @@ static int usb_tranzport_release(struct inode *inode, struct file *file)
goto exit;
}
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
@@ -446,7 +446,7 @@ static int usb_tranzport_release(struct inode *inode, struct file *file)
if (dev->intf == NULL) {
/* the device was unplugged before the file was released */
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
/* unlock here as usb_tranzport_delete frees dev */
usb_tranzport_delete(dev);
retval = -ENODEV;
@@ -462,7 +462,7 @@ static int usb_tranzport_release(struct inode *inode, struct file *file)
dev->open_count = 0;
unlock_exit:
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
exit:
return retval;
@@ -512,7 +512,7 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer,
goto exit;
/* lock this object */
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
@@ -660,7 +660,7 @@ retval = 8;
unlock_exit:
/* unlock the device */
-up(&dev->sem);
+mutex_unlock(&dev->mtx);
exit:
return retval;
@@ -684,7 +684,7 @@ static ssize_t usb_tranzport_write(struct file *file,
goto exit;
/* lock this object */
- if (down_interruptible(&dev->sem)) {
+ if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
@@ -753,7 +753,7 @@ static ssize_t usb_tranzport_write(struct file *file,
unlock_exit:
/* unlock the device */
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
exit:
return retval;
@@ -802,7 +802,7 @@ static int usb_tranzport_probe(struct usb_interface *intf,
dev_err(&intf->dev, "Out of memory\n");
goto exit;
}
- init_MUTEX(&dev->sem);
+ mutex_init(&dev->mtx);
dev->intf = intf;
init_waitqueue_head(&dev->read_wait);
init_waitqueue_head(&dev->write_wait);
@@ -942,18 +942,18 @@ static void usb_tranzport_disconnect(struct usb_interface *intf)
mutex_lock(&disconnect_mutex);
dev = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL);
- down(&dev->sem);
+ mutex_lock(&dev->mtx);
minor = intf->minor;
/* give back our minor */
usb_deregister_dev(intf, &usb_tranzport_class);
/* if the device is not opened, then we clean up right now */
if (!dev->open_count) {
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
usb_tranzport_delete(dev);
} else {
dev->intf = NULL;
- up(&dev->sem);
+ mutex_unlock(&dev->mtx);
}
mutex_unlock(&disconnect_mutex);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c
2010-03-09 6:15 [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c Eli Lindsey
2010-03-09 6:15 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Eli Lindsey
@ 2010-04-08 20:20 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2010-04-08 20:20 UTC (permalink / raw)
To: Eli Lindsey; +Cc: gregkh, d, devel, linux-kernel
On Tue, Mar 09, 2010 at 12:15:30AM -0600, Eli Lindsey wrote:
> This is a patch to tranzport.c that removes two cases of unnecessary whitespace
> before a quoted newline found by the checkpatch.pl tool
This is already in the tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c
2010-03-09 6:15 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Eli Lindsey
2010-03-09 6:15 ` [PATCH 3/4] staging: frontier: switch to strict_strtoul in tranzport.c Eli Lindsey
@ 2010-04-08 20:21 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2010-04-08 20:21 UTC (permalink / raw)
To: Eli Lindsey; +Cc: gregkh, d, devel, linux-kernel
On Tue, Mar 09, 2010 at 12:15:31AM -0600, Eli Lindsey wrote:
> This is a patch to alphatrack.c that removes three cases of unnecessary
> whitespace before a quoted newline found by the checkpatch.pl tool
This is already in the tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-08 20:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-09 6:15 [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c Eli Lindsey
2010-03-09 6:15 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Eli Lindsey
2010-03-09 6:15 ` [PATCH 3/4] staging: frontier: switch to strict_strtoul in tranzport.c Eli Lindsey
2010-03-09 6:15 ` [PATCH 4/4] staging: frontier: switch semaphores to mutexes Eli Lindsey
2010-04-08 20:21 ` [PATCH 2/4] staging: frontier: fix extra spaces in alphatrack.c Greg KH
2010-04-08 20:20 ` [PATCH 1/4] staging: frontier: fix extra spaces in tranzport.c Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox