Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
dc4f36c8
Commit
dc4f36c8
authored
Jun 10, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] I2C: fix up sparse warnings in the i2c-dev driver
parent
043d475a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
drivers/i2c/i2c-dev.c
drivers/i2c/i2c-dev.c
+5
-5
include/linux/i2c-dev.h
include/linux/i2c-dev.h
+3
-3
No files found.
drivers/i2c/i2c-dev.c
View file @
dc4f36c8
...
...
@@ -122,7 +122,7 @@ static ssize_t show_dev(struct class_device *class_dev, char *buf)
}
static
CLASS_DEVICE_ATTR
(
dev
,
S_IRUGO
,
show_dev
,
NULL
);
static
ssize_t
i2cdev_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
static
ssize_t
i2cdev_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
char
*
tmp
;
...
...
@@ -147,7 +147,7 @@ static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
return
ret
;
}
static
ssize_t
i2cdev_write
(
struct
file
*
file
,
const
char
*
buf
,
size_t
count
,
static
ssize_t
i2cdev_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
offset
)
{
int
ret
;
...
...
@@ -211,12 +211,12 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
return
0
;
case
I2C_FUNCS
:
funcs
=
i2c_get_functionality
(
client
->
adapter
);
return
(
copy_to_user
((
unsigned
long
*
)
arg
,
&
funcs
,
return
(
copy_to_user
((
unsigned
long
__user
*
)
arg
,
&
funcs
,
sizeof
(
unsigned
long
)))
?-
EFAULT
:
0
;
case
I2C_RDWR
:
if
(
copy_from_user
(
&
rdwr_arg
,
(
struct
i2c_rdwr_ioctl_data
*
)
arg
,
(
struct
i2c_rdwr_ioctl_data
__user
*
)
arg
,
sizeof
(
rdwr_arg
)))
return
-
EFAULT
;
...
...
@@ -284,7 +284,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
case
I2C_SMBUS
:
if
(
copy_from_user
(
&
data_arg
,
(
struct
i2c_smbus_ioctl_data
*
)
arg
,
(
struct
i2c_smbus_ioctl_data
__user
*
)
arg
,
sizeof
(
struct
i2c_smbus_ioctl_data
)))
return
-
EFAULT
;
if
((
data_arg
.
size
!=
I2C_SMBUS_BYTE
)
&&
...
...
include/linux/i2c-dev.h
View file @
dc4f36c8
...
...
@@ -34,12 +34,12 @@ struct i2c_smbus_ioctl_data {
__u8
read_write
;
__u8
command
;
__u32
size
;
union
i2c_smbus_data
*
data
;
union
i2c_smbus_data
__user
*
data
;
};
/* This is the structure as used in the I2C_RDWR ioctl call */
struct
i2c_rdwr_ioctl_data
{
struct
i2c_msg
*
msgs
;
/* pointers to i2c_msgs */
struct
i2c_msg
__user
*
msgs
;
/* pointers to i2c_msgs */
__u32
nmsgs
;
/* number of i2c_msgs */
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment