Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

Make the driver ready for linux upstream#6

Open
c0d3z3r0 wants to merge 4 commits into
iksaif:masterfrom
c0d3z3r0:for-upstream/simplify
Open

Make the driver ready for linux upstream#6
c0d3z3r0 wants to merge 4 commits into
iksaif:masterfrom
c0d3z3r0:for-upstream/simplify

Conversation

@c0d3z3r0

@c0d3z3r0 c0d3z3r0 commented Feb 5, 2018

Copy link
Copy Markdown
Contributor

more will follow:

  • more simplifications of the driver
  • replace deprecated stuff
  • incorporate changes requested/suggested on linux mailing list
  • ... (let's see)

Comment thread drivers/platform/x86/thinkpad-wmi.c Outdated
ret = -ENOMEM;
}

/* value not assigned => wmi call with return value (e.g. change settings) */

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this is cleaner in a separate function

@c0d3z3r0 c0d3z3r0 Feb 6, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That point is open to dispute; Personally I like this better because it removes redundant code... let's see what it looks like at the end when everything else is finished

Comment thread drivers/platform/x86/thinkpad-wmi.c Outdated
ret = -EIO;

/* value assigned -> wmi call returning output */
else if(value) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add braces if you have empty lines (see scripts/checkpatch.pl to automatically lint the code)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, working on this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread drivers/platform/x86/thinkpad-wmi.c Outdated
return -EIO;

return thinkpad_wmi_extract_output_string(&output, value);
obj = output.pointer;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it was better in smaller functions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment before

Comment thread drivers/platform/x86/thinkpad-wmi.c Outdated
{
return thinkpad_wmi_simple_call(LENOVO_SET_BIOS_SETTINGS_GUID,
settings);
return thinkpad_wmi_call(LENOVO_SET_BIOS_SETTINGS_GUID, settings, NULL);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like thinkpad_wmi_simple_call() better than having to specify NULL all the time

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@c0d3z3r0 c0d3z3r0 changed the title Simplify wmi calls Make the driver ready for linux mainline Feb 6, 2018
@c0d3z3r0 c0d3z3r0 changed the title Make the driver ready for linux mainline Make the driver ready for linux upstream Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants