Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
91b8e305
Commit
91b8e305
authored
Jul 29, 2009
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intel-agp: Move repeated sglist free into separate function
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
c2980d8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
drivers/char/agp/intel-agp.c
drivers/char/agp/intel-agp.c
+15
-14
No files found.
drivers/char/agp/intel-agp.c
View file @
91b8e305
...
...
@@ -196,6 +196,18 @@ static void intel_agp_unmap_page(struct page *page, dma_addr_t dma)
PAGE_SIZE
,
PCI_DMA_BIDIRECTIONAL
);
}
static
void
intel_agp_free_sglist
(
struct
agp_memory
*
mem
)
{
if
(
mem
->
sg_vmalloc_flag
)
vfree
(
mem
->
sg_list
);
else
kfree
(
mem
->
sg_list
);
mem
->
sg_vmalloc_flag
=
0
;
mem
->
sg_list
=
NULL
;
mem
->
num_sg
=
0
;
}
static
int
intel_agp_map_memory
(
struct
agp_memory
*
mem
)
{
struct
scatterlist
*
sg
;
...
...
@@ -224,13 +236,8 @@ static int intel_agp_map_memory(struct agp_memory *mem)
mem
->
num_sg
=
pci_map_sg
(
intel_private
.
pcidev
,
mem
->
sg_list
,
mem
->
page_count
,
PCI_DMA_BIDIRECTIONAL
);
if
(
!
mem
->
num_sg
)
{
if
(
mem
->
sg_vmalloc_flag
)
vfree
(
mem
->
sg_list
);
else
kfree
(
mem
->
sg_list
);
mem
->
sg_list
=
NULL
;
mem
->
sg_vmalloc_flag
=
0
;
if
(
unlikely
(
!
mem
->
num_sg
))
{
intel_agp_free_sglist
(
mem
);
return
-
ENOMEM
;
}
return
0
;
...
...
@@ -242,13 +249,7 @@ static void intel_agp_unmap_memory(struct agp_memory *mem)
pci_unmap_sg
(
intel_private
.
pcidev
,
mem
->
sg_list
,
mem
->
page_count
,
PCI_DMA_BIDIRECTIONAL
);
if
(
mem
->
sg_vmalloc_flag
)
vfree
(
mem
->
sg_list
);
else
kfree
(
mem
->
sg_list
);
mem
->
sg_vmalloc_flag
=
0
;
mem
->
sg_list
=
NULL
;
mem
->
num_sg
=
0
;
intel_agp_free_sglist
(
mem
);
}
static
void
intel_agp_insert_sg_entries
(
struct
agp_memory
*
mem
,
...
...
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