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
Kirill Smelkov
linux
Commits
d30f0c9d
Commit
d30f0c9d
authored
Jun 09, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I2C: sparse cleanups for drivers/i2c/*
Signed-off-by:
Greg Kroah-Hartman
<
greg@kroah.com
>
parent
3499c9eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
drivers/i2c/chips/it87.c
drivers/i2c/chips/it87.c
+4
-1
drivers/i2c/i2c-dev.c
drivers/i2c/i2c-dev.c
+3
-4
No files found.
drivers/i2c/chips/it87.c
View file @
d30f0c9d
...
@@ -170,8 +170,11 @@ static inline u8 FAN_TO_REG(long rpm, int div)
...
@@ -170,8 +170,11 @@ static inline u8 FAN_TO_REG(long rpm, int div)
static
int
DIV_TO_REG
(
int
val
)
static
int
DIV_TO_REG
(
int
val
)
{
{
int
answer
=
0
;
int
answer
=
0
;
while
((
val
>>=
1
))
val
>>=
1
;
while
(
val
)
{
answer
++
;
answer
++
;
val
>>=
1
;
}
return
answer
;
return
answer
;
}
}
#define DIV_FROM_REG(val) (1 << (val))
#define DIV_FROM_REG(val) (1 << (val))
...
...
drivers/i2c/i2c-dev.c
View file @
d30f0c9d
...
@@ -181,7 +181,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -181,7 +181,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
struct
i2c_smbus_ioctl_data
data_arg
;
struct
i2c_smbus_ioctl_data
data_arg
;
union
i2c_smbus_data
temp
;
union
i2c_smbus_data
temp
;
struct
i2c_msg
*
rdwr_pa
;
struct
i2c_msg
*
rdwr_pa
;
u8
**
data_ptrs
;
u8
__user
**
data_ptrs
;
int
i
,
datasize
,
res
;
int
i
,
datasize
,
res
;
unsigned
long
funcs
;
unsigned
long
funcs
;
...
@@ -238,8 +238,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -238,8 +238,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
return
-
EFAULT
;
return
-
EFAULT
;
}
}
data_ptrs
=
(
u8
**
)
kmalloc
(
rdwr_arg
.
nmsgs
*
sizeof
(
u8
*
),
data_ptrs
=
kmalloc
(
rdwr_arg
.
nmsgs
*
sizeof
(
u8
__user
*
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
data_ptrs
==
NULL
)
{
if
(
data_ptrs
==
NULL
)
{
kfree
(
rdwr_pa
);
kfree
(
rdwr_pa
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -252,7 +251,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -252,7 +251,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
res
=
-
EINVAL
;
res
=
-
EINVAL
;
break
;
break
;
}
}
data_ptrs
[
i
]
=
rdwr_pa
[
i
].
buf
;
data_ptrs
[
i
]
=
(
u8
__user
*
)
rdwr_pa
[
i
].
buf
;
rdwr_pa
[
i
].
buf
=
kmalloc
(
rdwr_pa
[
i
].
len
,
GFP_KERNEL
);
rdwr_pa
[
i
].
buf
=
kmalloc
(
rdwr_pa
[
i
].
len
,
GFP_KERNEL
);
if
(
rdwr_pa
[
i
].
buf
==
NULL
)
{
if
(
rdwr_pa
[
i
].
buf
==
NULL
)
{
res
=
-
ENOMEM
;
res
=
-
ENOMEM
;
...
...
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