Skip to content

Commit 0d5ffd9

Browse files
author
Christoph Hellwig
committed
swiotlb: rename swiotlb_late_init_with_default_size
swiotlb_late_init_with_default_size is an overly verbose name that doesn't even catch what the function is doing, given that the size is not just a default but the actual requested size. Rename it to swiotlb_init_late. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]> Tested-by: Boris Ostrovsky <[email protected]>
1 parent a2daa27 commit 0d5ffd9

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

arch/x86/pci/sta2x11-fixup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static void sta2x11_new_instance(struct pci_dev *pdev)
5757
int size = STA2X11_SWIOTLB_SIZE;
5858
/* First instance: register your own swiotlb area */
5959
dev_info(&pdev->dev, "Using SWIOTLB (size %i)\n", size);
60-
if (swiotlb_late_init_with_default_size(size))
60+
if (swiotlb_init_late(size))
6161
dev_emerg(&pdev->dev, "init swiotlb failed\n");
6262
}
6363
list_add(&instance->list, &sta2x11_instance_list);

include/linux/swiotlb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern void swiotlb_init(int verbose);
4040
int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
4141
unsigned long swiotlb_size_or_default(void);
4242
extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs);
43-
extern int swiotlb_late_init_with_default_size(size_t default_size);
43+
int swiotlb_init_late(size_t size);
4444
extern void __init swiotlb_update_mem_attributes(void);
4545

4646
phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t phys,

kernel/dma/swiotlb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,9 @@ swiotlb_init(int verbose)
281281
* initialize the swiotlb later using the slab allocator if needed.
282282
* This should be just like above, but with some error catching.
283283
*/
284-
int
285-
swiotlb_late_init_with_default_size(size_t default_size)
284+
int swiotlb_init_late(size_t size)
286285
{
287-
unsigned long nslabs =
288-
ALIGN(default_size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE);
286+
unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE);
289287
unsigned long bytes;
290288
unsigned char *vstart = NULL;
291289
unsigned int order;

0 commit comments

Comments
 (0)