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
63d30543
Commit
63d30543
authored
Jan 05, 2005
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TG3]: Fix signedness issues in PHY read/write loops.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
faba374a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
drivers/net/tg3.c
drivers/net/tg3.c
+10
-6
No files found.
drivers/net/tg3.c
View file @
63d30543
...
...
@@ -493,7 +493,8 @@ static void tg3_switch_clocks(struct tg3 *tp)
static
int
tg3_readphy
(
struct
tg3
*
tp
,
int
reg
,
u32
*
val
)
{
u32
frame_val
;
int
loops
,
ret
;
unsigned
int
loops
;
int
ret
;
if
((
tp
->
mi_mode
&
MAC_MI_MODE_AUTO_POLL
)
!=
0
)
{
tw32_f
(
MAC_MI_MODE
,
...
...
@@ -512,7 +513,7 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
tw32_f
(
MAC_MI_COM
,
frame_val
);
loops
=
PHY_BUSY_LOOPS
;
while
(
loops
--
>
0
)
{
while
(
loops
!=
0
)
{
udelay
(
10
);
frame_val
=
tr32
(
MAC_MI_COM
);
...
...
@@ -521,10 +522,11 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
frame_val
=
tr32
(
MAC_MI_COM
);
break
;
}
loops
-=
1
;
}
ret
=
-
EBUSY
;
if
(
loops
>
0
)
{
if
(
loops
!=
0
)
{
*
val
=
frame_val
&
MI_COM_DATA_MASK
;
ret
=
0
;
}
...
...
@@ -540,7 +542,8 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
static
int
tg3_writephy
(
struct
tg3
*
tp
,
int
reg
,
u32
val
)
{
u32
frame_val
;
int
loops
,
ret
;
unsigned
int
loops
;
int
ret
;
if
((
tp
->
mi_mode
&
MAC_MI_MODE_AUTO_POLL
)
!=
0
)
{
tw32_f
(
MAC_MI_MODE
,
...
...
@@ -558,7 +561,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
tw32_f
(
MAC_MI_COM
,
frame_val
);
loops
=
PHY_BUSY_LOOPS
;
while
(
loops
--
>
0
)
{
while
(
loops
!=
0
)
{
udelay
(
10
);
frame_val
=
tr32
(
MAC_MI_COM
);
if
((
frame_val
&
MI_COM_BUSY
)
==
0
)
{
...
...
@@ -566,10 +569,11 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
frame_val
=
tr32
(
MAC_MI_COM
);
break
;
}
loops
-=
1
;
}
ret
=
-
EBUSY
;
if
(
loops
>
0
)
if
(
loops
!=
0
)
ret
=
0
;
if
((
tp
->
mi_mode
&
MAC_MI_MODE_AUTO_POLL
)
!=
0
)
{
...
...
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