Project

General

Profile

Actions

Bug #3011

open

dragonfly/sys/dev/netif/re/re.c: suspicious code ?

Added by dcb almost 7 years ago. Updated about 1 year ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
Driver
Target version:
Start date:
04/04/2017
Due date:
% Done:

0%

Estimated time:

Description

dragonfly/sys/dev/netif/re/re.c:6567] -> [dragonfly/sys/dev/netif/re/re.c:6567]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:21948] -> [dragonfly/sys/dev/netif/re/re.c:21948]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:21949] -> [dragonfly/sys/dev/netif/re/re.c:21949]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:22044] -> [dragonfly/sys/dev/netif/re/re.c:22044]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:22104] -> [dragonfly/sys/dev/netif/re/re.c:22104]: (style) Same expression on both sides of '||'.

Taking the first one as an example:

if ((sc->re_type  MACFG_24) || (sc->re_type  MACFG_24) || (sc->re_type == MACFG_26))

MACFG_25 exists. Possible cut'n'paste error ?

Actions #1

Updated by sepherosa almost 7 years ago

Note, this is directly imported vendor code, used by chip
initialization. Since these chips contains all kinds of weird things,
I'd not change it, if possible.

On Tue, Apr 4, 2017 at 4:19 PM, <> wrote:

Issue #3011 has been reported by dcb.

----------------------------------------
Bug #3011: dragonfly/sys/dev/netif/re/re.c: suspicious code ?
http://bugs.dragonflybsd.org/issues/3011

  • Author: dcb
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
    ----------------------------------------

dragonfly/sys/dev/netif/re/re.c:6567] -> [dragonfly/sys/dev/netif/re/re.c:6567]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:21948] -> [dragonfly/sys/dev/netif/re/re.c:21948]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:21949] -> [dragonfly/sys/dev/netif/re/re.c:21949]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:22044] -> [dragonfly/sys/dev/netif/re/re.c:22044]: (style) Same expression on both sides of '||'.
[dragonfly/sys/dev/netif/re/re.c:22104] -> [dragonfly/sys/dev/netif/re/re.c:22104]: (style) Same expression on both sides of '||'.

Taking the first one as an example:

if ((sc->re_type MACFG_24) || (sc->re_type MACFG_24) || (sc->re_type == MACFG_26))

MACFG_25 exists. Possible cut'n'paste error ?

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

--
Tomorrow Will Never Die

Actions #2

Updated by swildner over 6 years ago

  • Status changed from New to In Progress

Yes,

it could be a typo, and MACFG_25 is intended, it could as well be a sloppy intentional last minute "fix" and the intention is to exclude MACFG_25 from the if(). My bet is typo, though.

I mailed Realtek about it. Let's see if they get back to me.

Actions #3

Updated by daftaupe about 1 year ago

  • Category set to Driver

I haven't looked exactly when this was fixed, but these redundant expressions are not present anymore in re.c in current version of the driver.

This can be closed I guess (I have no right to do this).

Actions

Also available in: Atom PDF