Age | Commit message (Collapse) | Author | Files | Lines |
|
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 1334 file(s).
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Allison Randal <[email protected]>
Reviewed-by: Richard Fontana <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
In preparation for adding WMI support to MODULE_DEVICE_TABLE() move the
definition of struct wmi_device_id to mod_devicetable.h and inline
guid_string in the struct.
Changing guid_string to an inline char array changes the loop conditions
when looping over an array of struct wmi_device_id. Therefore update
wmi_dev_match()'s loop to check for an empty guid_string instead of a
NULL pointer.
Signed-off-by: Mattias Jacobsson <[email protected]>
[dvhart: Move UUID_STRING_LEN define to this patch]
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
In the function wmi_dev_match() the variable id is dereferenced without
first performing a NULL check. The variable can for example be NULL if
a WMI driver is registered without specifying the id_table field in
struct wmi_driver.
Add a NULL check and return that the driver can't handle the device if
the variable is NULL.
Fixes: 844af950da94 ("platform/x86: wmi: Turn WMI into a bus driver")
Signed-off-by: Mattias Jacobsson <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
The only usage of device_type structure is getting stored as
a reference in the type field of device structure. This type
field is declared const. Therefore, the device_type structure
can never be modified and can be declared as const.
Signed-off-by: Bhumika Goyal <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
|
|
The probe handler_data was being allocated with __get_free_pages()
for no reason I could find. The error path was using kfree(). Since
other things are happily using kmalloc() in the probe path, switch to
kmalloc() entirely. This fixes the error path mismatch and will avoid
issues with CONFIG_HARDENED_USERCOPY_PAGESPAN=y.
Reported-by: Mihai Donțu <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Acked-by: Mario Limonciello <[email protected]>
Cc: [email protected]
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
%pULL doesn't officially exist but %pUL does.
Miscellanea:
o Add missing newlines to a couple logging messages
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
In all cases list_for_each() followed by list_entry(),
so, replace them by list_for_each_entry() macro.
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Darren Hart (VMware) <[email protected]>
|
|
kasprintf() does the job of two: kmalloc() and sprintf().
Replace two calls with one.
Reviewed-by: Darren Hart (VMware) <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
|
|
wmi_dev_probe() allocates one byte less than necessary, thus
subsequent sprintf() call writes trailing zero past the end
of the 'buf':
BUG: KASAN: slab-out-of-bounds in vsnprintf+0xda4/0x1240
Write of size 1 at addr ffff880423529caf by task kworker/1:1/32
Call Trace:
dump_stack+0xb3/0x14d
print_address_description+0xd7/0x380
kasan_report+0x166/0x2b0
vsnprintf+0xda4/0x1240
sprintf+0x9b/0xd0
wmi_dev_probe+0x1c3/0x400
driver_probe_device+0x5d1/0x990
bus_for_each_drv+0x109/0x190
__device_attach+0x217/0x360
bus_probe_device+0x1ad/0x260
deferred_probe_work_func+0x10f/0x5d0
process_one_work+0xa8b/0x1dc0
worker_thread+0x20d/0x17d0
kthread+0x311/0x3d0
ret_from_fork+0x3a/0x50
Allocated by task 32:
kasan_kmalloc+0xa0/0xd0
__kmalloc+0x14f/0x3e0
wmi_dev_probe+0x182/0x400
driver_probe_device+0x5d1/0x990
bus_for_each_drv+0x109/0x190
__device_attach+0x217/0x360
bus_probe_device+0x1ad/0x260
deferred_probe_work_func+0x10f/0x5d0
process_one_work+0xa8b/0x1dc0
worker_thread+0x20d/0x17d0
kthread+0x311/0x3d0
ret_from_fork+0x3a/0x50
Increment allocation size to fix this.
Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers")
Signed-off-by: Andrey Ryabinin <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
|
|
Calling acpi_wmi_init() at the subsys_initcall() level causes ordering
issues to appear on some systems and they are difficult to reproduce,
because there is no guaranteed ordering between subsys_initcall()
calls, so they may occur in different orders on different systems.
In particular, commit 86d9f48534e8 (mm/slab: fix kmemcg cache
creation delayed issue) exposed one of these issues where genl_init()
and acpi_wmi_init() are both called at the same initcall level, but
the former must run before the latter so as to avoid a NULL pointer
dereference.
For this reason, move the acpi_wmi_init() invocation to the
initcall_sync level which should still be early enough for things
to work correctly in the WMI land.
Link: https://marc.info/?t=151274596700002&r=1&w=2
Reported-by: Jonathan McDowell <[email protected]>
Reported-by: Joonsoo Kim <[email protected]>
Tested-by: Jonathan McDowell <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
This failure mode should have also released the mutex.
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
For WMI operations that are only Set or Query readable and writable sysfs
attributes created by WMI vendor drivers or the bus driver makes sense.
For other WMI operations that are run on Method, there needs to be a
way to guarantee to userspace that the results from the method call
belong to the data request to the method call. Sysfs attributes don't
work well in this scenario because two userspace processes may be
competing at reading/writing an attribute and step on each other's
data.
When a WMI vendor driver declares a callback method in the wmi_driver
the WMI bus driver will create a character device that maps to that
function. This callback method will be responsible for filtering
invalid requests and performing the actual call.
That character device will correspond to this path:
/dev/wmi/$driver
Performing read() on this character device will provide the size
of the buffer that the character device needs to perform calls.
This buffer size can be set by vendor drivers through a new symbol
or when MOF parsing is available by the MOF.
Performing ioctl() on this character device will be interpretd
by the WMI bus driver. It will perform sanity tests for size of
data, test them for a valid instance, copy the data from userspace
and pass iton to the vendor driver to further process and run.
This creates an implicit policy that each driver will only be allowed
a single character device. If a module matches multiple GUID's,
the wmi_devices will need to be all handled by the same wmi_driver.
The WMI vendor drivers will be responsible for managing inappropriate
access to this character device and proper locking on data used by
it.
When a WMI vendor driver is unloaded the WMI bus driver will clean
up the character device and any memory allocated for the call.
Signed-off-by: Mario Limonciello <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
The only driver using this was dell-wmi, and it really was a hack.
The driver was getting a data attribute from another driver and this
type of action should not be encouraged.
Rather drivers that need to interact with one another should pass
data back and forth via exported functions.
Signed-off-by: Mario Limonciello <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Reviewed-by: Pali Rohár <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
Drivers properly using the wmibus can pass their wmi_device
pointer rather than the GUID back to the WMI bus to evaluate
the proper methods.
Any "new" drivers added that use the WMI bus should use this
rather than the old wmi_evaluate_method that would take the
GUID.
Signed-off-by: Mario Limonciello <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Reviewed-by: Pali Rohár <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
device_create documentation says to cleanup using device_destroy
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
The initialize routine is:
* class -> bus -> platform
The exit routine is:
* platform -> class -> bus
Fix the exit routine to be:
* platform -> bus -> class
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
The include list is randomly assembled right now. Sort in alphabetical
order.
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
instance_count defines number of instances of data block and instance
itself is indexed from zero, which means first instance has number 0.
Therefore check for invalid instance should be non-strict inequality.
Signed-off-by: Pali Rohár <[email protected]>
Reviewed-by: Darren Hart (VMware) <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
|
|
The order of resource deallocations is messed up in acpi_wmi_init().
It should be vice versa.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
object_id and notify_id are in one union structure and their meaning is
defined by flags. Therefore do not print notify_id for non-event block and
do not print object_id for event block. Remove also reserved member as it
does not have any defined meaning or type yet.
As object_id and notify_id union members overlaps and have different types,
it caused that kernel print to dmesg binary data. This patch eliminates it.
Signed-off-by: Pali Rohár <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
Add copyright statements for Andy Lutomirski and Darren Hart (VMware)
for their contributions to the WMI bus infrastructure and the creation
of the wmi-bmof driver.
Signed-off-by: Darren Hart (VMware) <[email protected]>
Cc: Andy Lutomirski <[email protected]>
|
|
The Microsoft WMI documentation requires all data blocks to implement
the Query Control Method (WQxx). If we encounter a data block not
implementing this control method, issue a warning, and ignore the data
block. Remove the "readable" attribute as all data blocks must be
readable (query-able).
Be consistent with the language in the documentation, replace the
"writable" attribute with "setable".
Simplify (flatten) the control flow of wmi_create_device a bit while
we are updating it for the above changes.
Signed-off-by: Darren Hart (VMware) <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
|
|
Some subdrivers need to access sibling devices. This gives them a
clean way to do so.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
We already have the PNP glue to instantiate platform devices for the
ACPI devices that WMI drives. WMI should therefore attach to the
platform device, not the ACPI node.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
wmi_query_block is unnecessarily indirect. Add a straightforward
method for wmi bus drivers to use to read block data.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
As a platform driver, acpi_driver.notify will not be available,
so use acpi_install_notify_handler as we will be converting to a
platform driver.
This gives event drivers a simple way to handle events. It
also seems closer to what the Windows docs suggest that Windows
does: it sounds like, in Windows, the mapper is responsible for
called _WED before dispatching to the subdriver.
Signed-off-by: Andy Lutomirski <[email protected]>
[dvhart: merge two development commits and update commit message]
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
At some point, we will want sub-drivers to get references to other
devices on the same WMI bus. This change is needed to avoid races.
This ends up simplifying the setup code and fixing some leaks, too.
This is based on the original work of Andy Lutomirski <[email protected]>,
but includes several modifications, many in response to review from
Michał Kępień <[email protected]>:
https://www.spinics.net/lists/platform-driver-x86/msg08201.html
Signed-off-by: Darren Hart (VMware) <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
|
|
The Dell XPS 13 9350 has one RW data object, one RO data object, and one
totally inaccessible data object. Check for the existence of the
accessor methods and report in sysfs.
The docs also permit WQxx getters for single-instance objects to
take no parameters. Probe for that as well to avoid ACPICA warnings
about mismatched signatures.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
Divide the "data", "method" and "event" types. All devices get
"instance_count" and "expensive" attributes, data and method devices get
"object_id" attributes, and event devices get "notify_id" attributes.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
We have two memory leaks. If guid_already_parsed returned true, we leak
the wmi_block. If wmi_create_device failed, we leak the device.
Simplify the logic and fix both of them.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
WMI is logically a bus: the WMI driver binds to an ACPI node (or
more than one), and each instance of the WMI driver enumerates its
children and hopes that drivers will attach to the children that are
useful.
This patch gives WMI a driver model bus type and the ability to
match to drivers. The bus itself is a device in the new "wmi_bus"
class, and all of the individual WMI devices are slotted into the
device hierarchy correctly.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
Currently we free all devices when we detach from any ACPI node.
Instead, keep track of which node WMI devices are attached to and
free them only as needed. While we are at it, match up notifications
with the device they came from correctly.
This will make our behavior more straightforward on systems with
more than one WMI node in the ACPI tables (e.g. the Dell XPS 13
9350).
This also adds a warning when GUIDs are not unique.
NB: The guid_string parameter in guid_already_parsed was a
little-endian binary GUID, not a string.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
Rearrange acpi_wmi_add to use Linux's error handling conventions.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
We will need the device to convert to a bus architecture and bind WMI to
the platform device.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
WMI is just a driver. There is no need to announce when it is loaded.
Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
|
|
Instead of opencoding let's use generic UUID library functions here.
Signed-off-by: Andy Shevchenko <[email protected]>
Cc: Darren Hart <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The work performed by wmi_gtoa is equivalent to simply sprintf(out,
"%pUL", in), so one could replace its body by this. However, most
users feed the result directly as a %s argument to some other function
which also understands the %p extensions (they all ultimately use
vsnprintf), so we can eliminate some stack buffers and quite a bit of
code by just using %pUL directly.
In wmi_dev_uevent I'm not sure whether there's room for a
nul-terminator in env->buf, so I've just replaced wmi_gtoa with the
equivalent sprintf call.
Signed-off-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Darren Hart <[email protected]>
|
|
Use the normal return values for bool functions
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Darren Hart <[email protected]>
|
|
In commit bff431e49ff531a343fbb2b4426e313000844f32 ("ACPI: WMI: Add
ACPI-WMI mapping driver") this mutex was added, but the rest of the
final commit never actually made use of it, resulting in:
In file included from include/linux/mutex.h:29:0,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from drivers/platform/x86/wmi.c:35:
drivers/platform/x86/wmi.c:48:21: warning: ‘wmi_data_lock’ defined but not used [-Wunused-variable]
static DEFINE_MUTEX(wmi_data_lock);
^
A git grep shows no other instances/references to the wmi_data_lock.
Delete it, assuming that the mutex addition was just a leftover from
an earlier work in progress version of the change, since the original
dates from 2008.
Signed-off-by: Paul Gortmaker <[email protected]>
Signed-off-by: Darren Hart <[email protected]>
|
|
This patch removes the null test on block. block is initialized at the
beginning of the function to &wblock->gblock. Since wblock is
dereferenced prior to the null test, wblock must be a valid pointer,
and &wblock->gblock cannot be null.
The following Coccinelle script is used for detecting the change:
@r@
expression e,f;
identifier g,y;
statement S1,S2;
@@
*e = &f->g
<+...
f->y
...+>
*if (e != NULL || ...)
S1 else S2
Signed-off-by: Himangi Saraogi <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
* acpi-cleanup: (22 commits)
ACPI / tables: Return proper error codes from acpi_table_parse() and fix comment.
ACPI / tables: Check if id is NULL in acpi_table_parse()
ACPI / proc: Include appropriate header file in proc.c
ACPI / EC: Remove unused functions and add prototype declaration in internal.h
ACPI / dock: Include appropriate header file in dock.c
ACPI / PCI: Include appropriate header file in pci_link.c
ACPI / PCI: Include appropriate header file in pci_slot.c
ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c
ACPI / NVS: Include appropriate header file in nvs.c
ACPI / OSL: Mark the function acpi_table_checksum() as static
ACPI / processor: initialize a variable to silence compiler warning
ACPI / processor: use ACPI_COMPANION() to get ACPI device
ACPI: correct minor typos
ACPI / sleep: Drop redundant acpi_disabled check
ACPI / dock: Drop redundant acpi_disabled check
ACPI / table: Replace '1' with specific error return values
ACPI: remove trailing whitespace
ACPI / IBFT: Fix incorrect <acpi/acpi.h> inclusion in iSCSI boot firmware module
ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h>
SFI / ACPI: Fix warnings reported during builds with W=1
...
Conflicts:
drivers/acpi/nvs.c
drivers/hwmon/asus_atk0110.c
|
|
Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
<acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
inclusions and remove some inclusions of those files that aren't
necessary.
First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
should not be included directly from any files that are built for
CONFIG_ACPI unset, because that generally leads to build warnings about
undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
<linux/acpi.h> includes those files and for CONFIG_ACPI unset it
provides stub ACPI symbols to be used in that case.
Second, there are ordering dependencies between those files that always
have to be met. Namely, it is required that <acpi/acpi_bus.h> be included
prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
latter depends on are always there. And <acpi/acpi.h> which provides
basic ACPICA type declarations should always be included prior to any other
ACPI headers in CONFIG_ACPI builds. That also is taken care of including
<linux/acpi.h> as appropriate.
Signed-off-by: Lv Zheng <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]> (drivers/pci stuff)
Acked-by: Konrad Rzeszutek Wilk <[email protected]> (Xen stuff)
Signed-off-by: Rafael J. Wysocki <[email protected]>
|
|
I just fixed this same bug in arch/powerpc/kernel/vio.c and took a quick
look for other similar errors in the kernel.
modalias_show() should return an empty string on error, not errno.
Signed-off-by: Prarit Bhargava <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
acpi_has_method() is a new ACPI API introduced to check
the existence of an ACPI control method.
It can be used to replace acpi_get_handle() in the case that
1. the calling function doesn't need the ACPI handle of the control method.
and
2. the calling function doesn't care the reason why the method is unavailable.
Convert acpi_get_handle() to acpi_has_method()
in drivers/platform/x86/wmi.c in this patch.
Signed-off-by: Zhang Rui <[email protected]>
CC: Matthew Garrett <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
|
|
acpi_execute_simple_method() is a new ACPI API introduced to invoke
an ACPI control method that has single integer parameter and no return value.
Convert acpi_evaluate_object() to acpi_execute_simple_method()
in drivers/platform/x86/wmi.c
Signed-off-by: Zhang Rui <[email protected]>
CC: Matthew Garrett <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
|
|
The current code returns a mix of acpi_status and kernel error codes.
It should just return kernel error codes. There are already error paths
in this function which return -ENOMEM and that's what the caller
expects.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
|
|
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the wmi class code to use the
correct field.
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Calling dev_set_name with a single paramter causes it to be handled as a
format string. Many callers are passing potentially dynamic string
content, so use "%s" in those cases to avoid any potential accidents,
including wrappers like device_create*() and bdi_register().
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The second argument of ACPI driver .remove() operation is only used
by the ACPI processor driver and the value passed to that driver
through it is always available from the given struct acpi_device
object's removal_type field. For this reason, the second ACPI driver
.remove() argument is in fact useless, so drop it.
Signed-off-by: Rafael J. Wysocki <[email protected]>
Reviewed-by: Jiang Liu <[email protected]>
Acked-by: Toshi Kani <[email protected]>
Acked-by: Yinghai Lu <[email protected]>
|
|
module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.
It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.
Acked-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
|