summaryrefslogtreecommitdiffstats
path: root/src/include/device/resource.h
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-06-14 11:29:51 +0300
committerPatrick Georgi <pgeorgi@google.com>2021-07-01 09:46:09 +0000
commitb2287718ef2ab8051d917702185f91c33cb61aa3 (patch)
tree227ec2fe5d6191509ffe287a121a8f73786773a3 /src/include/device/resource.h
parent3ab408c698df4246acd26a74f0e3db638d80a431 (diff)
downloadcoreboot-b2287718ef2ab8051d917702185f91c33cb61aa3.tar.gz
coreboot-b2287718ef2ab8051d917702185f91c33cb61aa3.tar.bz2
coreboot-b2287718ef2ab8051d917702185f91c33cb61aa3.zip
device: Clean up resource utility function signatures
Drop extern declarations from functions. Declare resource arguments as const. Change-Id: I7684cc7813bad805c39a762892636818279ac134 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55475 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/device/resource.h')
-rw-r--r--src/include/device/resource.h40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/include/device/resource.h b/src/include/device/resource.h
index 3a7ccf09e66f..098d0b653a6e 100644
--- a/src/include/device/resource.h
+++ b/src/include/device/resource.h
@@ -63,31 +63,27 @@ struct resource {
/* Generic resource helper functions */
struct device;
struct bus;
-extern void compact_resources(struct device *dev);
-extern struct resource *probe_resource(const struct device *dev,
- unsigned int index);
-extern struct resource *new_resource(struct device *dev, unsigned int index);
-extern struct resource *find_resource(const struct device *dev,
- unsigned int index);
-extern resource_t resource_end(struct resource *resource);
-extern resource_t resource_max(struct resource *resource);
-extern void report_resource_stored(struct device *dev,
- struct resource *resource, const char *comment);
-
-typedef void (*resource_search_t)(void *gp, struct device *dev,
- struct resource *res);
-extern void search_bus_resources(struct bus *bus,
- unsigned long type_mask, unsigned long type,
- resource_search_t search, void *gp);
-
-extern void search_global_resources(
- unsigned long type_mask, unsigned long type,
- resource_search_t search, void *gp);
+void compact_resources(struct device *dev);
+struct resource *probe_resource(const struct device *dev, unsigned int index);
+struct resource *new_resource(struct device *dev, unsigned int index);
+struct resource *find_resource(const struct device *dev, unsigned int index);
+resource_t resource_end(const struct resource *resource);
+resource_t resource_max(const struct resource *resource);
+void report_resource_stored(struct device *dev, const struct resource *resource,
+ const char *comment);
+
+typedef void (*resource_search_t)(void *gp, struct device *dev, struct resource *res);
+
+void search_bus_resources(struct bus *bus, unsigned long type_mask, unsigned long type,
+ resource_search_t search, void *gp);
+
+void search_global_resources(unsigned long type_mask, unsigned long type,
+ resource_search_t search, void *gp);
#define RESOURCE_TYPE_MAX 20
-extern const char *resource_type(struct resource *resource);
+const char *resource_type(const struct resource *resource);
-static inline void *res2mmio(struct resource *res, unsigned long offset,
+static inline void *res2mmio(const struct resource *res, unsigned long offset,
unsigned long mask)
{
return (void *)(uintptr_t)((res->base + offset) & ~mask);