Re: [PATCH v3 03/18] nitro_enclaves: Define enclave info for internal bookkeeping

From: Paraschiv, Andra-Irina
Date: Tue May 26 2020 - 13:20:59 EST




On 26/05/2020 09:46, Greg KH wrote:
On Tue, May 26, 2020 at 01:13:19AM +0300, Andra Paraschiv wrote:
+/* Nitro Enclaves (NE) misc device */
+extern struct miscdevice ne_miscdevice;
Why does your misc device need to be in a .h file?

Having the patch series like this (add random .h files, and then start
to use them), is hard to review. Would you want to try to review a
series written in this way?

The misc device is registered / unregistered while having the NE PCI device probe / remove, as a dependency to actually having a PCI device working to expose a misc device.

The way the codebase is split in files is mainly the ioctl logic / misc device in one file and the PCI device logic in another file; thus not have all the codebase in a single big file. Given the misc device (un)register logic above, the misc device needs to be available to the PCI device setup logic.

Andra




Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in Romania. Registration number J22/2621/2005.