-
Notifications
You must be signed in to change notification settings - Fork 321
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
Removing unused variables #223
base: 5.8.7.1_35809.20191129_COEX20191120-7777
Are you sure you want to change the base?
Removing unused variables #223
Conversation
Sweep across default build to purge variables marked as unused. This is incomplete and there are more items which need guarding off, for example there are variables which are only used by debug print macros that do nothing by default.
There are variables which are only used by debug print macros when debugging is enabled. Guard them off with CONFIG_RTW_DEBUG to keep the compiler happy about unused variables.
while here zap some unused variable declarations.
Thank you for your contribution, I appreciate it very much. I too think that the source code is in a shape that requires some clean-ups. I have tried to make only the most necessary adjustments to avoid merge conflicts. However, with RTW88-USB raising, I do not think that a new revision of RTL88x2BU will appear, so fixing the issues that annoy us might be a good thing. If we go this route, some other adaptions come to my mind too. For instance, I would get rid of the support for other operating systems (e.g. Thus, before I give your version a try and merge it if it runs for me, I would like to have the agreement of another collaborator here. @cilynx , @CGarces , what would you say? |
Cleanup a RTL driver is a lot of work. As reference you can see the evolution of rtl8723bs to land in the linux kernel as staging driver. Tools like unifdef or coccinelle maybe can help you to made the work faster. I tryed to clean up rtl8189fs to maybe reach the staging area of Linux kernel but after 60+ commits I lost interest. If RTW88-USB adds support to rtl88x2bu chipset, maybe is a better idea to contribute directly to the Linux kernel. |
BTW the PR looks fine for me, but should include Makefile change to remove |
This change is incomplete for removing I'll take a look at the upstream process / cleanup in the repos you pointed to @CGarces. |
@MaxG87 do you want to merge this? |
Locally I have managed to reach building the driver without
-Wno-unused-variable
and just having-Werror
turned on to catch all the unused variables which gcc flagged up.There is a combination of stuff that's just not referenced and can be deleted, stuff that's reliant on
CONFIG_RTW_DEBUG
for macros to work which reference the variables, and things that need guarding off for specific configuration definition.This pull request starts off covering these cases. locally there are changes that are bodges just to skip over things but as I said, I do have the driver building and working without
-Wno-unused-variable
and just having-Werror
, the build is silent.