linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: Ming Lei <ming.lei@canonical.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	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>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	keyrings@linux-nfs.org
Subject: Re: [PATCH 3/4] firmware: fold successful fw read early
Date: Mon, 10 Aug 2015 09:43:36 -0700	[thread overview]
Message-ID: <CAB=NE6UB0=HiN8vadNpmDCoPa_c6-nApbYcjUZxa_Q3GfTPVog@mail.gmail.com> (raw)
In-Reply-To: <CACVXFVPT0JfUqH6fPTU+km4=KtSjcA8=zk+gsGv+oR6ee01FLg@mail.gmail.com>

On Sun, Aug 9, 2015 at 6:29 AM, Ming Lei <ming.lei@canonical.com> wrote:
> On Tue, Aug 4, 2015 at 6:00 PM, Luis R. Rodriguez
> <mcgrof@do-not-panic.com> wrote:
>> From: David Howells <dhowells@redhat.com>
>>
>> We'll be folding in some more checks on fw_read_file_contents(),
>> this will make the success case easier to follow.
>>
>> Signed-off-by: David Howells <dhowells@redhat.com>
>> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
>> ---
>>  drivers/base/firmware_class.c | 16 +++++++---------
>>  1 file changed, 7 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
>> index 9ee334c1b872..736fb952b75b 100644
>> --- a/drivers/base/firmware_class.c
>> +++ b/drivers/base/firmware_class.c
>> @@ -361,20 +361,18 @@ static int fw_get_filesystem_firmware(struct device *device,
>>                         continue;
>>                 rc = fw_read_file_contents(file, buf);
>>                 fput(file);
>> -               if (rc)
>> +               if (rc == 0) {
>> +                       dev_dbg(device, "system data: direct-loading firmware %s\n",
>> +                               buf->fw_id);
>> +                       fw_finish_direct_load(device, buf);
>> +                       goto out;
>
> 'break' should be enough, and the following 'out' label can be saved too.

This is true but I left it as it makes the next patch easier to read and follow.

>> +               } else
>>                         dev_warn(device, "system data, attempted to load %s, but failed with error %d\n",
>>                                  path, rc);
>> -               else
>> -                       break;
>>         }
>> +out:
>>         __putname(path);

  Luis

  reply	other threads:[~2015-08-10 16:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 22:00 [PATCH 0/4] firmware_class: few small code shifts Luis R. Rodriguez
2015-08-04 22:00 ` [PATCH 1/4] firmware: generalize "firmware" as "system data" helpers Luis R. Rodriguez
2015-10-04 19:16   ` Greg KH
2015-10-05 21:22     ` Luis R. Rodriguez
2015-10-06  9:08       ` Greg KH
2015-10-06 17:28         ` [PATCH 1/4] firmware: generalize "firmware" as "system data" helpers] Luis R. Rodriguez
2015-10-08 20:16         ` [PATCH 1/4] firmware: generalize "firmware" as "system data" helpers Josh Boyer
2015-12-17 19:16           ` Luis R. Rodriguez
2015-08-04 22:00 ` [PATCH 2/4] firmware: move completing fw into a helper Luis R. Rodriguez
2015-08-04 22:00 ` [PATCH 3/4] firmware: fold successful fw read early Luis R. Rodriguez
2015-08-09 13:29   ` Ming Lei
2015-08-10 16:43     ` Luis R. Rodriguez [this message]
2015-08-04 22:00 ` [PATCH 4/4] firmware: generalize reading file contents as a helper Luis R. Rodriguez
2015-08-21 21:23 ` [PATCH 0/4] firmware_class: few small code shifts Luis R. Rodriguez
2015-08-22  5:38   ` Greg KH
2015-08-22 21:18     ` 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='CAB=NE6UB0=HiN8vadNpmDCoPa_c6-nApbYcjUZxa_Q3GfTPVog@mail.gmail.com' \
    --to=mcgrof@do-not-panic.com \
    --cc=corbet@lwn.net \
    --cc=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=keyrings@linux-nfs.org \
    --cc=kyle@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=mmarek@suse.cz \
    --cc=rusty@rustcorp.com.au \
    --cc=seth.forshee@canonical.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).