Simplify the ppfeature mask calculations.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
                return ret;
 
        features_to_disable =
-               (features_enabled ^ new_ppfeature_masks) & features_enabled;
+               features_enabled & ~new_ppfeature_masks;
        features_to_enable =
-               (features_enabled ^ new_ppfeature_masks) ^ features_to_disable;
+               ~features_enabled & new_ppfeature_masks;
 
        pr_debug("features_to_disable 0x%llx\n", features_to_disable);
        pr_debug("features_to_enable 0x%llx\n", features_to_enable);
 
                return ret;
 
        features_to_disable =
-               (features_enabled ^ new_ppfeature_masks) & features_enabled;
+               features_enabled & ~new_ppfeature_masks;
        features_to_enable =
-               (features_enabled ^ new_ppfeature_masks) ^ features_to_disable;
+               ~features_enabled & new_ppfeature_masks;
 
        pr_debug("features_to_disable 0x%llx\n", features_to_disable);
        pr_debug("features_to_enable 0x%llx\n", features_to_enable);
 
                return ret;
 
        features_to_disable =
-               (features_enabled ^ new_ppfeature_masks) & features_enabled;
+               features_enabled & ~new_ppfeature_masks;
        features_to_enable =
-               (features_enabled ^ new_ppfeature_masks) ^ features_to_disable;
+               ~features_enabled & new_ppfeature_masks;
 
        pr_debug("features_to_disable 0x%llx\n", features_to_disable);
        pr_debug("features_to_enable 0x%llx\n", features_to_enable);