Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iommu: simplify list initialization in iommu_create_device_direct_mappings()

Use LIST_HEAD() to declare and initialize the 'mappings' list head in
iommu_create_device_direct_mappings() instead of separate declaration and
INIT_LIST_HEAD(). This simplifies the code by combining declaration and
initialization into a single idiomatic form, improving readability without
changing functionality.

Signed-off-by: Can Peng <pengcan@kylinos.cn>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

authored by

Can Peng and committed by
Joerg Roedel
16e3423f a8258ffe

+1 -2
+1 -2
drivers/iommu/iommu.c
··· 1180 1180 struct device *dev) 1181 1181 { 1182 1182 struct iommu_resv_region *entry; 1183 - struct list_head mappings; 1183 + LIST_HEAD(mappings); 1184 1184 unsigned long pg_size; 1185 1185 int ret = 0; 1186 1186 1187 1187 pg_size = domain->pgsize_bitmap ? 1UL << __ffs(domain->pgsize_bitmap) : 0; 1188 - INIT_LIST_HEAD(&mappings); 1189 1188 1190 1189 if (WARN_ON_ONCE(iommu_is_dma_domain(domain) && !pg_size)) 1191 1190 return -EINVAL;