All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 10/10] module-verifier: make it possible to run checkers on grub-module-verifierxx.c
@ 2020-03-13 19:17 Javier Martinez Canillas
  2020-04-03 19:29 ` Daniel Kiper
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Martinez Canillas @ 2020-03-13 19:17 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Peter Jones, Javier Martinez Canillas

From: Peter Jones <pjones@redhat.com>

This makes it so you can treat grub-module-verifierxx.c as a file you can
build directly, so syntax checkers like vim's "syntastic" plugin, which uses
"gcc -x c -fsyntax-only" to build it, will work.

One still has to do whatever setup is required to make it pick the right
include dirs, which -W options we use, etc., but this makes it so you can do
the checking on the file you're editing, rather than on a different file.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

---

 util/grub-module-verifier32.c | 2 ++
 util/grub-module-verifier64.c | 2 ++
 util/grub-module-verifierXX.c | 9 +++++++++
 3 files changed, 13 insertions(+)

diff --git a/util/grub-module-verifier32.c b/util/grub-module-verifier32.c
index 257229f8f08..ba7d41aafea 100644
--- a/util/grub-module-verifier32.c
+++ b/util/grub-module-verifier32.c
@@ -1,2 +1,4 @@
 #define MODULEVERIFIER_ELF32 1
+#ifndef GRUB_MODULE_VERIFIERXX
 #include "grub-module-verifierXX.c"
+#endif
diff --git a/util/grub-module-verifier64.c b/util/grub-module-verifier64.c
index 4db6b4bedd1..fc23ef800b3 100644
--- a/util/grub-module-verifier64.c
+++ b/util/grub-module-verifier64.c
@@ -1,2 +1,4 @@
 #define MODULEVERIFIER_ELF64 1
+#ifndef GRUB_MODULE_VERIFIERXX
 #include "grub-module-verifierXX.c"
+#endif
diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c
index ceb24309aec..a98e2f9b1ac 100644
--- a/util/grub-module-verifierXX.c
+++ b/util/grub-module-verifierXX.c
@@ -1,3 +1,12 @@
+#define GRUB_MODULE_VERIFIERXX
+#if !defined(MODULEVERIFIER_ELF32) && !defined(MODULEVERIFIER_ELF64)
+#if __SIZEOF_POINTER__ == 8
+#include "grub-module-verifier64.c"
+#else
+#include "grub-module-verifier32.c"
+#endif
+#endif
+
 #include <string.h>
 
 #include <grub/elf.h>
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 10/10] module-verifier: make it possible to run checkers on grub-module-verifierxx.c
  2020-03-13 19:17 [PATCH 10/10] module-verifier: make it possible to run checkers on grub-module-verifierxx.c Javier Martinez Canillas
@ 2020-04-03 19:29 ` Daniel Kiper
  2020-04-06  9:51   ` Javier Martinez Canillas
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Kiper @ 2020-04-03 19:29 UTC (permalink / raw)
  To: Javier Martinez Canillas; +Cc: grub-devel, Daniel Kiper, Peter Jones

On Fri, Mar 13, 2020 at 08:17:17PM +0100, Javier Martinez Canillas wrote:
> From: Peter Jones <pjones@redhat.com>
>
> This makes it so you can treat grub-module-verifierxx.c as a file you can
> build directly, so syntax checkers like vim's "syntastic" plugin, which uses
> "gcc -x c -fsyntax-only" to build it, will work.
>
> One still has to do whatever setup is required to make it pick the right
> include dirs, which -W options we use, etc., but this makes it so you can do
> the checking on the file you're editing, rather than on a different file.
>
> Signed-off-by: Peter Jones <pjones@redhat.com>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>
> ---
>
>  util/grub-module-verifier32.c | 2 ++
>  util/grub-module-verifier64.c | 2 ++
>  util/grub-module-verifierXX.c | 9 +++++++++
>  3 files changed, 13 insertions(+)

Comments for this patch are here:
  https://lists.gnu.org/archive/html/grub-devel/2018-09/msg00006.html

Daniel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 10/10] module-verifier: make it possible to run checkers on grub-module-verifierxx.c
  2020-04-03 19:29 ` Daniel Kiper
@ 2020-04-06  9:51   ` Javier Martinez Canillas
  0 siblings, 0 replies; 3+ messages in thread
From: Javier Martinez Canillas @ 2020-04-06  9:51 UTC (permalink / raw)
  To: The development of GNU GRUB, Daniel Kiper; +Cc: Daniel Kiper, Peter Jones

Hello Daniel,

On 4/3/20 9:29 PM, Daniel Kiper wrote:
> On Fri, Mar 13, 2020 at 08:17:17PM +0100, Javier Martinez Canillas wrote:
>> From: Peter Jones <pjones@redhat.com>
>>
>> This makes it so you can treat grub-module-verifierxx.c as a file you can
>> build directly, so syntax checkers like vim's "syntastic" plugin, which uses
>> "gcc -x c -fsyntax-only" to build it, will work.
>>
>> One still has to do whatever setup is required to make it pick the right
>> include dirs, which -W options we use, etc., but this makes it so you can do
>> the checking on the file you're editing, rather than on a different file.
>>
>> Signed-off-by: Peter Jones <pjones@redhat.com>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>>
>> ---
>>
>>  util/grub-module-verifier32.c | 2 ++
>>  util/grub-module-verifier64.c | 2 ++
>>  util/grub-module-verifierXX.c | 9 +++++++++
>>  3 files changed, 13 insertions(+)
> 
> Comments for this patch are here:
>   https://lists.gnu.org/archive/html/grub-devel/2018-09/msg00006.html
>

I missed that this patch was posted before by Peter, sorry. I'll address these
before sending a v2.
 
> Daniel
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 

Best regards,
-- 
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-06  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 19:17 [PATCH 10/10] module-verifier: make it possible to run checkers on grub-module-verifierxx.c Javier Martinez Canillas
2020-04-03 19:29 ` Daniel Kiper
2020-04-06  9:51   ` Javier Martinez Canillas

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.