linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: matt@codeblueprint.co.uk (Matt Fleming)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] arm64: efistub: drop __init annotation from handle_kernel_image()
Date: Tue, 2 Feb 2016 11:08:21 +0000	[thread overview]
Message-ID: <20160202110821.GB2642@codeblueprint.co.uk> (raw)
In-Reply-To: <CAKv+Gu96tdf8ZrGHDi_YKacsRF_b336Nu4Anh61j4u3Lg18BHg@mail.gmail.com>

On Fri, 29 Jan, at 05:03:16PM, Ard Biesheuvel wrote:
> On 29 January 2016 at 17:00, Matt Fleming <matt@codeblueprint.co.uk> wrote:
> > On Fri, 29 Jan, at 10:36:03AM, Ard Biesheuvel wrote:
> >> On 28 January 2016 at 23:58, Matt Fleming <matt@codeblueprint.co.uk> wrote:
> >> >
> >> > Would it make more sense to #undef __init in one of the arm64 efistub
> >> > header files? I'm thinking of the case where some poor unsuspecting
> >> > developer writes a new function and marks it as __init, and we miss it
> >> > during review.
> >> >
> >>
> >> Yes, I can add it to efistub.h, and make sure it gets included in all the files
> >>
> >> Should we #undef it and #define it to a string that is easily grep'ed
> >> for, so it is easy to find the explanatory comment that goes along
> >> with it?
> >> E.g.,
> >>
> >> #define __init __init_not_supported_in_efi_stub
> >
> > This would produce a compilation failure if someone tags something as
> > __init right? Looks fine to me.
> 
> Yes, but it makes the error message difficult to decipher, since
> __init is printed and not what it resolves to. Locally, I tried this,
> which seems to work:
> 
> #undef __init
> #define __init __attribute__((__init_not_supported_in_efi_stub))
> #pragma GCC diagnostic error "-Wattributes"
> 
> which produces
> 
>   CC      drivers/firmware/efi/libstub/arm-stub.o
> /home/ard/linux-2.6/drivers/firmware/efi/libstub/arm-stub.c:24:1:
> error: ?__init_not_supported_in_efi_stub? attribute directive ignored
> [-Werror=attributes]
>  {
>  ^
> cc1: some warnings being treated as errors
> 
> which is slightly dodgy, but at least puts the string right in the error message

What about,

#define __init __compiletime_error("__init not supported in EFI boot stub")

?

  reply	other threads:[~2016-02-02 11:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 11:07 [PATCH 0/3] arm efi minor fixes Ard Biesheuvel
2016-01-28 11:07 ` [PATCH 1/3] arm64: efistub: drop __init annotation from handle_kernel_image() Ard Biesheuvel
2016-01-28 15:56   ` Will Deacon
2016-01-28 22:58   ` Matt Fleming
2016-01-29  9:36     ` Ard Biesheuvel
2016-01-29 16:00       ` Matt Fleming
2016-01-29 16:03         ` Ard Biesheuvel
2016-02-02 11:08           ` Matt Fleming [this message]
2016-02-02 11:09             ` Ard Biesheuvel
2016-02-03 15:19               ` Matt Fleming
2016-02-03 15:21                 ` Ard Biesheuvel
2016-01-28 11:07 ` [PATCH 2/3] arm64: vmlinux.lds.S: handle .init.rodata.xxx and .init.bss sections Ard Biesheuvel
2016-01-28 15:57   ` Will Deacon
2016-01-28 22:59   ` Matt Fleming
2016-01-28 11:07 ` [PATCH 3/3] efi: arm-init: use read-only early mappings Ard Biesheuvel
2016-01-28 15:53 ` [PATCH 0/3] arm efi minor fixes Mark Rutland

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=20160202110821.GB2642@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=linux-arm-kernel@lists.infradead.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 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).