drm/radeon: remove three set but not used variable
authoryu kuai <yukuai3@huawei.com>
Thu, 26 Dec 2019 12:07:50 +0000 (20:07 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 7 Jan 2020 16:57:34 +0000 (11:57 -0500)
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/radeon/radeon_atombios.c: In function
‘radeon_get_atom_connector_info_from_object_table’:
drivers/gpu/drm/radeon/radeon_atombios.c:651:26: warning: variable
‘grph_obj_num’ set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/radeon/radeon_atombios.c:651:13: warning: variable
‘grph_obj_id’ set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/radeon/radeon_atombios.c:573:37: warning: variable
‘con_obj_type’ set but not used [-Wunused-but-set-variable]

They are never used, and so can be removed.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_atombios.c

index 072e6daedf7a685a1319f79d0404ecd7c909e5ed..848ef68d90861bbc115b7a679ede8162baff6d06 100644 (file)
@@ -570,7 +570,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
                path_size += le16_to_cpu(path->usSize);
 
                if (device_support & le16_to_cpu(path->usDeviceTag)) {
-                       uint8_t con_obj_id, con_obj_num, con_obj_type;
+                       uint8_t con_obj_id, con_obj_num;
 
                        con_obj_id =
                            (le16_to_cpu(path->usConnObjectId) & OBJECT_ID_MASK)
@@ -578,9 +578,6 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
                        con_obj_num =
                            (le16_to_cpu(path->usConnObjectId) & ENUM_ID_MASK)
                            >> ENUM_ID_SHIFT;
-                       con_obj_type =
-                           (le16_to_cpu(path->usConnObjectId) &
-                            OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
 
                        /* TODO CV support */
                        if (le16_to_cpu(path->usDeviceTag) ==
@@ -648,15 +645,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
                        router.ddc_valid = false;
                        router.cd_valid = false;
                        for (j = 0; j < ((le16_to_cpu(path->usSize) - 8) / 2); j++) {
-                               uint8_t grph_obj_id, grph_obj_num, grph_obj_type;
-
-                               grph_obj_id =
-                                   (le16_to_cpu(path->usGraphicObjIds[j]) &
-                                    OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
-                               grph_obj_num =
-                                   (le16_to_cpu(path->usGraphicObjIds[j]) &
-                                    ENUM_ID_MASK) >> ENUM_ID_SHIFT;
-                               grph_obj_type =
+                               uint8_t grph_obj_type =
                                    (le16_to_cpu(path->usGraphicObjIds[j]) &
                                     OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;