Skip to content

Commit

Permalink
PCI: endpoint: Add "volatile" to pci_epf_test_reg
Browse files Browse the repository at this point in the history
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 <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Kishon Vijay Abraham I authored and Bjorn Helgaas committed Aug 29, 2017
1 parent 52c9285 commit 09232c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/endpoint/functions/pci-epf-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 09232c7

Please sign in to comment.