Skip to content

Commit e70e9ec

Browse files
krzkjoergroedel
authored andcommitted
iommu: constify pointer to bus_type
Make pointer to bus_type a pointer to const for code safety. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 3dfa64a commit e70e9ec

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

drivers/iommu/iommu-priv.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ int iommu_group_replace_domain(struct iommu_group *group,
2121
struct iommu_domain *new_domain);
2222

2323
int iommu_device_register_bus(struct iommu_device *iommu,
24-
const struct iommu_ops *ops, struct bus_type *bus,
24+
const struct iommu_ops *ops,
25+
const struct bus_type *bus,
2526
struct notifier_block *nb);
2627
void iommu_device_unregister_bus(struct iommu_device *iommu,
27-
struct bus_type *bus,
28+
const struct bus_type *bus,
2829
struct notifier_block *nb);
2930

3031
#endif /* __LINUX_IOMMU_PRIV_H */

drivers/iommu/iommu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ EXPORT_SYMBOL_GPL(iommu_device_unregister);
289289

290290
#if IS_ENABLED(CONFIG_IOMMUFD_TEST)
291291
void iommu_device_unregister_bus(struct iommu_device *iommu,
292-
struct bus_type *bus,
292+
const struct bus_type *bus,
293293
struct notifier_block *nb)
294294
{
295295
bus_unregister_notifier(bus, nb);
@@ -303,7 +303,8 @@ EXPORT_SYMBOL_GPL(iommu_device_unregister_bus);
303303
* some memory to hold a notifier_block.
304304
*/
305305
int iommu_device_register_bus(struct iommu_device *iommu,
306-
const struct iommu_ops *ops, struct bus_type *bus,
306+
const struct iommu_ops *ops,
307+
const struct bus_type *bus,
307308
struct notifier_block *nb)
308309
{
309310
int err;

0 commit comments

Comments
 (0)