SDL: Removed redundant masking when loading the IMU calibration

From e8fdb861ef39a35094f07ad4b81245f5933bd7a7 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 15 Oct 2022 10:02:39 -0700
Subject: [PATCH] Removed redundant masking when loading the IMU calibration

---
 src/joystick/hidapi/SDL_hidapi_switch.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index e4df02a41a39..901761fac679 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -821,13 +821,13 @@ static SDL_bool LoadIMUCalibration(SDL_DriverSwitch_Context* ctx)
     /* IMU scale gives us multipliers for converting raw values to real world values */
     pIMUScale = reply->spiReadData.rgucReadData;
 
-    sAccelRawX = ((pIMUScale[1] << 8) & 0xFF00) | pIMUScale[0];
-    sAccelRawY = ((pIMUScale[3] << 8) & 0xFF00) | pIMUScale[2];
-    sAccelRawZ = ((pIMUScale[5] << 8) & 0xFF00) | pIMUScale[4];
+    sAccelRawX = (pIMUScale[1] << 8) | pIMUScale[0];
+    sAccelRawY = (pIMUScale[3] << 8) | pIMUScale[2];
+    sAccelRawZ = (pIMUScale[5] << 8) | pIMUScale[4];
 
-    sGyroRawX = ((pIMUScale[13] << 8) & 0xFF00) | pIMUScale[12];
-    sGyroRawY = ((pIMUScale[15] << 8) & 0xFF00) | pIMUScale[14];
-    sGyroRawZ = ((pIMUScale[17] << 8) & 0xFF00) | pIMUScale[16];
+    sGyroRawX = (pIMUScale[13] << 8) | pIMUScale[12];
+    sGyroRawY = (pIMUScale[15] << 8) | pIMUScale[14];
+    sGyroRawZ = (pIMUScale[17] << 8) | pIMUScale[16];
 
     /* Check for user calibration data. If it's present and set, it'll override the factory settings */
     readParams.unAddress = k_unSPIIMUUserScaleStartOffset;
@@ -835,13 +835,13 @@ static SDL_bool LoadIMUCalibration(SDL_DriverSwitch_Context* ctx)
     if (WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t*)&readParams, sizeof(readParams), &reply) && (pIMUScale[0] | pIMUScale[1] << 8) == 0xA1B2) {
         pIMUScale = reply->spiReadData.rgucReadData;
         
-        sAccelRawX = ((pIMUScale[3] << 8) & 0xFF00) | pIMUScale[2];
-        sAccelRawY = ((pIMUScale[5] << 8) & 0xFF00) | pIMUScale[4];
-        sAccelRawZ = ((pIMUScale[7] << 8) & 0xFF00) | pIMUScale[6];
+        sAccelRawX = (pIMUScale[3] << 8) | pIMUScale[2];
+        sAccelRawY = (pIMUScale[5] << 8) | pIMUScale[4];
+        sAccelRawZ = (pIMUScale[7] << 8) | pIMUScale[6];
 
-        sGyroRawX = ((pIMUScale[15] << 8) & 0xFF00) | pIMUScale[14];
-        sGyroRawY = ((pIMUScale[17] << 8) & 0xFF00) | pIMUScale[16];
-        sGyroRawZ = ((pIMUScale[19] << 8) & 0xFF00) | pIMUScale[18];
+        sGyroRawX = (pIMUScale[15] << 8) | pIMUScale[14];
+        sGyroRawY = (pIMUScale[17] << 8) | pIMUScale[16];
+        sGyroRawZ = (pIMUScale[19] << 8) | pIMUScale[18];
     }
 
     /* Accelerometer scale */