Bug 229550 - src/sys/dev/sound/macio/onyx.c:203: bad if ?
Summary: src/sys/dev/sound/macio/onyx.c:203: bad if ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-05 20:24 UTC by David Binderman
Modified: 2024-10-20 11:22 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2018-07-05 20:24:27 UTC
src/sys/dev/sound/macio/onyx.c:203]: (style) Expression is always false because 'else if' condition matches previous condition at line 200.

Source code is

       if (strcmp(name, "codec") == 0) {
                if (iicbus_get_addr(dev) != PCM3052_IICADDR)
                        return (ENXIO);
        } else if (strcmp(name, "codec") == 0) {
                compat = ofw_bus_get_compat(dev);
                if (compat == NULL || strcmp(compat, "pcm3052") != 0)
                        return (ENXIO);
Comment 1 Christos Margiolis freebsd_committer freebsd_triage 2024-10-17 14:42:17 UTC
https://reviews.freebsd.org/D47167
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-18 08:46:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6f96ef84b359137a51dc1e717887ca7d31ba7bad

commit 6f96ef84b359137a51dc1e717887ca7d31ba7bad
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2024-10-18 08:41:55 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2024-10-18 08:41:55 +0000

    onyx: Remove unreachable if condition

    Both conditions are the same, so the second one is unreachable.

    PR:             229550
    Sponsored by:   The FreeBSD Foundation
    MFC after:      2 days
    Reviewed by:    andreast, markj
    Differential Revision:  https://reviews.freebsd.org/D47167

 sys/dev/sound/macio/onyx.c | 1 -
 1 file changed, 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-10-20 11:22:50 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e609dfa98fd349ed868f2d4d16bd1994fc53875f

commit e609dfa98fd349ed868f2d4d16bd1994fc53875f
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2024-10-18 08:41:55 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2024-10-20 11:21:06 +0000

    onyx: Remove unreachable if condition

    Both conditions are the same, so the second one is unreachable.

    PR:             229550
    Sponsored by:   The FreeBSD Foundation
    MFC after:      2 days
    Reviewed by:    andreast, markj
    Differential Revision:  https://reviews.freebsd.org/D47167

    (cherry picked from commit 6f96ef84b359137a51dc1e717887ca7d31ba7bad)

 sys/dev/sound/macio/onyx.c | 1 -
 1 file changed, 1 deletion(-)