Skip to content

Commit

Permalink
[serial/VirtualSerial2] Use helper function ReadNoFence to read lineC…
Browse files Browse the repository at this point in the history
…ontrolRegister to avoid C26837 (#1257)

* Use helper function ReadNoFence() to read lineControlRegister to avoid C26837

https://learn.microsoft.com/en-us/cpp/code-quality/c26837?view=msvc-170
  • Loading branch information
AndrewYangMSFT authored Jan 22, 2025
1 parent ddccabb commit cc8c103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serial/VirtualSerial2/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ QueueProcessGetLineControl(
//
// Take a snapshot of the line control register variable
//
lineControlSnapshot = *lineControlRegister;
lineControlSnapshot = ReadNoFence((LONG *)lineControlRegister);

//
// Decode the word length
Expand Down Expand Up @@ -946,7 +946,7 @@ QueueProcessSetLineControl(
#endif
}

lineControlSnapshot = *lineControlRegister;
lineControlSnapshot = ReadNoFence((LONG *)lineControlRegister);

lineControlNew = (lineControlSnapshot & SERIAL_LCR_BREAK) |
(lineControlData | lineControlParity | lineControlStop);
Expand Down

0 comments on commit cc8c103

Please sign in to comment.