Skip to content

Commit ae5624f

Browse files
JeMlaJean Delvare
authored andcommitted
i2c-dev: Fix all coding style issues
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>
1 parent 7225acf commit ae5624f

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

‎drivers/i2c/i2c-dev.c‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <linux/i2c.h>
3636
#include <linux/i2c-dev.h>
3737
#include <linux/jiffies.h>
38-
#include <asm/uaccess.h>
38+
#include <linux/uaccess.h>
3939

4040
static struct i2c_driver i2cdev_driver;
4141

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

135-
static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
136-
loff_t *offset)
135+
static ssize_t i2cdev_read(struct file *file, char __user *buf, size_t count,
136+
loff_t *offset)
137137
{
138138
char *tmp;
139139
int ret;
@@ -143,22 +143,22 @@ static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
143143
if (count > 8192)
144144
count = 8192;
145145

146-
tmp = kmalloc(count,GFP_KERNEL);
147-
if (tmp==NULL)
146+
tmp = kmalloc(count, GFP_KERNEL);
147+
if (tmp == NULL)
148148
return -ENOMEM;
149149

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

153-
ret = i2c_master_recv(client,tmp,count);
153+
ret = i2c_master_recv(client, tmp, count);
154154
if (ret >= 0)
155-
ret = copy_to_user(buf,tmp,count)?-EFAULT:ret;
155+
ret = copy_to_user(buf, tmp, count) ? -EFAULT : ret;
156156
kfree(tmp);
157157
return ret;
158158
}
159159

160-
static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t count,
161-
loff_t *offset)
160+
static ssize_t i2cdev_write(struct file *file, const char __user *buf,
161+
size_t count, loff_t *offset)
162162
{
163163
int ret;
164164
char *tmp;
@@ -167,18 +167,18 @@ static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t c
167167
if (count > 8192)
168168
count = 8192;
169169

170-
tmp = kmalloc(count,GFP_KERNEL);
171-
if (tmp==NULL)
170+
tmp = kmalloc(count, GFP_KERNEL);
171+
if (tmp == NULL)
172172
return -ENOMEM;
173-
if (copy_from_user(tmp,buf,count)) {
173+
if (copy_from_user(tmp, buf, count)) {
174174
kfree(tmp);
175175
return -EFAULT;
176176
}
177177

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

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

378-
switch ( cmd ) {
378+
switch (cmd) {
379379
case I2C_SLAVE:
380380
case I2C_SLAVE_FORCE:
381381
/* NOTE: devices set up to work with "new style" drivers
@@ -601,7 +601,7 @@ static void __exit i2c_dev_exit(void)
601601
{
602602
i2c_del_driver(&i2cdev_driver);
603603
class_destroy(i2c_dev_class);
604-
unregister_chrdev(I2C_MAJOR,"i2c");
604+
unregister_chrdev(I2C_MAJOR, "i2c");
605605
}
606606

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

0 commit comments

Comments
 (0)