Skip to content

Commit

Permalink
i2c-dev: Fix all coding style issues
Browse files Browse the repository at this point in the history
Fix all coding style issues found by checkpatch.pl.

Signed-off-by: Farid Hammane <farid.hammane@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Farid Hammane authored and Jean Delvare committed May 21, 2010
1 parent 7225acf commit ae5624f
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions drivers/i2c/i2c-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <linux/jiffies.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>

static struct i2c_driver i2cdev_driver;

Expand Down Expand Up @@ -132,8 +132,8 @@ static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
* needed by those system calls and by this SMBus interface.
*/

static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
loff_t *offset)
static ssize_t i2cdev_read(struct file *file, char __user *buf, size_t count,
loff_t *offset)
{
char *tmp;
int ret;
Expand All @@ -143,22 +143,22 @@ static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
if (count > 8192)
count = 8192;

tmp = kmalloc(count,GFP_KERNEL);
if (tmp==NULL)
tmp = kmalloc(count, GFP_KERNEL);
if (tmp == NULL)
return -ENOMEM;

pr_debug("i2c-dev: i2c-%d reading %zu bytes.\n",
iminor(file->f_path.dentry->d_inode), count);

ret = i2c_master_recv(client,tmp,count);
ret = i2c_master_recv(client, tmp, count);
if (ret >= 0)
ret = copy_to_user(buf,tmp,count)?-EFAULT:ret;
ret = copy_to_user(buf, tmp, count) ? -EFAULT : ret;
kfree(tmp);
return ret;
}

static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t count,
loff_t *offset)
static ssize_t i2cdev_write(struct file *file, const char __user *buf,
size_t count, loff_t *offset)
{
int ret;
char *tmp;
Expand All @@ -167,18 +167,18 @@ static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t c
if (count > 8192)
count = 8192;

tmp = kmalloc(count,GFP_KERNEL);
if (tmp==NULL)
tmp = kmalloc(count, GFP_KERNEL);
if (tmp == NULL)
return -ENOMEM;
if (copy_from_user(tmp,buf,count)) {
if (copy_from_user(tmp, buf, count)) {
kfree(tmp);
return -EFAULT;
}

pr_debug("i2c-dev: i2c-%d writing %zu bytes.\n",
iminor(file->f_path.dentry->d_inode), count);

ret = i2c_master_send(client,tmp,count);
ret = i2c_master_send(client, tmp, count);
kfree(tmp);
return ret;
}
Expand Down Expand Up @@ -375,7 +375,7 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
dev_dbg(&client->adapter->dev, "ioctl, cmd=0x%02x, arg=0x%02lx\n",
cmd, arg);

switch ( cmd ) {
switch (cmd) {
case I2C_SLAVE:
case I2C_SLAVE_FORCE:
/* NOTE: devices set up to work with "new style" drivers
Expand Down Expand Up @@ -601,7 +601,7 @@ static void __exit i2c_dev_exit(void)
{
i2c_del_driver(&i2cdev_driver);
class_destroy(i2c_dev_class);
unregister_chrdev(I2C_MAJOR,"i2c");
unregister_chrdev(I2C_MAJOR, "i2c");
}

MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and "
Expand Down

0 comments on commit ae5624f

Please sign in to comment.