platform/surface: aggregator: fix a bit test
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 20 Apr 2021 08:44:02 +0000 (11:44 +0300)
committerHans de Goede <hdegoede@redhat.com>
Tue, 20 Apr 2021 15:28:42 +0000 (17:28 +0200)
The "funcs" variable is a u64.  If "func" is more than 31 then the
BIT() shift will wrap instead of testing the high bits.

Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/YH6UUhJhGk3mk13b@mwanda
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/aggregator/controller.c

index 00e38284885a627c91e9fd9551913517e01cfa24..69e86cd599d38dce783d91b061ab5d3d6dbdf10b 100644 (file)
@@ -1040,7 +1040,7 @@ static int ssam_dsm_load_u32(acpi_handle handle, u64 funcs, u64 func, u32 *ret)
        union acpi_object *obj;
        u64 val;
 
-       if (!(funcs & BIT(func)))
+       if (!(funcs & BIT_ULL(func)))
                return 0; /* Not supported, leave *ret at its default value */
 
        obj = acpi_evaluate_dsm_typed(handle, &SSAM_SSH_DSM_GUID,