From: Kishon Vijay Abraham I Date: Fri, 18 Aug 2017 14:57:57 +0000 (+0530) Subject: PCI: endpoint: Add "volatile" to pci_epf_test_reg X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=09232c7acbd451c6da555ffdebad82661bf3d0be;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git PCI: endpoint: Add "volatile" to pci_epf_test_reg struct pci_epf_test_reg is the MEMSPACE of pci-epf-test function driver that will be accessed by the "host" for programming the pci-epf-test device. So this structure shouldn't be subjected to compiler optimization in pci_epf_test_cmd_handler() since the values can be changed by code outside the scope of current code at any time. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sekhar Nori Signed-off-by: Bjorn Helgaas --- diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 53fff8030337..5cbc05a0762d 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -267,7 +267,7 @@ static void pci_epf_test_cmd_handler(struct work_struct *work) cmd_handler.work); struct pci_epf *epf = epf_test->epf; struct pci_epc *epc = epf->epc; - struct pci_epf_test_reg *reg = epf_test->reg[0]; + volatile struct pci_epf_test_reg *reg = epf_test->reg[0]; if (!reg->command) goto reset_handler;