Page MenuHomeFreeBSD

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

Authored by manu on Mar 1 2019, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 22 2024, 10:29 PM
Unknown Object (File)
Mar 22 2024, 10:25 PM
Unknown Object (File)
Mar 22 2024, 10:25 PM
Unknown Object (File)
Mar 22 2024, 10:25 PM
Unknown Object (File)
Mar 8 2024, 6:09 AM
Unknown Object (File)
Jan 12 2024, 9:34 PM
Unknown Object (File)
Jan 6 2024, 6:48 AM
Unknown Object (File)
Jan 6 2024, 5:25 AM
Subscribers

Details

Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

usr.sbin/config/config.h
129

s/device/options/
Will correct that

usr.sbin/config/config.y
390

Maybe add a "first included in blah" message ?

usr.sbin/config/config.y
390

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.

usr.sbin/config/config.y
390

Yeah, sorry.

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

usr.sbin/config/config.y
390

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.

usr.sbin/config/config.y
390

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

usr.sbin/config/config.y
390

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

manu marked 2 inline comments as done.
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.