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


Groups > linux.kernel > #1261843

Re: [PATCH v9 1/1] efi: a misc char interface for user to update efi firmware

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH v9 1/1] efi: a misc char interface for user to update efi firmware
Date 2015-11-03 21:20 +0100
Message-ID <qqQdH-7wj-1@gated-at.bofh.it> (permalink)
References (3 earlier) <qpYwG-7a6-13@gated-at.bofh.it> <qpYwG-7a6-11@gated-at.bofh.it> <qpYQ2-7w8-13@gated-at.bofh.it> <qq0oN-8n6-7@gated-at.bofh.it> <qqhzj-2oT-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v9 1/1] efi: a misc char interface for user to update efi  firmware Borislav Petkov <bp@alien8.de> - 2015-11-01 11:40 +0100
  Re: [PATCH v9 1/1] efi: a misc char interface for user to update efi  firmware Borislav Petkov <bp@alien8.de> - 2015-11-01 12:00 +0100
    RE: [PATCH v9 1/1] efi: a misc char interface for user to update  efi firmware "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2015-11-01 12:20 +0100
      Re: [PATCH v9 1/1] efi: a misc char interface for user to update efi  firmware Borislav Petkov <bp@alien8.de> - 2015-11-01 14:00 +0100
        RE: [PATCH v9 1/1] efi: a misc char interface for user to update  efi firmware "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2015-11-02 08:20 +0100
          Re: [PATCH v9 1/1] efi: a misc char interface for user to update efi  firmware Borislav Petkov <bp@alien8.de> - 2015-11-03 21:20 +0100
            RE: [PATCH v9 1/1] efi: a misc char interface for user to update  efi firmware "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2015-11-05 04:50 +0100
  RE: [PATCH v9 1/1] efi: a misc char interface for user to update  efi firmware "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2015-11-01 12:00 +0100

csiph-web