Commit e5aca378 authored by Alessandro Rubini's avatar Alessandro Rubini

kernel code: constify where possible (suggested by Emilio)

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 209af450
......@@ -21,7 +21,8 @@ module_param_named(dump_sdb, fmc_must_dump_sdb, int, 0644);
#define LINELEN 16
/* Dumping 8k takes oh so much: avoid duplicate lines */
static uint8_t *dump_line(int addr, uint8_t *line, uint8_t *prev)
static const uint8_t *dump_line(int addr, const uint8_t *line,
const uint8_t *prev)
{
int i;
......@@ -40,9 +41,9 @@ static uint8_t *dump_line(int addr, uint8_t *line, uint8_t *prev)
return prev;
}
void fmc_dump_eeprom(struct fmc_device *fmc)
void fmc_dump_eeprom(const struct fmc_device *fmc)
{
uint8_t *line, *prev;
const uint8_t *line, *prev;
int i;
if (!fmc_must_dump_eeprom)
......@@ -59,9 +60,9 @@ void fmc_dump_eeprom(struct fmc_device *fmc)
prev = dump_line(i, line, prev);
}
void fmc_dump_sdb(struct fmc_device *fmc)
void fmc_dump_sdb(const struct fmc_device *fmc)
{
uint8_t *line, *prev;
const uint8_t *line, *prev;
int i, len;
if (!fmc->sdb)
......
......@@ -149,10 +149,11 @@ int fmc_reprogram(struct fmc_device *fmc, struct fmc_driver *d, char *gw,
}
EXPORT_SYMBOL(fmc_reprogram);
static void __fmc_show_sdb_tree(struct fmc_device *fmc, struct sdb_array *arr)
static void __fmc_show_sdb_tree(const struct fmc_device *fmc,
const struct sdb_array *arr)
{
int i, j, n = arr->len, level = arr->level;
struct sdb_array *ap;
const struct sdb_array *ap;
for (i = 0; i < n; i++) {
unsigned long base;
......@@ -210,7 +211,7 @@ static void __fmc_show_sdb_tree(struct fmc_device *fmc, struct sdb_array *arr)
}
}
void fmc_show_sdb_tree(struct fmc_device *fmc)
void fmc_show_sdb_tree(const struct fmc_device *fmc)
{
if (!fmc->sdb)
return;
......
......@@ -30,7 +30,7 @@ struct sdb_array {
};
extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
extern void fmc_show_sdb_tree(struct fmc_device *fmc);
extern void fmc_show_sdb_tree(const struct fmc_device *fmc);
extern signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
uint32_t device, unsigned long *sz);
extern int fmc_free_sdb_tree(struct fmc_device *fmc);
......@@ -207,7 +207,7 @@ static inline void fmc_writel(struct fmc_device *fmc, uint32_t val, int off)
}
/* pci-like naming */
static inline void *fmc_get_drvdata(struct fmc_device *fmc)
static inline void *fmc_get_drvdata(const struct fmc_device *fmc)
{
return dev_get_drvdata(&fmc->dev);
}
......@@ -231,7 +231,7 @@ extern void fmc_device_unregister_n(struct fmc_device *fmc, int n);
extern int fmc_match(struct device *dev, struct device_driver *drv);
extern int fmc_fill_id_info(struct fmc_device *fmc);
extern void fmc_free_id_info(struct fmc_device *fmc);
extern void fmc_dump_eeprom(struct fmc_device *fmc);
extern void fmc_dump_sdb(struct fmc_device *fmc);
extern void fmc_dump_eeprom(const struct fmc_device *fmc);
extern void fmc_dump_sdb(const struct fmc_device *fmc);
#endif /* __LINUX_FMC_H__ */
......@@ -77,7 +77,7 @@ enum fru_type {
* some helpers
*/
static inline struct fru_board_info_area *fru_get_board_area(
struct fru_common_header *header)
const struct fru_common_header *header)
{
/* we know for sure that the header is 8 bytes in size */
return (struct fru_board_info_area *)(header + header->board_area_off);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment