From 3e8957ea8579e899ad6246b753809dc970cf5300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 9 Oct 2013 09:11:14 +0000 Subject: [PATCH] Add missing include guards and move the existing ones out of the implementation namespace. --- sys/dev/random/hash.h | 5 +++++ sys/dev/random/live_entropy_sources.h | 6 +++--- sys/dev/random/random_adaptors.h | 6 +++--- sys/dev/random/random_harvestq.h | 6 +++--- sys/dev/random/randomdev.h | 5 +++++ sys/dev/random/randomdev_soft.h | 5 +++++ sys/dev/random/rwfile.h | 5 +++++ sys/dev/random/yarrow.h | 5 +++++ 8 files changed, 34 insertions(+), 9 deletions(-) diff --git a/sys/dev/random/hash.h b/sys/dev/random/hash.h index 62f116daa00d..4e6a4a0db831 100644 --- a/sys/dev/random/hash.h +++ b/sys/dev/random/hash.h @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED +#define SYS_DEV_RANDOM_HASH_H_INCLUDED + #define KEYSIZE 32 /* (in bytes) == 256 bits */ #define BLOCKSIZE 16 /* (in bytes) == 128 bits */ @@ -43,3 +46,5 @@ void randomdev_hash_iterate(struct randomdev_hash *, void *, size_t); void randomdev_hash_finish(struct randomdev_hash *, void *); void randomdev_encrypt_init(struct randomdev_key *, void *); void randomdev_encrypt(struct randomdev_key *context, void *, void *, unsigned); + +#endif diff --git a/sys/dev/random/live_entropy_sources.h b/sys/dev/random/live_entropy_sources.h index febb24ae22f2..9a23070fa637 100644 --- a/sys/dev/random/live_entropy_sources.h +++ b/sys/dev/random/live_entropy_sources.h @@ -27,8 +27,8 @@ * $FreeBSD$ */ -#ifndef __LIVE_ENTROPY_SOURCES__ -#define __LIVE_ENTROPY_SOURCES__ +#ifndef SYS_DEV_RANDOM_LIVE_ENTROPY_SOURCES_H_INCLUDED +#define SYS_DEV_RANDOM_LIVE_ENTROPY_SOURCES_H_INCLUDED /* * Live entropy source is a source of entropy that can provide @@ -57,4 +57,4 @@ void live_entropy_sources_feed(int, event_proc_f); MODULE_VERSION(name, ver); \ MODULE_DEPEND(name, random, 1, 1, 1); -#endif /* __LIVE_ENTROPY_SOURCES__ */ +#endif /* SYS_DEV_RANDOM_LIVE_ENTROPY_SOURCES_H_INCLUDED */ diff --git a/sys/dev/random/random_adaptors.h b/sys/dev/random/random_adaptors.h index fb3d6e425c9a..4765694a4526 100644 --- a/sys/dev/random/random_adaptors.h +++ b/sys/dev/random/random_adaptors.h @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef __RANDOM_ADAPTORS_H__ -#define __RANDOM_ADAPTORS_H__ +#ifndef SYS_DEV_RANDOM_RANDOM_ADAPTORS_H_INCLUDED +#define SYS_DEV_RANDOM_RANDOM_ADAPTORS_H_INCLUDED #include @@ -68,4 +68,4 @@ EVENTHANDLER_DECLARE(random_adaptor_attach, random_adaptor_attach_hook); SYSCTL_DECL(_kern_random); #endif /* SYSCTL_DECL */ -#endif /* __RANDOM_ADAPTORS_H__ */ +#endif /* SYS_DEV_RANDOM_RANDOM_ADAPTORS_H_INCLUDED */ diff --git a/sys/dev/random/random_harvestq.h b/sys/dev/random/random_harvestq.h index f4e9bb188a9c..a2ac3d1f91bc 100644 --- a/sys/dev/random/random_harvestq.h +++ b/sys/dev/random/random_harvestq.h @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef __RANDOM_HARVEST_H__ -#define __RANDOM_HARVEST_H__ +#ifndef SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED +#define SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED typedef void (*event_proc_f)(struct harvest *event); @@ -39,4 +39,4 @@ void random_harvestq_internal(u_int64_t, const void *, extern int random_kthread_control; extern struct mtx harvest_mtx; -#endif /* __RANDOM_HARVEST_H__ */ +#endif /* SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED */ diff --git a/sys/dev/random/randomdev.h b/sys/dev/random/randomdev.h index a0e002f89ae7..5be595fb7141 100644 --- a/sys/dev/random/randomdev.h +++ b/sys/dev/random/randomdev.h @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef SYS_DEV_RANDOM_RANDOMDEV_H_INCLUDED +#define SYS_DEV_RANDOM_RANDOMDEV_H_INCLUDED + /* This header contains only those definitions that are global * and non algorithm-specific for the entropy processor */ @@ -54,3 +57,5 @@ struct random_hardware_source { enum esource source; random_read_func_t *read; }; + +#endif diff --git a/sys/dev/random/randomdev_soft.h b/sys/dev/random/randomdev_soft.h index 7a2b62e8e766..cbee779a7d05 100644 --- a/sys/dev/random/randomdev_soft.h +++ b/sys/dev/random/randomdev_soft.h @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef SYS_DEV_RANDOM_RANDOMDEV_SOFT_H_INCLUDED +#define SYS_DEV_RANDOM_RANDOMDEV_SOFT_H_INCLUDED + /* This header contains only those definitions that are global * and harvester-specific for the entropy processor */ @@ -79,3 +82,5 @@ random_check_uint_##name(SYSCTL_HANDLER_ARGS) \ return (sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, \ req)); \ } + +#endif diff --git a/sys/dev/random/rwfile.h b/sys/dev/random/rwfile.h index 39aba04151d6..22ac06d05908 100644 --- a/sys/dev/random/rwfile.h +++ b/sys/dev/random/rwfile.h @@ -26,5 +26,10 @@ * $FreeBSD$ */ +#ifndef SYS_DEV_RANDOM_RWFILE_H_INCLUDED +#define SYS_DEV_RANDOM_RWFILE_H_INCLUDED + int randomdev_read_file(const char *filename, void *buf, size_t); int randomdev_write_file(const char *filename, void *buf, size_t); + +#endif diff --git a/sys/dev/random/yarrow.h b/sys/dev/random/yarrow.h index 0bde5b582d32..f32313ee5773 100644 --- a/sys/dev/random/yarrow.h +++ b/sys/dev/random/yarrow.h @@ -26,7 +26,12 @@ * $FreeBSD$ */ +#ifndef SYS_DEV_RANDOM_YARROW_H_INCLUDED +#define SYS_DEV_RANDOM_YARROW_H_INCLUDED + void random_yarrow_init_alg(struct sysctl_ctx_list *); void random_yarrow_deinit_alg(void); int random_yarrow_read(void *, int); void random_yarrow_reseed(void); + +#endif