<div dir="ltr"><div>Yeap! That solved the problem. Seems I was not using correctly the <a href="http://checkpatch.pl">checkpatch.pl</a> file. My bad.</div><div><br></div><div>Now everything seems to be working fine. </div><div><br></div><div>Thanks for the help!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar., 3 sept. 2019 a las 7:21, Valdis Klētnieks (<<a href="mailto:valdis.kletnieks@vt.edu">valdis.kletnieks@vt.edu</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 03 Sep 2019 01:26:17 -0300, Pablo Pellecchia said:<br>
<br>
> *WARNING: struct should normally be const#9: FILE:<br>
> platform_net.h:9:+struct xlr_net_data {*<br>
><br>
> A similar issue is reported when we declare a variable of type struct<br>
> <something>, but in this case warning is reported on the struct definition<br>
> itself.<br>
><br>
> How can we fix this?<br>
<br>
And in today's "How to debug checkpatch" lesson.. :)<br>
<br>
First, figure out if checkpatch is in fact correct. It' just a Perl script,<br>
and has no real idea of what the code is.<br>
<br>
And double-checking, there's very few 'const struct' declarations in<br>
include/linux/*.h.<br>
<br>
So what's going on? Good question. Actually looking at <a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a>,<br>
we find:<br>
<br>
# check for various structs that are normally const (ops, kgdb, device_tree)<br>
# and avoid what seem like struct definitions 'struct foo {'<br>
if ($line !~ /\bconst\b/ &&<br>
$line =~ /\bstruct\s+($const_structs)\b(?!\s*\{)/) {<br>
WARN("CONST_STRUCT",<br>
"struct $1 should normally be const\n" . $herecurr);<br>
}<br>
<br>
and $const_structs is initialized from scripts/const_structs.checkpatch <br>
And that tells us 2 things: First, this should only be triggering for structures<br>
that are listed in that file, and the message *should* say something<br>
like 'struct foo should normally be const', with $1 filling in the struct name.<br>
<br>
So why is $1 not showing up? Damned good question. And the file<br>
checks just fine for me.<br>
<br>
[/usr/src/linux-next]2 scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a> -f drivers/staging/netlogic/platform_net.h<br>
total: 0 errors, 0 warnings, 0 checks, 21 lines checked<br>
<br>
drivers/staging/netlogic/platform_net.h has no obvious style problems and is ready for submission.<br>
<br>
Bingo! This is what happens if the permissions on the file are messed up<br>
and it can't read the file:<br>
<br>
[/usr/src/linux-next] scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a> -f drivers/staging/netlogic/platform_net.h<br>
No structs that should be const will be found - file '/usr/src/linux-next/scripts/const_structs.checkpatch': Permission denied<br>
WARNING: struct should normally be const<br>
#9: FILE: drivers/staging/netlogic/platform_net.h:9:<br>
+struct xlr_net_data {<br>
<br>
So... you probably need to check the permissions, or if the file is missing<br>
from your tree or empty or something. The version in my tree is 64 lines long.<br>
<br>
Meanwhile, I'm going to go cook up a patch for this....<br>
<br>
<br>
</blockquote></div>