drm/amdgpu: precedence bug in amdgpu_device_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 18 Jun 2016 08:38:44 +0000 (11:38 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 20 Jun 2016 21:06:10 +0000 (17:06 -0400)
! has higher precedence than bitwise & so we need to add parenthesis
for this to work as intended.

Fixes: 048765ad5af7 ('amdgpu: fix asic initialization for virtualized environments (v2)')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 66482b4294582423d6e7d111fbddb63a9cb71d5d..6e920086af468c4428be208007fefcfb1dfd3f0d 100644 (file)
@@ -1535,7 +1535,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        /* Post card if necessary */
        if (!amdgpu_card_posted(adev) ||
            (adev->virtualization.is_virtual &&
-            !adev->virtualization.caps & AMDGPU_VIRT_CAPS_SRIOV_EN)) {
+            !(adev->virtualization.caps & AMDGPU_VIRT_CAPS_SRIOV_EN))) {
                if (!adev->bios) {
                        dev_err(adev->dev, "Card not posted and no BIOS - ignoring\n");
                        return -EINVAL;