[RFC 1/4] digest: Make filename arguments const

Jan Luebbe jlu at pengutronix.de
Thu Mar 12 07:39:56 PDT 2015


From: Sascha Hauer <s.hauer at pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/digest.c  | 8 ++++----
 include/digest.h | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/digest.c b/common/digest.c
index 51be2ca4148b..7187b0f23d81 100644
--- a/common/digest.c
+++ b/common/digest.c
@@ -59,7 +59,7 @@ void digest_unregister(struct digest *d)
 }
 EXPORT_SYMBOL(digest_unregister);
 
-struct digest* digest_get_by_name(char* name)
+struct digest* digest_get_by_name(const char *name)
 {
 	struct digest* d;
 
@@ -87,7 +87,7 @@ struct digest *digest_get(enum hash_algo algo)
 }
 EXPORT_SYMBOL_GPL(digest_get);
 
-int digest_file_window(struct digest *d, char *filename,
+int digest_file_window(struct digest *d, const char *filename,
 		       unsigned char *hash,
 		       ulong start, ulong size)
 {
@@ -157,7 +157,7 @@ out:
 }
 EXPORT_SYMBOL_GPL(digest_file_window);
 
-int digest_file(struct digest *d, char *filename,
+int digest_file(struct digest *d, const char *filename,
 		       unsigned char *hash)
 {
 	struct stat st;
@@ -172,7 +172,7 @@ int digest_file(struct digest *d, char *filename,
 }
 EXPORT_SYMBOL_GPL(digest_file);
 
-int digest_file_by_name(char *algo, char *filename,
+int digest_file_by_name(char *algo, const char *filename,
 		       unsigned char *hash)
 {
 	struct digest *d;
diff --git a/include/digest.h b/include/digest.h
index 62f6248d0768..4727c72efc55 100644
--- a/include/digest.h
+++ b/include/digest.h
@@ -63,15 +63,15 @@ struct digest
 int digest_register(struct digest *d);
 void digest_unregister(struct digest *d);
 
-struct digest* digest_get_by_name(char* name);
+struct digest* digest_get_by_name(const char *name);
 struct digest *digest_get(enum hash_algo);
 
-int digest_file_window(struct digest *d, char *filename,
+int digest_file_window(struct digest *d, const char *filename,
 		       unsigned char *hash,
 		       ulong start, ulong size);
-int digest_file(struct digest *d, char *filename,
+int digest_file(struct digest *d, const char *filename,
 		       unsigned char *hash);
-int digest_file_by_name(char *algo, char *filename,
+int digest_file_by_name(char *algo, const char *filename,
 		       unsigned char *hash);
 
 #endif /* __SH_ST_DEVICES_H__ */
-- 
2.1.4




More information about the barebox mailing list