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
cd4f8d79
Commit
cd4f8d79
authored
Feb 26, 2004
by
Ben Collins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IEEE1394(r1166): Move generic packet initialization to kmem_cache ctor.
parent
09d714d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
drivers/ieee1394/ieee1394_core.c
drivers/ieee1394/ieee1394_core.c
+17
-11
No files found.
drivers/ieee1394/ieee1394_core.c
View file @
cd4f8d79
...
@@ -127,9 +127,6 @@ struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
...
@@ -127,9 +127,6 @@ struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
if
(
packet
==
NULL
)
if
(
packet
==
NULL
)
return
NULL
;
return
NULL
;
memset
(
packet
,
0
,
sizeof
(
struct
hpsb_packet
));
packet
->
header
=
packet
->
embedded_header
;
if
(
data_size
)
{
if
(
data_size
)
{
data
=
kmalloc
(
data_size
+
8
,
GFP_ATOMIC
);
data
=
kmalloc
(
data_size
+
8
,
GFP_ATOMIC
);
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
...
@@ -141,11 +138,6 @@ struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
...
@@ -141,11 +138,6 @@ struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
packet
->
data_size
=
data_size
;
packet
->
data_size
=
data_size
;
}
}
INIT_LIST_HEAD
(
&
packet
->
list
);
packet
->
state
=
hpsb_unused
;
packet
->
generation
=
-
1
;
atomic_set
(
&
packet
->
refcnt
,
1
);
return
packet
;
return
packet
;
}
}
...
@@ -154,8 +146,7 @@ struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
...
@@ -154,8 +146,7 @@ struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
* hpsb_free_packet - free packet and data associated with it
* hpsb_free_packet - free packet and data associated with it
* @packet: packet to free (is NULL safe)
* @packet: packet to free (is NULL safe)
*
*
* This function will free packet->data, packet->header and finally the packet
* This function will free packet->data and finally the packet itself.
* itself.
*/
*/
void
hpsb_free_packet
(
struct
hpsb_packet
*
packet
)
void
hpsb_free_packet
(
struct
hpsb_packet
*
packet
)
{
{
...
@@ -1039,6 +1030,21 @@ static int hpsbpkt_thread(void *__hi)
...
@@ -1039,6 +1030,21 @@ static int hpsbpkt_thread(void *__hi)
complete_and_exit
(
&
khpsbpkt_complete
,
0
);
complete_and_exit
(
&
khpsbpkt_complete
,
0
);
}
}
static
void
hpsb_packet_ctor
(
void
*
__packet
,
kmem_cache_t
*
hpsb_pkt_cache
,
unsigned
long
flags
)
{
struct
hpsb_packet
*
packet
=
__packet
;
memset
(
packet
,
0
,
sizeof
(
*
packet
));
packet
->
header
=
packet
->
embedded_header
;
INIT_LIST_HEAD
(
&
packet
->
list
);
packet
->
state
=
hpsb_unused
;
packet
->
generation
=
-
1
;
atomic_set
(
&
packet
->
refcnt
,
1
);
}
static
int
__init
ieee1394_init
(
void
)
static
int
__init
ieee1394_init
(
void
)
{
{
int
i
;
int
i
;
...
@@ -1059,7 +1065,7 @@ static int __init ieee1394_init(void)
...
@@ -1059,7 +1065,7 @@ static int __init ieee1394_init(void)
devfs_mk_dir
(
"ieee1394"
);
devfs_mk_dir
(
"ieee1394"
);
hpsb_packet_cache
=
kmem_cache_create
(
"hpsb_packet"
,
sizeof
(
struct
hpsb_packet
),
hpsb_packet_cache
=
kmem_cache_create
(
"hpsb_packet"
,
sizeof
(
struct
hpsb_packet
),
0
,
0
,
NULL
,
NULL
);
0
,
0
,
hpsb_packet_ctor
,
NULL
);
bus_register
(
&
ieee1394_bus_type
);
bus_register
(
&
ieee1394_bus_type
);
for
(
i
=
0
;
fw_bus_attrs
[
i
];
i
++
)
for
(
i
=
0
;
fw_bus_attrs
[
i
];
i
++
)
...
...
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