-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix signed/unsigned comparison for subsystem ID #77
base: develop
Are you sure you want to change the base?
Conversation
return bdx_dev_tbl[i].phy_type; | ||
} | ||
return 0; | ||
return PHY_TYPE_NA; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change return type of the function to enum PHY_TYPE
. (minor, doesn't hinder merge)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback. I did a commit to the same branch and it looks like that included it in the same pull request automatically. (still finding my way around git and github) Please let me know if there are other issues or comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it looks good now. Another minor code style issue is a space before the first {
in the if body.
I don't have merge rights, so we'll have to wait until someone that has, comes around.
tn40.c
Outdated
return PHY_TYPE_NA; /* NIC definition has no PHY. */ | ||
|
||
} | ||
bdx_mdio_set_speed(priv->pBdxRegs, MDIO_SPEED_1MHZ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent with a hard tab to follow the codestyle in the rest of the file. Also one more occurance below. (minor, doesn't hinder merge)
The PHY table used a signed device "subdev". My subdev is 0x8103 (MSB set) which failed the table lookup despite 0x8103 being in the table.
This changes the table type from "short" to "__u16" to make the comparison work correctly.
Tested with my Edimax EN-9320SFP+, Intel HP620 workstation, Ubuntu 24.04, kernel 6.8.0-49-generic.
I can only test bandwidth upto 1 Gbit through my switch since I only have one 10 Gbit device, but the reported link speed to the switch is 10 Gbit.
fixes #76