Page MenuHomeFreeBSD

config: Only warn if duplicate option/device comes from the same file

Authored by manu on Mar 1 2019, 5:24 PM.



This is useful for arm (possibly other arches too) where we want to have
a GENERIC kernel that only include files for the different SoC. Since
multiple SoCs/Board needs the same device we would need to do either :

  1. Include the device in a generic file
  2. Include the device in each file that really needs it

Option 1 works but if someone wants to create a specific kernel config
(which isn't uncommon for embedded system), he will need to add a lots
of nodevice to it.

Option 2 also works but produce a lots of warnings.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu created this revision.Mar 1 2019, 5:24 PM
manu added inline comments.Mar 1 2019, 5:25 PM
129 ↗(On Diff #54592)

Will correct that

390 ↗(On Diff #54592)

Maybe add a "first included in blah" message ?

kevans added inline comments.Mar 1 2019, 5:40 PM
390 ↗(On Diff #54592)

Hmm? This doesn't seem to make sense to me; you're only emitting a warning if it's duplicated within the same file to lower the noise if we duplicate across files. Adding a 'first included in blah' message seems counterproductive at a glance.

manu added inline comments.Mar 1 2019, 5:45 PM
390 ↗(On Diff #54592)

Yeah, sorry.

"WARNING: duplicate device `%s' encountered. in <filename>\n" is what we want.

ian added inline comments.Mar 24 2019, 7:29 PM
390 ↗(On Diff #54592)

I agree, mentioning which file contained duplicate entries here and in the options case below would be useful, then I think this will be ready to commit.

imp added inline comments.Mar 25 2019, 11:53 PM
390 ↗(On Diff #54592)

So the consensus is to say where things were duplicated and not suppress it?

ian added inline comments.Mar 26 2019, 12:21 AM
390 ↗(On Diff #54592)

When it is duplicated within the same file, mention the file. If the duplicate entries come from separate files, be quiet about it.

manu updated this revision to Diff 55584.Mar 29 2019, 9:28 AM
manu marked 2 inline comments as done.
kevans accepted this revision.Apr 8 2019, 4:10 PM
This revision is now accepted and ready to land.Apr 8 2019, 4:10 PM
This revision was automatically updated to reflect the committed changes.