Skip to content

Commit 688baac

Browse files
committed
cxl/regs: Clarify when a 'struct cxl_register_map' is input vs output
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>
1 parent 9561de3 commit 688baac

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/cxl/core/regs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ void __iomem *devm_cxl_iomap_block(struct device *dev, resource_size_t addr,
200200
}
201201

202202
int cxl_map_component_regs(struct device *dev, struct cxl_component_regs *regs,
203-
struct cxl_register_map *map, unsigned long map_mask)
203+
const struct cxl_register_map *map, unsigned long map_mask)
204204
{
205205
struct mapinfo {
206-
struct cxl_reg_map *rmap;
206+
const struct cxl_reg_map *rmap;
207207
void __iomem **addr;
208208
} mapinfo[] = {
209209
{ &map->component_map.hdm_decoder, &regs->hdm_decoder },
@@ -233,11 +233,11 @@ EXPORT_SYMBOL_NS_GPL(cxl_map_component_regs, CXL);
233233

234234
int cxl_map_device_regs(struct device *dev,
235235
struct cxl_device_regs *regs,
236-
struct cxl_register_map *map)
236+
const struct cxl_register_map *map)
237237
{
238238
resource_size_t phys_addr = map->resource;
239239
struct mapinfo {
240-
struct cxl_reg_map *rmap;
240+
const struct cxl_reg_map *rmap;
241241
void __iomem **addr;
242242
} mapinfo[] = {
243243
{ &map->device_map.status, &regs->status, },

drivers/cxl/cxl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ void cxl_probe_component_regs(struct device *dev, void __iomem *base,
254254
void cxl_probe_device_regs(struct device *dev, void __iomem *base,
255255
struct cxl_device_reg_map *map);
256256
int cxl_map_component_regs(struct device *dev, struct cxl_component_regs *regs,
257-
struct cxl_register_map *map,
257+
const struct cxl_register_map *map,
258258
unsigned long map_mask);
259259
int cxl_map_device_regs(struct device *dev, struct cxl_device_regs *regs,
260-
struct cxl_register_map *map);
260+
const struct cxl_register_map *map);
261261

262262
enum cxl_regloc_type;
263263
int cxl_find_regblock(struct pci_dev *pdev, enum cxl_regloc_type type,

0 commit comments

Comments
 (0)