<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hwmon/hwmon.c, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-01-02T23:05:34+00:00</updated>
<entry>
<title>hwmon: Fix parameter documentation</title>
<updated>2018-01-02T23:05:34+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2017-12-03T23:15:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3870945aeb0e94126b9ea1cbd4f2f50d99eb948d'/>
<id>urn:sha1:3870945aeb0e94126b9ea1cbd4f2f50d99eb948d</id>
<content type='text'>
sparse reports:

drivers/hwmon/hwmon.c:681: warning:
	No description found for parameter 'chip'
drivers/hwmon/hwmon.c:681: warning:
	Excess function parameter 'info' description in
	'hwmon_device_register_with_info'
drivers/hwmon/hwmon.c:789: warning:
	No description found for parameter 'chip'
drivers/hwmon/hwmon.c:789: warning:
	No description found for parameter 'groups'
drivers/hwmon/hwmon.c:789: warning:
	Excess function parameter 'info' description in
	'devm_hwmon_device_register_with_info'

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: Deal with errors from the thermal subsystem</title>
<updated>2017-12-26T19:53:24+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2017-12-05T08:36:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47c332deb8e89f6c59b0bb2615945c6e7fad1a60'/>
<id>urn:sha1:47c332deb8e89f6c59b0bb2615945c6e7fad1a60</id>
<content type='text'>
If the thermal subsystem returne -EPROBE_DEFER or any other error
when hwmon calls devm_thermal_zone_of_sensor_register(), this is
silently ignored.

I ran into this with an incorrectly defined thermal zone, making
it non-existing and thus this call failed with -EPROBE_DEFER
assuming it would appear later. The sensor was still added
which is incorrect: sensors must strictly be added after the
thermal zones, so deferred probe must be respected.

Fixes: d560168b5d0f ("hwmon: (core) New hwmon registration API")
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (core) constify thermal_zone_of_device_ops structures</title>
<updated>2017-08-13T15:24:38+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2017-08-08T15:09:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c9920650c7707ffb974ae1ee06cea2682c2ea90f'/>
<id>urn:sha1:c9920650c7707ffb974ae1ee06cea2682c2ea90f</id>
<content type='text'>
The thermal_zone_of_device_ops structure is only passed as the fourth
argument to devm_thermal_zone_of_sensor_register, which is declared
as const.  Thus the thermal_zone_of_device_ops structure itself can
be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: constify attribute_group structures.</title>
<updated>2017-08-13T15:24:38+00:00</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2017-07-05T05:01:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=524703ac1af4d6d79c37aafa99cdb6c293d62b7b'/>
<id>urn:sha1:524703ac1af4d6d79c37aafa99cdb6c293d62b7b</id>
<content type='text'>
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by &lt;linux/sysfs.h&gt; work with const
attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   6655	    304	      0	   6959	   1b2f	drivers/hwmon/hwmon.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   6703	    240	      0	   6943	   1b1f	drivers/hwmon/hwmon.o

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: Constify str parameter of hwmon_ops-&gt;read_string</title>
<updated>2017-04-02T14:01:53+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2017-03-07T14:15:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ba6bcbc335771c37d05b88cbfcad5441b57130b'/>
<id>urn:sha1:5ba6bcbc335771c37d05b88cbfcad5441b57130b</id>
<content type='text'>
The read_string callback is supposed to retrieve a pointer to a
constant string.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: Register thermal zone only if 'dev' parameter was provided</title>
<updated>2017-01-31T11:56:08+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2017-01-31T11:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=319fe159889a06b47a2621a1201c813502b7a842'/>
<id>urn:sha1:319fe159889a06b47a2621a1201c813502b7a842</id>
<content type='text'>
Rgistering a thermal zone uses devm_kzalloc(), which requires
a pointer to the parent device.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: Relax name attribute validation for new APIs</title>
<updated>2017-01-31T11:52:15+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2017-01-28T03:35:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=74d3b6419772e49563877b9a3c502b763d24b075'/>
<id>urn:sha1:74d3b6419772e49563877b9a3c502b763d24b075</id>
<content type='text'>
While invalid name attributes are really not desirable and do mess up
libsensors, enforcing valid names has the detrimental effect of driving
users away from using the new hardware monitoring API, especially those
registering name attributes violating the ABI restrictions. Another
undesirable side effect is that this violation and the resulting error
may only be discovered some time after a conversion to the new API,
which in turn may trigger a revert of that conversion.

To solve the problem, relax validation and only issue a warning instead
of returning an error if a name attribute violating the ABI is provided.
This lets callers continue to provide invalid name attributes while
notifying them about it.

Many thanks are due to Dmitry Torokhov for the idea.

Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: Make name attribute mandatory for new APIs</title>
<updated>2017-01-25T14:14:26+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2017-01-24T14:32:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8353863a52a82c7701d9d10433bea703fd24ec2d'/>
<id>urn:sha1:8353863a52a82c7701d9d10433bea703fd24ec2d</id>
<content type='text'>
It does not make sense to use one of the the new APIs when not
even providing a name attribute. Make it mandatory.

Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (core) use permission-specific DEVICE_ATTR variants</title>
<updated>2017-01-02T18:19:45+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2016-12-22T12:04:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2ab0c6c55e6d2525282e7e3e2f62032847834342'/>
<id>urn:sha1:2ab0c6c55e6d2525282e7e3e2f62032847834342</id>
<content type='text'>
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source
code, improves readbility, and reduces the chance of inconsistencies.

The conversion was done automatically using coccinelle. It was validated
by compiling both the old and the new source code and comparing its text,
data, and bss size.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
[groeck: Updated description]
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (core) Simplify sysfs attribute name allocation</title>
<updated>2016-12-10T05:54:24+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-10-16T17:52:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3a412d5e4a1c831723d0aaf305f1cf9a78ad9c90'/>
<id>urn:sha1:3a412d5e4a1c831723d0aaf305f1cf9a78ad9c90</id>
<content type='text'>
Allocating the sysfs attribute name only if needed and only with the
required minimum length looks optimal, but does not take the additional
overhead for both devm_ data structures and the allocation header itself
into account. This also results in unnecessary memory fragmentation.
Move the sysfs name string into struct hwmon_device_attribute and give it
a sufficient length to reduce this overhead.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
</feed>
