Bjorn Helgaas wrote: > On Thu, Jan 04, 2024 at 01:46:56PM -0800, Ira Weiny wrote: > > Dan Williams wrote: > > > Bjorn Helgaas wrote: [snip] > > > > Also in this case we need devfn assigned first. > > > > Is the above patch compliant with current style guidelines? > > > > Or would it be better to do? > > > > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > > index b14237f824cf..8a180c6abb67 100644 > > --- a/drivers/cxl/pci.c > > +++ b/drivers/cxl/pci.c > > @@ -975,15 +975,14 @@ static void cxl_cper_event_call(enum cxl_event_type ev_type, > > struct cxl_cper_event_rec *rec) > > { > > struct cper_cxl_event_devid *device_id = &rec->hdr.device_id; > > - struct pci_dev *pdev __free(pci_dev_put) = NULL; > > enum cxl_event_log_type log_type; > > struct cxl_dev_state *cxlds; > > - unsigned int devfn; > > + unsigned int devfn = PCI_DEVFN(device_id->device_num, device_id->func_num); > > + struct pci_dev *pdev __free(pci_dev_put) = pci_get_domain_bus_and_slot( > > + device_id->segment_num, > > + device_id->bus_num, devfn); > > I don't really care about this specific instance; my comment was more > about the commit log for the "Define scope based management functions" > patch, thinking maybe the example could encourage get/put togetherness > when it's practical. Ok thanks! Ira