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
7140ae4b
Commit
7140ae4b
authored
Jul 10, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jul 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: NULL noise is mtd
0->NULL conversions in mtd
parent
b706f5fa
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
35 additions
and
35 deletions
+35
-35
drivers/mtd/chips/amd_flash.c
drivers/mtd/chips/amd_flash.c
+1
-1
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/chips/cfi_cmdset_0001.c
+1
-1
drivers/mtd/chips/jedec.c
drivers/mtd/chips/jedec.c
+7
-7
drivers/mtd/chips/jedec_probe.c
drivers/mtd/chips/jedec_probe.c
+1
-1
drivers/mtd/cmdlinepart.c
drivers/mtd/cmdlinepart.c
+5
-5
drivers/mtd/devices/doc2000.c
drivers/mtd/devices/doc2000.c
+2
-2
drivers/mtd/devices/doc2001.c
drivers/mtd/devices/doc2001.c
+2
-2
drivers/mtd/maps/amd76xrom.c
drivers/mtd/maps/amd76xrom.c
+6
-6
drivers/mtd/maps/ich2rom.c
drivers/mtd/maps/ich2rom.c
+5
-5
drivers/mtd/maps/physmap.c
drivers/mtd/maps/physmap.c
+2
-2
drivers/mtd/mtdcore.c
drivers/mtd/mtdcore.c
+2
-2
drivers/mtd/nand/nand.c
drivers/mtd/nand/nand.c
+1
-1
No files found.
drivers/mtd/chips/amd_flash.c
View file @
7140ae4b
...
...
@@ -718,7 +718,7 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
"memory for MTD erase region info
\n
"
,
map
->
name
);
kfree
(
mtd
);
map
->
fldrv_priv
=
NULL
;
return
0
;
return
NULL
;
}
reg_idx
=
0
;
...
...
drivers/mtd/chips/cfi_cmdset_0001.c
View file @
7140ae4b
...
...
@@ -1424,7 +1424,7 @@ int cfi_intelext_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
ofs
=
instr
->
addr
;
len
=
instr
->
len
;
ret
=
cfi_intelext_varsize_frob
(
mtd
,
do_erase_oneblock
,
ofs
,
len
,
0
);
ret
=
cfi_intelext_varsize_frob
(
mtd
,
do_erase_oneblock
,
ofs
,
len
,
NULL
);
if
(
ret
)
return
ret
;
...
...
drivers/mtd/chips/jedec.c
View file @
7140ae4b
...
...
@@ -128,7 +128,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
{
printk
(
"mtd: Increase MAX_JEDEC_CHIPS, too many banks.
\n
"
);
kfree
(
MTD
);
return
0
;
return
NULL
;
}
for
(
Base
=
0
;
Base
<
map
->
size
;
Base
+=
my_bank_size
)
...
...
@@ -141,7 +141,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
if
(
jedec_probe8
(
map
,
Base
,
priv
)
==
0
)
{
printk
(
"did recognize jedec chip
\n
"
);
kfree
(
MTD
);
return
0
;
return
NULL
;
}
}
if
(
map
->
buswidth
==
2
)
...
...
@@ -167,7 +167,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
{
printk
(
"mtd: Failed. Device has incompatible mixed sector sizes
\n
"
);
kfree
(
MTD
);
return
0
;
return
NULL
;
}
}
...
...
@@ -193,7 +193,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
{
printk
(
"mtd: Internal Error, JEDEC not set
\n
"
);
kfree
(
MTD
);
return
0
;
return
NULL
;
}
if
(
Uniq
!=
0
)
...
...
@@ -221,7 +221,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
if
(
!
priv
->
size
)
{
printk
(
"priv->size is zero
\n
"
);
kfree
(
MTD
);
return
0
;
return
NULL
;
}
if
(
priv
->
size
/
my_bank_size
)
{
if
(
priv
->
size
/
my_bank_size
==
1
)
{
...
...
@@ -240,7 +240,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
{
printk
(
"mtd: Failed. Cannot handle unsymmetric banking
\n
"
);
kfree
(
MTD
);
return
0
;
return
NULL
;
}
}
}
...
...
@@ -385,7 +385,7 @@ static const struct JEDECTable *jedec_idtoinf(__u8 mfr,__u8 id)
for
(
I
=
0
;
JEDEC_table
[
I
].
jedec
!=
0
;
I
++
)
if
(
JEDEC_table
[
I
].
jedec
==
Id
)
return
JEDEC_table
+
I
;
return
0
;
return
NULL
;
}
// Look for flash using an 8 bit bus interface
...
...
drivers/mtd/chips/jedec_probe.c
View file @
7140ae4b
...
...
@@ -1480,7 +1480,7 @@ static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
for
(
i
=
0
;
i
<
num_erase_regions
;
i
++
){
p_cfi
->
cfiq
->
EraseRegionInfo
[
i
]
=
jedec_table
[
index
].
regions
[
i
];
}
p_cfi
->
cmdset_priv
=
0
;
p_cfi
->
cmdset_priv
=
NULL
;
/* This may be redundant for some cases, but it doesn't hurt */
p_cfi
->
mfr
=
jedec_table
[
index
].
mfr_id
;
...
...
drivers/mtd/cmdlinepart.c
View file @
7140ae4b
...
...
@@ -94,7 +94,7 @@ static struct mtd_partition * newpart(char *s,
if
(
size
<
PAGE_SIZE
)
{
printk
(
KERN_ERR
ERRP
"partition size too small (%lx)
\n
"
,
size
);
return
0
;
return
NULL
;
}
}
...
...
@@ -121,7 +121,7 @@ static struct mtd_partition * newpart(char *s,
if
((
p
=
strchr
(
name
,
delim
))
==
0
)
{
printk
(
KERN_ERR
ERRP
"no closing %c found in partition name
\n
"
,
delim
);
return
0
;
return
NULL
;
}
name_len
=
p
-
name
;
s
=
p
+
1
;
...
...
@@ -148,12 +148,12 @@ static struct mtd_partition * newpart(char *s,
if
(
size
==
SIZE_REMAINING
)
{
printk
(
KERN_ERR
ERRP
"no partitions allowed after a fill-up partition
\n
"
);
return
0
;
return
NULL
;
}
/* more partitions follow, parse them */
if
((
parts
=
newpart
(
s
+
1
,
&
s
,
num_parts
,
this_part
+
1
,
&
extra_mem
,
extra_mem_size
))
==
0
)
return
0
;
return
NULL
;
}
else
{
/* this is the last partition: allocate space for all */
...
...
@@ -166,7 +166,7 @@ static struct mtd_partition * newpart(char *s,
if
(
!
parts
)
{
printk
(
KERN_ERR
ERRP
"out of memory
\n
"
);
return
0
;
return
NULL
;
}
memset
(
parts
,
0
,
alloc_size
);
extra_mem
=
(
unsigned
char
*
)(
parts
+
*
num_parts
);
...
...
drivers/mtd/devices/doc2000.c
View file @
7140ae4b
...
...
@@ -599,7 +599,7 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t
*
retlen
,
u_char
*
buf
)
{
/* Just a special case of doc_read_ecc */
return
doc_read_ecc
(
mtd
,
from
,
len
,
retlen
,
buf
,
NULL
,
0
);
return
doc_read_ecc
(
mtd
,
from
,
len
,
retlen
,
buf
,
NULL
,
NULL
);
}
static
int
doc_read_ecc
(
struct
mtd_info
*
mtd
,
loff_t
from
,
size_t
len
,
...
...
@@ -748,7 +748,7 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t
*
retlen
,
const
u_char
*
buf
)
{
char
eccbuf
[
6
];
return
doc_write_ecc
(
mtd
,
to
,
len
,
retlen
,
buf
,
eccbuf
,
0
);
return
doc_write_ecc
(
mtd
,
to
,
len
,
retlen
,
buf
,
eccbuf
,
NULL
);
}
static
int
doc_write_ecc
(
struct
mtd_info
*
mtd
,
loff_t
to
,
size_t
len
,
...
...
drivers/mtd/devices/doc2001.c
View file @
7140ae4b
...
...
@@ -406,7 +406,7 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len,
size_t
*
retlen
,
u_char
*
buf
)
{
/* Just a special case of doc_read_ecc */
return
doc_read_ecc
(
mtd
,
from
,
len
,
retlen
,
buf
,
NULL
,
0
);
return
doc_read_ecc
(
mtd
,
from
,
len
,
retlen
,
buf
,
NULL
,
NULL
);
}
static
int
doc_read_ecc
(
struct
mtd_info
*
mtd
,
loff_t
from
,
size_t
len
,
...
...
@@ -533,7 +533,7 @@ static int doc_write (struct mtd_info *mtd, loff_t to, size_t len,
size_t
*
retlen
,
const
u_char
*
buf
)
{
char
eccbuf
[
6
];
return
doc_write_ecc
(
mtd
,
to
,
len
,
retlen
,
buf
,
eccbuf
,
0
);
return
doc_write_ecc
(
mtd
,
to
,
len
,
retlen
,
buf
,
eccbuf
,
NULL
);
}
static
int
doc_write_ecc
(
struct
mtd_info
*
mtd
,
loff_t
to
,
size_t
len
,
...
...
drivers/mtd/maps/amd76xrom.c
View file @
7140ae4b
...
...
@@ -32,7 +32,7 @@ static struct amd76xrom_map_info amd76xrom_map = {
.
size
=
0
,
.
buswidth
=
1
,
},
.
mtd
=
0
,
.
mtd
=
NULL
,
.
window_addr
=
0
,
};
...
...
@@ -53,7 +53,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
static
const
u32
rom_probe_sizes
[]
=
{
5
*
1024
*
1024
,
4
*
1024
*
1024
,
2
*
1024
*
1024
,
1024
*
1024
,
512
*
1024
,
256
*
1024
,
128
*
1024
,
64
*
1024
,
0
};
static
char
*
rom_probe_types
[]
=
{
"cfi_probe"
,
"jedec_probe"
,
0
};
static
char
*
rom_probe_types
[]
=
{
"cfi_probe"
,
"jedec_probe"
,
NULL
};
u8
byte
;
struct
amd76xrom_map_info
*
info
=
&
amd76xrom_map
;
struct
rom_window
*
window
;
...
...
@@ -96,7 +96,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
printk
(
KERN_ERR
"Failed to ioremap
\n
"
);
goto
err_out_free_mmio_region
;
}
info
->
mtd
=
0
;
info
->
mtd
=
NULL
;
for
(
i
=
0
;
(
rom_size
=
rom_probe_sizes
[
i
]);
i
++
)
{
char
**
chip_type
;
if
(
rom_size
>
window
->
size
)
{
...
...
@@ -145,7 +145,7 @@ static void __devexit amd76xrom_remove_one (struct pci_dev *pdev)
del_mtd_device
(
info
->
mtd
);
map_destroy
(
info
->
mtd
);
info
->
mtd
=
0
;
info
->
mtd
=
NULL
;
info
->
map
.
virt
=
0
;
iounmap
((
void
*
)(
info
->
window_addr
));
...
...
@@ -184,9 +184,9 @@ int __init init_amd76xrom(void)
{
struct
pci_dev
*
pdev
;
struct
pci_device_id
*
id
;
pdev
=
0
;
pdev
=
NULL
;
for
(
id
=
amd76xrom_pci_tbl
;
id
->
vendor
;
id
++
)
{
pdev
=
pci_find_device
(
id
->
vendor
,
id
->
device
,
0
);
pdev
=
pci_find_device
(
id
->
vendor
,
id
->
device
,
NULL
);
if
(
pdev
)
{
break
;
}
...
...
drivers/mtd/maps/ich2rom.c
View file @
7140ae4b
...
...
@@ -109,7 +109,7 @@ static struct ich2rom_map_info ich2rom_map = {
* needs to use a different method.
*/
},
.
mtd
=
0
,
.
mtd
=
NULL
,
.
window_addr
=
0
,
};
...
...
@@ -205,7 +205,7 @@ static int __devinit ich2rom_init_one (struct pci_dev *pdev,
/* FIXME select the firmware hub and enable a window to it. */
info
->
mtd
=
0
;
info
->
mtd
=
NULL
;
info
->
map
.
map_priv_1
=
info
->
window_addr
;
map_size
=
ICH2_FWH_REGION_SIZE
;
...
...
@@ -245,7 +245,7 @@ static void __devexit ich2rom_remove_one (struct pci_dev *pdev)
del_mtd_device
(
info
->
mtd
);
map_destroy
(
info
->
mtd
);
info
->
mtd
=
0
;
info
->
mtd
=
NULL
;
info
->
map
.
map_priv_1
=
0
;
iounmap
((
void
*
)(
info
->
window_addr
));
...
...
@@ -286,9 +286,9 @@ int __init init_ich2rom(void)
{
struct
pci_dev
*
pdev
;
struct
pci_device_id
*
id
;
pdev
=
0
;
pdev
=
NULL
;
for
(
id
=
ich2rom_pci_tbl
;
id
->
vendor
;
id
++
)
{
pdev
=
pci_find_device
(
id
->
vendor
,
id
->
device
,
0
);
pdev
=
pci_find_device
(
id
->
vendor
,
id
->
device
,
NULL
);
if
(
pdev
)
{
break
;
}
...
...
drivers/mtd/maps/physmap.c
View file @
7140ae4b
...
...
@@ -66,7 +66,7 @@ const char *part_probes[] = {"cmdlinepart", "RedBoot", NULL};
int
__init
init_physmap
(
void
)
{
static
const
char
*
rom_probe_types
[]
=
{
"cfi_probe"
,
"jedec_probe"
,
"map_rom"
,
0
};
static
const
char
*
rom_probe_types
[]
=
{
"cfi_probe"
,
"jedec_probe"
,
"map_rom"
,
NULL
};
const
char
**
type
;
printk
(
KERN_NOTICE
"physmap flash device: %x at %x
\n
"
,
WINDOW_SIZE
,
WINDOW_ADDR
);
...
...
@@ -79,7 +79,7 @@ int __init init_physmap(void)
simple_map_init
(
&
physmap_map
);
mymtd
=
0
;
mymtd
=
NULL
;
type
=
rom_probe_types
;
for
(;
!
mymtd
&&
*
type
;
type
++
)
{
mymtd
=
do_map_probe
(
*
type
,
&
physmap_map
);
...
...
drivers/mtd/mtdcore.c
View file @
7140ae4b
...
...
@@ -409,7 +409,7 @@ int __init init_mtd(void)
{
#ifdef CONFIG_PROC_FS
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
if
((
proc_mtd
=
create_proc_entry
(
"mtd"
,
0
,
0
)))
if
((
proc_mtd
=
create_proc_entry
(
"mtd"
,
0
,
NULL
)))
proc_mtd
->
read_proc
=
mtd_read_proc
;
#else
proc_register_dynamic
(
&
proc_root
,
&
mtd_proc_entry
);
...
...
@@ -438,7 +438,7 @@ static void __exit cleanup_mtd(void)
#ifdef CONFIG_PROC_FS
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
if
(
proc_mtd
)
remove_proc_entry
(
"mtd"
,
0
);
remove_proc_entry
(
"mtd"
,
NULL
);
#else
proc_unregister
(
&
proc_root
,
mtd_proc_entry
.
low_ino
);
#endif
...
...
drivers/mtd/nand/nand.c
View file @
7140ae4b
...
...
@@ -966,7 +966,7 @@ static int nand_write_oob (struct mtd_info *mtd, loff_t to, size_t len, size_t *
static
int
nand_writev
(
struct
mtd_info
*
mtd
,
const
struct
kvec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
return
(
nand_writev_ecc
(
mtd
,
vecs
,
count
,
to
,
retlen
,
NULL
,
0
));
return
(
nand_writev_ecc
(
mtd
,
vecs
,
count
,
to
,
retlen
,
NULL
,
NULL
));
}
static
int
nand_writev_ecc
(
struct
mtd_info
*
mtd
,
const
struct
kvec
*
vecs
,
unsigned
long
count
,
...
...
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