All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
Cc: Matt Fleming <matt@console-pimps.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Ong, Boon Leong" <boon.leong.ong@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Peter Jones <pjones@redhat.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Roy Franz <roy.franz@linaro.org>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	"Fleming, Matt" <matt.fleming@intel.com>,
	"Anvin, H Peter" <h.peter.anvin@intel.com>
Subject: Re: [PATCH v9 1/1] efi: a misc char interface for user to update efi firmware
Date: Tue, 3 Nov 2015 21:14:55 +0100	[thread overview]
Message-ID: <20151103201455.GD3620@pd.tnic> (raw)
In-Reply-To: <F54AEECA5E2B9541821D670476DAE19C4A879C38@PGSMSX102.gar.corp.intel.com>

On Mon, Nov 02, 2015 at 07:17:28AM +0000, Kweh, Hock Leong wrote:
> This is not a return value to indicate what is going now. It is a flag
> used in "cap_info->index" which positive value has a meaning of index
> number. I am using the negative value for the flag which similar to
> the implementation of pointer & error pointer (ERR_PTR).

Ok, but that doesn't make any sense: you're assigning UPLOAD_DONE to
cap_info->index only once in efi_capsule_submit_update() and you're not
testing it anywhere. Yeah, yeah, you're implicitly testing for it by
doing the "< 0" check.

So simply assign -1 to ->index to mean *any* type of error occurred,
remove the defines and you can always test for "< 0" to mean "did
something fail".

You simply don't need two error values...

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

  reply	other threads:[~2015-11-03 20:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 17:58 [PATCH v9 0/1] Enable capsule loader interface for efi firmware updating Kweh, Hock Leong
     [not found] ` <1446055138-26047-1-git-send-email-hock.leong.kweh-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-10-28 17:58   ` [PATCH v9 1/1] efi: a misc char interface for user to update efi firmware Kweh, Hock Leong
2015-10-28 17:58     ` Kweh, Hock Leong
2015-11-01 10:29     ` Borislav Petkov
2015-11-01 10:52       ` Kweh, Hock Leong
2015-11-01 10:52         ` Kweh, Hock Leong
     [not found]         ` <F54AEECA5E2B9541821D670476DAE19C4A8799FB-j2khPEwRog0FyVwBAnZdSLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-11-01 10:58           ` Borislav Petkov
2015-11-01 10:58             ` Borislav Petkov
     [not found]             ` <20151101105801.GB12711-fF5Pk5pvG8Y@public.gmane.org>
2015-11-01 11:11               ` Kweh, Hock Leong
2015-11-01 11:11                 ` Kweh, Hock Leong
2015-11-01 11:11                 ` Kweh, Hock Leong
     [not found]                 ` <F54AEECA5E2B9541821D670476DAE19C4A879A18-j2khPEwRog0FyVwBAnZdSLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-11-01 12:58                   ` Borislav Petkov
2015-11-01 12:58                     ` Borislav Petkov
2015-11-02  7:17                     ` Kweh, Hock Leong
2015-11-02  7:17                       ` Kweh, Hock Leong
2015-11-03 20:14                       ` Borislav Petkov [this message]
2015-11-05  3:42                         ` Kweh, Hock Leong
2015-11-05  3:42                           ` Kweh, Hock Leong
  -- strict thread matches above, loose matches on Subject: below --
2015-11-02  6:47 Kweh, Hock Leong
2015-11-02  6:47 ` Kweh, Hock Leong
2015-11-02  6:47 ` Kweh, Hock Leong
     [not found] ` <F54AEECA5E2B9541821D670476DAE19C4A879BFE-j2khPEwRog0FyVwBAnZdSLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-11-03 19:59   ` Borislav Petkov
2015-11-03 19:59     ` Borislav Petkov
     [not found]     ` <20151103195934.GC3620-fF5Pk5pvG8Y@public.gmane.org>
2015-12-16 11:09       ` Kweh, Hock Leong
2015-12-16 11:09         ` Kweh, Hock Leong
2015-12-16 11:09         ` Kweh, Hock Leong
2015-12-16 11:26         ` Borislav Petkov
2015-12-17  1:59           ` Kweh, Hock Leong
2015-12-17  1:59             ` Kweh, Hock Leong

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=20151103201455.GD3620@pd.tnic \
    --to=bp@alien8.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=boon.leong.ong@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=h.peter.anvin@intel.com \
    --cc=hock.leong.kweh@intel.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=matt.fleming@intel.com \
    --cc=matt@console-pimps.org \
    --cc=pjones@redhat.com \
    --cc=roy.franz@linaro.org \
    --cc=semen.protsenko@linaro.org \
    /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.