All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Scott Branden <scott.branden@broadcom.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>,
	David Brown <david.brown@linaro.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Shuah Khan <shuah@kernel.org>,
	bjorn.andersson@linaro.org,
	Shuah Khan <skhan@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Olof Johansson <olof@lixom.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Colin Ian King <colin.king@canonical.com>,
	Kees Cook <keescook@chromium.org>, Takashi Iwai <tiwai@suse.de>,
	linux-kselftest@vger.kernel.org, Andy Gross <agross@kernel.org>
Subject: Re: [PATCH v5 1/7] fs: introduce kernel_pread_file* support
Date: Wed, 13 May 2020 08:51:33 +0200	[thread overview]
Message-ID: <20200513065133.GB764247@kroah.com> (raw)
In-Reply-To: <2e4bc125-5fe5-e3e5-4881-29374da942aa@broadcom.com>

On Tue, May 12, 2020 at 11:23:27PM -0700, Scott Branden wrote:
> Hi Luis,
> 
> A few comments inline before I cleanup.
> 
> On 2020-05-12 5:27 p.m., Luis Chamberlain wrote:
> > On Thu, May 07, 2020 at 05:27:33PM -0700, Scott Branden wrote:
> > > diff --git a/fs/exec.c b/fs/exec.c
> > > index 06b4c550af5d..cfab212fab9d 100644
> > > --- a/fs/exec.c
> > > +++ b/fs/exec.c
> > > @@ -896,10 +896,14 @@ struct file *open_exec(const char *name)
> > >   }
> > >   EXPORT_SYMBOL(open_exec);
> > > -int kernel_read_file(struct file *file, void **buf, loff_t *size,
> > > -		     loff_t max_size, enum kernel_read_file_id id)
> > > -{
> > > -	loff_t i_size, pos;
> > > +int kernel_pread_file(struct file *file, void **buf, loff_t *size,
> > > +		      loff_t pos, loff_t max_size, unsigned int flags,
> > You use int flags, but.. these are mutually exclusive operations, and
> > so flags is a misnomer. Just use an enum instead of a define, that way
> > we can use kdoc for documentation.
> OK, flags could be used to expand with additional flag options in the future
> (without change to function prototype, but will change to enum if that is
> what is desired.
> > > +EXPORT_SYMBOL_GPL(kernel_pread_file);
> > > +EXPORT_SYMBOL_GPL(kernel_pread_file_from_path);
> > > +EXPORT_SYMBOL_GPL(kernel_pread_file_from_path_initns);
> > > +EXPORT_SYMBOL_GPL(kernel_pread_file_from_fd);
> > If no one is using these don't export them. I think you only use one of
> > these. In fact just remove the code from the ones which are not used.
> I do not use them but added them to provide consistent api with
> kernel_read_file_* functions.  That way someone can take advantage of the
> _from_path and from_fd variants in the future if desired. But if you want
> them removed it is simple to drop the EXPORT_SYMBOL_GPL and then add that
> back when first driver that calls them needs them in the future.

We do not export symbols when there are no in-kernel users.

> Note: Existing kernel_read_file_from_path_initns is not used in the kernel. 
> Should we delete that as well?

Probably, yes.

thanks,

greg k-h

  reply	other threads:[~2020-05-13  6:51 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  0:27 [PATCH v5 0/7] firmware: add partial read support in request_firmware_into_buf Scott Branden
2020-05-08  0:27 ` [PATCH v5 1/7] fs: introduce kernel_pread_file* support Scott Branden
2020-05-13  0:27   ` Luis Chamberlain
2020-05-13  6:23     ` Scott Branden
2020-05-13  6:51       ` Greg Kroah-Hartman [this message]
2020-05-13  8:16         ` Scott Branden
2020-05-13 18:39   ` Mimi Zohar
2020-05-13 18:53     ` Scott Branden
2020-05-13 18:57       ` Scott Branden
2020-05-13 19:03       ` Mimi Zohar
2020-05-13 19:18         ` Scott Branden
2020-05-13 19:39           ` Mimi Zohar
2020-05-13 19:41             ` Scott Branden
2020-05-13 21:20               ` Mimi Zohar
2020-05-13 21:28                 ` Luis Chamberlain
2020-05-13 22:12                   ` Mimi Zohar
2020-05-13 22:48                     ` Scott Branden
2020-05-13 23:00                       ` Mimi Zohar
2020-05-13 23:34                         ` Kees Cook
2020-05-13 23:58                           ` Mimi Zohar
2020-05-08  0:27 ` [PATCH v5 2/7] firmware: add offset to request_firmware_into_buf Scott Branden
2020-05-13  0:33   ` Luis Chamberlain
2020-05-13 18:35     ` Scott Branden
2020-05-15 20:44       ` Luis Chamberlain
2020-05-08  0:27 ` [PATCH v5 3/7] test_firmware: add partial read support for request_firmware_into_buf Scott Branden
2020-05-13  0:35   ` Luis Chamberlain
2020-05-08  0:27 ` [PATCH v5 4/7] firmware: test partial file reads of request_firmware_into_buf Scott Branden
2020-05-08  0:27 ` [PATCH v5 5/7] bcm-vk: add bcm_vk UAPI Scott Branden
2020-05-08  0:27 ` [PATCH v5 6/7] misc: bcm-vk: add Broadcom VK driver Scott Branden
2020-05-13  0:38   ` Luis Chamberlain
2020-05-13  6:31     ` Scott Branden
2020-05-13  6:50       ` Greg Kroah-Hartman
2020-05-13 12:30         ` Luis Chamberlain
2020-05-13 18:39           ` Scott Branden
2020-05-08  0:27 ` [PATCH v5 7/7] MAINTAINERS: bcm-vk: add maintainer for Broadcom VK Driver Scott Branden
2020-05-13 16:23 ` [PATCH v5 0/7] firmware: add partial read support in request_firmware_into_buf Mimi Zohar
2020-05-15 20:47   ` Luis Chamberlain
2020-05-15 23:28     ` Scott Branden
2020-05-16  1:05       ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200513065133.GB764247@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=agross@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=david.brown@linaro.org \
    --cc=keescook@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=olof@lixom.net \
    --cc=rafael@kernel.org \
    --cc=scott.branden@broadcom.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tiwai@suse.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zohar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.