Thread (34 messages) 34 messages, 5 authors, 2022-05-12

Re: [PATCH v4 03/14] modpost: split the section mismatch checks into section-check.c

From: Masahiro Yamada <masahiroy@kernel.org>
Date: 2022-05-10 07:35:40
Also in: linux-kbuild, linux-modules, linux-s390, lkml, llvm

On Tue, May 10, 2022 at 2:20 AM Nick Desaulniers
[off-list ref] wrote:
On Sun, May 8, 2022 at 12:10 PM Masahiro Yamada [off-list ref] wrote:
quoted
modpost.c is too big, and the half of the code is for section checks.
Split it.

I fixed some style issues in the moved code.
It would be helpful for review if the split and restyle were distinct
patches.  Otherwise I can't tell what has changed.

This does lose the ability to use git blame to get more context on
some of the oddities in modpost (which I have found useful in the
past).  I don't feel strongly though.

OK, I will just move the code in v5.




quoted
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index a78b75f0eeb0..e7e2c70a98f5 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -31,7 +31,7 @@ static bool external_module;
 /* Only warn about unresolved symbols */
 static bool warn_unresolved;

-static int sec_mismatch_count;
+int sec_mismatch_count;
^ this should go in modpost.h if it is to be used in two translation
units, rather than forward declaring it in section-check.c.  You did
this for the functions.

Sorry, I do not understand.


In modpost.h, I put the declaration:

  extern int sec_mismatch_count;

If I moved it to the header without 'extern'
I would get multiple definitions.







--
Best Regards
Masahiro Yamada
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help