Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732708 > unrolled thread

[PATCH 1/3] vfs: constify path argument to kernel_read_file_from_path

Started byMimi Zohar <zohar@linux.vnet.ibm.com>
First post2017-09-15 07:00 +0200
Last post2017-09-15 20:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] vfs: constify path argument to kernel_read_file_from_path Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-15 07:00 +0200
    Re: [PATCH 1/3] vfs: constify path argument to kernel_read_file_from_path Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-15 20:40 +0200

#1732708 — [PATCH 1/3] vfs: constify path argument to kernel_read_file_from_path

FromMimi Zohar <zohar@linux.vnet.ibm.com>
Date2017-09-15 07:00 +0200
Subject[PATCH 1/3] vfs: constify path argument to kernel_read_file_from_path
Message-ID<upQTo-6ps-1@gated-at.bofh.it>
This patch constifies the path argument to kernel_read_file_from_path.

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
---
 fs/exec.c                  | 2 +-
 include/linux/fs.h         | 2 +-
 sound/oss/sound_firmware.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 62175cbcc801..54a4847649cc 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -974,7 +974,7 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size,
 }
 EXPORT_SYMBOL_GPL(kernel_read_file);
 
-int kernel_read_file_from_path(char *path, void **buf, loff_t *size,
+int kernel_read_file_from_path(const char *path, void **buf, loff_t *size,
 			       loff_t max_size, enum kernel_read_file_id id)
 {
 	struct file *file;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index fdec9b763b54..d783cc8340de 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2775,7 +2775,7 @@ static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id)
 extern int kernel_read(struct file *, loff_t, char *, unsigned long);
 extern int kernel_read_file(struct file *, void **, loff_t *, loff_t,
 			    enum kernel_read_file_id);
-extern int kernel_read_file_from_path(char *, void **, loff_t *, loff_t,
+extern int kernel_read_file_from_path(const char *, void **, loff_t *, loff_t,
 				      enum kernel_read_file_id);
 extern int kernel_read_file_from_fd(int, void **, loff_t *, loff_t,
 				    enum kernel_read_file_id);
diff --git a/sound/oss/sound_firmware.h b/sound/oss/sound_firmware.h
index da4c67e005ed..2be465277ba0 100644
--- a/sound/oss/sound_firmware.h
+++ b/sound/oss/sound_firmware.h
@@ -21,7 +21,7 @@ static inline int mod_firmware_load(const char *fn, char **fp)
 	loff_t size;
 	int err;
 
-	err = kernel_read_file_from_path((char *)fn, (void **)fp, &size,
+	err = kernel_read_file_from_path(fn, (void **)fp, &size,
 					 131072, READING_FIRMWARE);
 	if (err < 0)
 		return 0;
-- 
2.7.4

[toc] | [next] | [standalone]


#1733015

FromLinus Torvalds <torvalds@linux-foundation.org>
Date2017-09-15 20:40 +0200
Message-ID<uq3GV-6Mo-21@gated-at.bofh.it>
In reply to#1732708
On Thu, Sep 14, 2017 at 9:58 PM, Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
> This patch constifies the path argument to kernel_read_file_from_path.

I've applied this upstream independently of everything else, because
it's obviously the right thing to do (as the sound_firmware.h part of
the patch shows, never mind the whole "we're just passing the pathname
to filp_open() which takes a const char"  thing).

               lINUS

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web