]> git.itanic.dy.fi Git - linux-stable/commitdiff
cxl/regs: Clarify when a 'struct cxl_register_map' is input vs output
authorDan Williams <dan.j.williams@intel.com>
Thu, 15 Jun 2023 01:29:41 +0000 (18:29 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 25 Jun 2023 21:31:08 +0000 (14:31 -0700)
The @map parameter to cxl_probe_X_registers() is filled in with the
mapping parameters of the register block. The @map parameter to
cxl_map_X_registers() only reads that information to perform the
mapping. Mark @map const for cxl_map_X_registers() to clarify that it is
only an input to those helpers.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/168679258103.3436160.4941603739448763855.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/regs.c
drivers/cxl/cxl.h

index 1476a0299c9b688e739ddb622072ef6dcb256f9d..52d1dbeda527c51cc485fcaffc1afebef8d719fe 100644 (file)
@@ -200,10 +200,10 @@ void __iomem *devm_cxl_iomap_block(struct device *dev, resource_size_t addr,
 }
 
 int cxl_map_component_regs(struct device *dev, struct cxl_component_regs *regs,
-                          struct cxl_register_map *map, unsigned long map_mask)
+                          const struct cxl_register_map *map, unsigned long map_mask)
 {
        struct mapinfo {
-               struct cxl_reg_map *rmap;
+               const struct cxl_reg_map *rmap;
                void __iomem **addr;
        } mapinfo[] = {
                { &map->component_map.hdm_decoder, &regs->hdm_decoder },
@@ -233,11 +233,11 @@ EXPORT_SYMBOL_NS_GPL(cxl_map_component_regs, CXL);
 
 int cxl_map_device_regs(struct device *dev,
                        struct cxl_device_regs *regs,
-                       struct cxl_register_map *map)
+                       const struct cxl_register_map *map)
 {
        resource_size_t phys_addr = map->resource;
        struct mapinfo {
-               struct cxl_reg_map *rmap;
+               const struct cxl_reg_map *rmap;
                void __iomem **addr;
        } mapinfo[] = {
                { &map->device_map.status, &regs->status, },
index f93a285389621cc77e86ae792c095b1671f30c85..dfc94e76c7d6dcc470ea733da9066785bc1500e2 100644 (file)
@@ -254,10 +254,10 @@ void cxl_probe_component_regs(struct device *dev, void __iomem *base,
 void cxl_probe_device_regs(struct device *dev, void __iomem *base,
                           struct cxl_device_reg_map *map);
 int cxl_map_component_regs(struct device *dev, struct cxl_component_regs *regs,
-                          struct cxl_register_map *map,
+                          const struct cxl_register_map *map,
                           unsigned long map_mask);
 int cxl_map_device_regs(struct device *dev, struct cxl_device_regs *regs,
-                       struct cxl_register_map *map);
+                       const struct cxl_register_map *map);
 
 enum cxl_regloc_type;
 int cxl_find_regblock(struct pci_dev *pdev, enum cxl_regloc_type type,