From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Kees Cook <keescook@chromium.org>, Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
"Greg KH" <gregkh@linuxfoundation.org>,
"Ming Lei" <ming.lei@canonical.com>,
"Josh Boyer" <jwboyer@fedoraproject.org>,
"Johannes Berg" <johannes@sipsolutions.net>,
"Andy Lutomirski" <luto@amacapital.net>,
"Jonathan Corbet" <corbet@lwn.net>,
"David Woodhouse" <dwmw2@infradead.org>,
"David Howells" <dhowells@redhat.com>,
"Seth Forshee" <seth.forshee@canonical.com>,
"Rusty Russell" <rusty@rustcorp.com.au>,
"Michal Marek" <mmarek@suse.cz>,
"Matthew Garrett" <mjg59@srcf.ucam.org>,
"Kyle McMartin" <kyle@kernel.org>,
"Mimi Zohar" <zohar@linux.vnet.ibm.com>,
"Dmitry Kasatkin" <dmitry.kasatkin@gmail.com>,
"Vivek Goyal" <vgoyal@redhat.com>,
"Brian Norris" <computersforpeace@gmail.com>,
"Shuah Khan" <shuahkh@osg.samsung.com>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
linux-security-module <linux-security-module@vger.kernel.org>,
keyrings@linux-nfs.org, LKML <linux-kernel@vger.kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Casey Schaufler" <casey@schaufler-ca.com>,
"Takashi Iwai" <tiwai@suse.de>,
"Vojtěch Pavlík" <vojtech@suse.cz>
Subject: Re: [PATCH v3 1/5] firmware: generalize "firmware" as "system data" helpers
Date: Fri, 22 Jan 2016 21:10:09 +0100 [thread overview]
Message-ID: <20160122201009.GX20964@wotan.suse.de> (raw)
In-Reply-To: <CAGXu5j+UB=2rR0gczs+2pwg46QgM6tSFOFobbhA07r84p1HNDw@mail.gmail.com>
On Mon, Jan 04, 2016 at 12:41:07PM -0800, Kees Cook wrote:
> On Wed, Dec 23, 2015 at 1:34 PM, Luis R. Rodriguez
> <mcgrof@do-not-panic.com> wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> >
> > Historically firmware_class code was added to help
> > get device driver firmware binaries but these days
> > request_firmware*() helpers are being repurposed for
> > general system data needed by the kernel.
> >
> > Annotate this before we extend firmare_class more,
> > as this is expected. We want to generalize the code
> > as much as possible.
> >
> > Cc: Rusty Russell <rusty@rustcorp.com.au>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: David Howells <dhowells@redhat.com>
> > Cc: Kees Cook <keescook@chromium.org>
> > Cc: Casey Schaufler <casey@schaufler-ca.com>
> > Cc: Ming Lei <ming.lei@canonical.com>
> > Cc: Takashi Iwai <tiwai@suse.de>
> > Cc: Vojtěch Pavlík <vojtech@suse.cz>
> > Cc: Kyle McMartin <kyle@kernel.org>
> > Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> > Cc: linux-kernel@vger.kernel.org
> > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> > ---
> > drivers/base/firmware_class.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> > index 8524450e75bd..6f5fcda71a60 100644
> > --- a/drivers/base/firmware_class.c
> > +++ b/drivers/base/firmware_class.c
> > @@ -353,15 +353,15 @@ static int fw_get_filesystem_firmware(struct device *device,
> > rc = fw_read_file_contents(file, buf);
> > fput(file);
> > if (rc)
> > - dev_warn(device, "firmware, attempted to load %s, but failed with error %d\n",
> > - path, rc);
> > + dev_warn(device, "system data, attempted to load %s, but failed with error %d\n",
> > + path, rc);
>
> Since dev_warn should already be prefixing the string, I would think
> "firmware, " should just be removed entirely instead of replaced?
Its a good point, the messages could also be simplified further. Here's
a more generic form and patch description that I'll wrap into a v4
iteration after Mimi's patches go in.
[PATCH] firmware: simplify generic "firmware" helpers
Historically firmware_class code was added to help
get device driver firmware binaries but these days
request_firmware*() helpers are being repurposed for
general system data needed by the kernel.
To make the generic set of routines that will be shared
with generic system data helpers simplify a few of
the shared debug and warn print outs, the prints already
have the device associated as dev_*() helpers are used.
This will help generalize shared code as much as possible.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Vojtěch Pavlík <vojtech@suse.cz>
Cc: Kyle McMartin <kyle@kernel.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
drivers/base/firmware_class.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 8524450e75bd..3358f5df926f 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -353,15 +353,15 @@ static int fw_get_filesystem_firmware(struct device *device,
rc = fw_read_file_contents(file, buf);
fput(file);
if (rc)
- dev_warn(device, "firmware, attempted to load %s, but failed with error %d\n",
- path, rc);
+ dev_warn(device, "loading %s failed with error %d\n",
+ path, rc);
else
break;
}
__putname(path);
if (!rc) {
- dev_dbg(device, "firmware: direct-loading firmware %s\n",
+ dev_dbg(device, "direct-loading %s\n",
buf->fw_id);
mutex_lock(&fw_lock);
set_bit(FW_STATUS_DONE, &buf->status);
@@ -1051,7 +1051,7 @@ _request_firmware_prepare(struct firmware **firmware_p, const char *name,
}
if (fw_get_builtin_firmware(firmware, name)) {
- dev_dbg(device, "firmware: using built-in firmware %s\n", name);
+ dev_dbg(device, "using built-in %s\n", name);
return 0; /* assigned */
}
--
2.7.0
next prev parent reply other threads:[~2016-01-22 20:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 21:34 [PATCH v3 0/5] firmware_class: extensible firmware API Luis R. Rodriguez
2015-12-23 21:34 ` [PATCH v3 1/5] firmware: generalize "firmware" as "system data" helpers Luis R. Rodriguez
2016-01-04 20:41 ` Kees Cook
2016-01-22 20:10 ` Luis R. Rodriguez [this message]
2015-12-23 21:34 ` [PATCH v3 2/5] firmware: move completing fw into a helper Luis R. Rodriguez
2016-01-04 20:44 ` Josh Boyer
2015-12-23 21:34 ` [PATCH v3 3/5] firmware: fold successful fw read early Luis R. Rodriguez
2016-01-04 20:48 ` Josh Boyer
2016-01-22 1:45 ` Luis R. Rodriguez
2016-01-22 11:56 ` Mimi Zohar
2016-01-22 19:50 ` Luis R. Rodriguez
2015-12-23 21:34 ` [PATCH v3 4/5] firmware: generalize reading file contents as a helper Luis R. Rodriguez
2016-01-22 1:43 ` Luis R. Rodriguez
2015-12-23 21:34 ` [PATCH v3 5/5] firmware: add an extensible system data helpers Luis R. Rodriguez
2015-12-23 22:26 ` kbuild test robot
2016-01-22 1:27 ` Luis R. Rodriguez
2016-01-04 20:31 ` Kees Cook
2016-01-22 1:58 ` Luis R. Rodriguez
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=20160122201009.GX20964@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=akpm@linux-foundation.org \
--cc=casey@schaufler-ca.com \
--cc=computersforpeace@gmail.com \
--cc=corbet@lwn.net \
--cc=dhowells@redhat.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=dwmw2@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=johannes@sipsolutions.net \
--cc=jwboyer@fedoraproject.org \
--cc=keescook@chromium.org \
--cc=keyrings@linux-nfs.org \
--cc=kyle@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mcgrof@do-not-panic.com \
--cc=ming.lei@canonical.com \
--cc=mjg59@srcf.ucam.org \
--cc=mmarek@suse.cz \
--cc=rusty@rustcorp.com.au \
--cc=seth.forshee@canonical.com \
--cc=shuahkh@osg.samsung.com \
--cc=tiwai@suse.de \
--cc=torvalds@linux-foundation.org \
--cc=vgoyal@redhat.com \
--cc=vojtech@suse.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).