Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
4ca79f47
Commit
4ca79f47
authored
16 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Patches
Plain Diff
NAND: fix some strict-aliasing compiler warnings
Signed-off-by:
Wolfgang Denk
<
wd@denx.de
>
parent
ff8a7aa2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/cmd_nand.c
+10
-9
10 additions, 9 deletions
common/cmd_nand.c
common/env_nand.c
+1
-1
1 addition, 1 deletion
common/env_nand.c
include/nand.h
+4
-4
4 additions, 4 deletions
include/nand.h
with
15 additions
and
14 deletions
common/cmd_nand.c
+
10
−
9
View file @
4ca79f47
...
@@ -93,7 +93,7 @@ static inline int str2long(char *p, ulong *num)
...
@@ -93,7 +93,7 @@ static inline int str2long(char *p, ulong *num)
}
}
static
int
static
int
arg_off_size
(
int
argc
,
char
*
argv
[],
nand_info_t
*
nand
,
ulong
*
off
,
ulong
*
size
)
arg_off_size
(
int
argc
,
char
*
argv
[],
nand_info_t
*
nand
,
ulong
*
off
,
size_t
*
size
)
{
{
int
idx
=
nand_curr_device
;
int
idx
=
nand_curr_device
;
#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
...
@@ -136,7 +136,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size)
...
@@ -136,7 +136,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size)
}
}
if
(
argc
>=
2
)
{
if
(
argc
>=
2
)
{
if
(
!
(
str2long
(
argv
[
1
],
size
)))
{
if
(
!
(
str2long
(
argv
[
1
],
(
ulong
*
)
size
)))
{
printf
(
"'%s' is not a number
\n
"
,
argv
[
1
]);
printf
(
"'%s' is not a number
\n
"
,
argv
[
1
]);
return
-
1
;
return
-
1
;
}
}
...
@@ -158,7 +158,8 @@ out:
...
@@ -158,7 +158,8 @@ out:
int
do_nand
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[])
int
do_nand
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[])
{
{
int
i
,
dev
,
ret
;
int
i
,
dev
,
ret
;
ulong
addr
,
off
,
size
;
ulong
addr
,
off
;
size_t
size
;
char
*
cmd
,
*
s
;
char
*
cmd
,
*
s
;
nand_info_t
*
nand
;
nand_info_t
*
nand
;
#ifdef CFG_NAND_QUIET
#ifdef CFG_NAND_QUIET
...
@@ -350,10 +351,10 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
...
@@ -350,10 +351,10 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
else
if
(
s
!=
NULL
&&
!
strcmp
(
s
,
".oob"
))
{
}
else
if
(
s
!=
NULL
&&
!
strcmp
(
s
,
".oob"
))
{
/* read out-of-band data */
/* read out-of-band data */
if
(
read
)
if
(
read
)
ret
=
nand
->
read_oob
(
nand
,
off
,
size
,
(
size_t
*
)
&
size
,
ret
=
nand
->
read_oob
(
nand
,
off
,
size
,
&
size
,
(
u_char
*
)
addr
);
(
u_char
*
)
addr
);
else
else
ret
=
nand
->
write_oob
(
nand
,
off
,
size
,
(
size_t
*
)
&
size
,
ret
=
nand
->
write_oob
(
nand
,
off
,
size
,
&
size
,
(
u_char
*
)
addr
);
(
u_char
*
)
addr
);
}
else
{
}
else
{
if
(
read
)
if
(
read
)
...
@@ -481,7 +482,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
...
@@ -481,7 +482,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
{
{
int
r
;
int
r
;
char
*
ep
,
*
s
;
char
*
ep
,
*
s
;
ulong
cnt
;
size_t
cnt
;
image_header_t
*
hdr
;
image_header_t
*
hdr
;
int
jffs2
=
0
;
int
jffs2
=
0
;
#if defined(CONFIG_FIT)
#if defined(CONFIG_FIT)
...
@@ -851,11 +852,11 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
...
@@ -851,11 +852,11 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* read out-of-band data */
/* read out-of-band data */
if
(
cmd
&
NANDRW_READ
)
{
if
(
cmd
&
NANDRW_READ
)
{
ret
=
nand_read_oob
(
nand_dev_desc
+
curr_device
,
ret
=
nand_read_oob
(
nand_dev_desc
+
curr_device
,
off
,
size
,
(
size_t
*
)
&
total
,
off
,
size
,
&
total
,
(
u_char
*
)
addr
);
(
u_char
*
)
addr
);
}
else
{
}
else
{
ret
=
nand_write_oob
(
nand_dev_desc
+
curr_device
,
ret
=
nand_write_oob
(
nand_dev_desc
+
curr_device
,
off
,
size
,
(
size_t
*
)
&
total
,
off
,
size
,
&
total
,
(
u_char
*
)
addr
);
(
u_char
*
)
addr
);
}
}
return
ret
;
return
ret
;
...
@@ -891,7 +892,7 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
...
@@ -891,7 +892,7 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
ret
=
nand_legacy_rw
(
nand_dev_desc
+
curr_device
,
ret
=
nand_legacy_rw
(
nand_dev_desc
+
curr_device
,
cmd
,
off
,
size
,
cmd
,
off
,
size
,
(
size_t
*
)
&
total
,
&
total
,
(
u_char
*
)
addr
);
(
u_char
*
)
addr
);
printf
(
" %d bytes %s: %s
\n
"
,
total
,
printf
(
" %d bytes %s: %s
\n
"
,
total
,
...
...
This diff is collapsed.
Click to expand it.
common/env_nand.c
+
1
−
1
View file @
4ca79f47
...
@@ -154,7 +154,7 @@ int env_init(void)
...
@@ -154,7 +154,7 @@ int env_init(void)
#ifdef CFG_ENV_OFFSET_REDUND
#ifdef CFG_ENV_OFFSET_REDUND
int
saveenv
(
void
)
int
saveenv
(
void
)
{
{
ulong
total
;
size_t
total
;
int
ret
=
0
;
int
ret
=
0
;
env_ptr
->
flags
++
;
env_ptr
->
flags
++
;
...
...
This diff is collapsed.
Click to expand it.
include/nand.h
+
4
−
4
View file @
4ca79f47
...
@@ -34,22 +34,22 @@ extern int nand_curr_device;
...
@@ -34,22 +34,22 @@ extern int nand_curr_device;
extern
nand_info_t
nand_info
[];
extern
nand_info_t
nand_info
[];
extern
void
nand_init
(
void
);
extern
void
nand_init
(
void
);
static
inline
int
nand_read
(
nand_info_t
*
info
,
ulong
ofs
,
ulong
*
len
,
u_char
*
buf
)
static
inline
int
nand_read
(
nand_info_t
*
info
,
off_t
ofs
,
size_t
*
len
,
u_char
*
buf
)
{
{
return
info
->
read
(
info
,
ofs
,
*
len
,
(
size_t
*
)
len
,
buf
);
return
info
->
read
(
info
,
ofs
,
*
len
,
(
size_t
*
)
len
,
buf
);
}
}
static
inline
int
nand_write
(
nand_info_t
*
info
,
ulong
ofs
,
ulong
*
len
,
u_char
*
buf
)
static
inline
int
nand_write
(
nand_info_t
*
info
,
off_t
ofs
,
size_t
*
len
,
u_char
*
buf
)
{
{
return
info
->
write
(
info
,
ofs
,
*
len
,
(
size_t
*
)
len
,
buf
);
return
info
->
write
(
info
,
ofs
,
*
len
,
(
size_t
*
)
len
,
buf
);
}
}
static
inline
int
nand_block_isbad
(
nand_info_t
*
info
,
ulong
ofs
)
static
inline
int
nand_block_isbad
(
nand_info_t
*
info
,
off_t
ofs
)
{
{
return
info
->
block_isbad
(
info
,
ofs
);
return
info
->
block_isbad
(
info
,
ofs
);
}
}
static
inline
int
nand_erase
(
nand_info_t
*
info
,
ulong
off
,
ulong
size
)
static
inline
int
nand_erase
(
nand_info_t
*
info
,
off_t
off
,
size_t
size
)
{
{
struct
erase_info
instr
;
struct
erase_info
instr
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment