Re: [RFC] File naming conventions in /drivers/subsystem folders


Tseng, Kuo-Lang <kuo-lang.tseng@...>
 

Hi Javier,

From: Perez Hernandez, Javier B

Hi!

On Thu, 2016-06-30 at 00:49 +0000, Tseng, Kuo-Lang wrote:
Hi,

Problem
*******
The current file naming of most files in /drivers/subsystem folders
starts with 'subsystem_something.[hc]'. The prefix part 'subsystem_'
can seem to be redundant as the subfolder where the file is located
already namespaces it.

e.g.
drivers/adc/adc_dw.[ch]

Proposed changes
***************
Remove the prefix 'subsystem_' from the filename. For example, some
current
naming:

drivers/adc/adc_dw.[ch]
drivers/adc/adc_qmsi.c
drivers/spi/spi_k64.c
drivers/spi/spi_dw.c
drivers/spi/spi_qmsi.c
...

would become:

drivers/adc/dw.[ch]
drivers/adc/qmsi.c
drivers/spi/k64.c
drivers/spi/dw.c
drivers/spi/qmsi.c
Sounds good to me, just some questions/suggestions.
sensor is like
drivers/sensor/Kconfig.bma280
drivers/sensor/sensor_bma280.c
drivers/sensor/sensor_bma280_trigger.c
...

and would look like:
drivers/sensor/Kconfig.bma280
drivers/sensor/bma280.c
drivers/sensor/bma280_trigger.c
That's right.


what about the Kconfig files? are they going to keep the same name?
Current proposal does not include Kconfig files.

can we change the name to sensor.Kconfig? like bma280.Kconfig instead of current
name.
Any benefit from the proposed name for Kconfig files vs. current names?


maybe for sensor we can even have a directory per each sensor, seems like we
already have a bunch of sensor code. what do you think?
Like drivers/sensors/bmc280/bmc280.[ch]? Yes, that can be an option.


Javier B. Perez


One side effect would be that now you would end up having files with
same filenames from different folder (e.g. qmsi.c). This may not be an
issue if each resides in their own folder.

Comments/concerns welcome.

Thanks,
Kuo, Inaky

Join devel@lists.zephyrproject.org to automatically receive all group messages.