Bug 50431 - drivers/gpu/drm/radeon/atombios_encoders.c:1628: possible bad if test
Summary: drivers/gpu/drm/radeon/atombios_encoders.c:1628: possible bad if test
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 21:35 UTC by David Binderman
Modified: 2012-11-19 13:38 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.7-rc5
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Binderman 2012-11-12 21:35:04 UTC
The source code is

            if ((rdev->family != CHIP_RV710) || (rdev->family != CHIP_RV730))
                atombios_dig_transmitter_setup(encoder,
ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);

Maybe the programmer intended

            if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730))
                atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);

Here is compiler flag -Wlogical-op finding the problem

drivers/gpu/drm/radeon/atombios_encoders.c:1628:4: warning: logical ‘or’ of coll
ectively exhaustive tests is always true [-Wlogical-op]
Comment 1 Alex Deucher 2012-11-14 14:13:53 UTC
Good catch.  Thanks!  Patch queued.
Comment 2 Florian Mickler 2012-11-17 20:13:15 UTC
A patch referencing this bug report has been merged in Linux v3.7-rc6:

commit b9196395c905edec512dfd6690428084228c16ec
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Nov 14 09:10:39 2012 -0500

    drm/radeon: fix logic error in atombios_encoders.c

Note You need to log in before you can comment on or make changes to this bug.