<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/base/regmap/regmap-debugfs.c, branch v3.10.78</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>regmap: debugfs: fix possbile NULL pointer dereference</title>
<updated>2014-10-30T16:35:10+00:00</updated>
<author>
<name>Xiubo Li</name>
<email>Li.Xiubo@freescale.com</email>
</author>
<published>2014-09-28T03:35:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d9aa4aecb2e94ca383789147769291e8723ecf86'/>
<id>d9aa4aecb2e94ca383789147769291e8723ecf86</id>
<content type='text'>
commit 2c98e0c1cc6b8e86f1978286c3d4e0769ee9d733 upstream.

If 'map-&gt;dev' is NULL and there will lead dev_name() to be NULL pointer
dereference. So before dev_name(), we need to have check of the map-&gt;dev
pionter.

We also should make sure that the 'name' pointer shouldn't be NULL for
debugfs_create_dir(). So here using one default "dummy" debugfs name when
the 'name' pointer and 'map-&gt;dev' are both NULL.

Signed-off-by: Xiubo Li &lt;Li.Xiubo@freescale.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2c98e0c1cc6b8e86f1978286c3d4e0769ee9d733 upstream.

If 'map-&gt;dev' is NULL and there will lead dev_name() to be NULL pointer
dereference. So before dev_name(), we need to have check of the map-&gt;dev
pionter.

We also should make sure that the 'name' pointer shouldn't be NULL for
debugfs_create_dir(). So here using one default "dummy" debugfs name when
the 'name' pointer and 'map-&gt;dev' are both NULL.

Signed-off-by: Xiubo Li &lt;Li.Xiubo@freescale.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Check return value of regmap_write()</title>
<updated>2013-05-12T14:57:48+00:00</updated>
<author>
<name>Dimitris Papastamos</name>
<email>dp@opensource.wolfsonmicro.com</email>
</author>
<published>2013-05-09T11:46:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68e850d80df934b9c9c15d8a0956512cb3b6f1fc'/>
<id>68e850d80df934b9c9c15d8a0956512cb3b6f1fc</id>
<content type='text'>
Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Add a registers `range' file</title>
<updated>2013-03-04T02:33:03+00:00</updated>
<author>
<name>Dimitris Papastamos</name>
<email>dp@opensource.wolfsonmicro.com</email>
</author>
<published>2013-02-20T12:15:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=065b4c587557dcd3dc8d3ff1ba2b9ecc6e0c6668'/>
<id>065b4c587557dcd3dc8d3ff1ba2b9ecc6e0c6668</id>
<content type='text'>
This file lists the register ranges in the register map.  The condition
to split the range is based on whether the block is readable or not.

Ensure that we lock the `debugfs_off_cache' list whenever we access
and modify the list.  There is a possible race otherwise between the
read() operations of the `registers' file and the `range' file.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This file lists the register ranges in the register map.  The condition
to split the range is based on whether the block is readable or not.

Ensure that we lock the `debugfs_off_cache' list whenever we access
and modify the list.  There is a possible race otherwise between the
read() operations of the `registers' file and the `range' file.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Simplify calculation of `c-&gt;max_reg'</title>
<updated>2013-03-04T02:33:02+00:00</updated>
<author>
<name>Dimitris Papastamos</name>
<email>dp@opensource.wolfsonmicro.com</email>
</author>
<published>2013-02-20T12:15:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=480738de0e076d759a973be623fac195cb901b82'/>
<id>480738de0e076d759a973be623fac195cb901b82</id>
<content type='text'>
We don't need to use any of the file position information
to calculate the base and max register of each block.  Just
use the counter directly.

Set `i = base' at the top to avoid GCC flow analysis bugs.  The
value of `i' can never be undefined or 0 in the if (c) { ... }.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We don't need to use any of the file position information
to calculate the base and max register of each block.  Just
use the counter directly.

Set `i = base' at the top to avoid GCC flow analysis bugs.  The
value of `i' can never be undefined or 0 in the if (c) { ... }.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2013-02-25T23:41:43+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-02-25T23:41:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9043a2650cd21f96f831a97f516c2c302e21fb70'/>
<id>9043a2650cd21f96f831a97f516c2c302e21fb70</id>
<content type='text'>
Pull module update from Rusty Russell:
 "The sweeping change is to make add_taint() explicitly indicate whether
  to disable lockdep, but it's a mechanical change."

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  MODSIGN: Add option to not sign modules during modules_install
  MODSIGN: Add -s &lt;signature&gt; option to sign-file
  MODSIGN: Specify the hash algorithm on sign-file command line
  MODSIGN: Simplify Makefile with a Kconfig helper
  module: clean up load_module a little more.
  modpost: Ignore ARC specific non-alloc sections
  module: constify within_module_*
  taint: add explicit flag to show whether lock dep is still OK.
  module: printk message when module signature fail taints kernel.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull module update from Rusty Russell:
 "The sweeping change is to make add_taint() explicitly indicate whether
  to disable lockdep, but it's a mechanical change."

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  MODSIGN: Add option to not sign modules during modules_install
  MODSIGN: Add -s &lt;signature&gt; option to sign-file
  MODSIGN: Specify the hash algorithm on sign-file command line
  MODSIGN: Simplify Makefile with a Kconfig helper
  module: clean up load_module a little more.
  modpost: Ignore ARC specific non-alloc sections
  module: constify within_module_*
  taint: add explicit flag to show whether lock dep is still OK.
  module: printk message when module signature fail taints kernel.
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Factor out debugfs_tot_len calc into a function</title>
<updated>2013-02-11T11:25:33+00:00</updated>
<author>
<name>Dimitris Papastamos</name>
<email>dp@opensource.wolfsonmicro.com</email>
</author>
<published>2013-02-11T10:50:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4dd7c5531d3b046574da39096b1a66c738aca102'/>
<id>4dd7c5531d3b046574da39096b1a66c738aca102</id>
<content type='text'>
In preparation to support the regmap debugfs ranges functionality
factor this code out to a separate function.  We'll need to ensure
that the value has been correctly calculated from two separate places
in the code.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In preparation to support the regmap debugfs ranges functionality
factor this code out to a separate function.  We'll need to ensure
that the value has been correctly calculated from two separate places
in the code.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Optimize seeking within blocks of registers</title>
<updated>2013-02-11T11:25:33+00:00</updated>
<author>
<name>Dimitris Papastamos</name>
<email>dp@opensource.wolfsonmicro.com</email>
</author>
<published>2013-02-08T12:47:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf57d6071f0610c99856c006ac06eb98a151f485'/>
<id>cf57d6071f0610c99856c006ac06eb98a151f485</id>
<content type='text'>
Optimize this so that we can better guess where to start scanning
from.  We know the length of the register field format, therefore
given the file pointer position align to the nearest register
field and scan from there onwards.  We round down in this calculation
and we let the rest of the code figure out where to start scanning
from.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Optimize this so that we can better guess where to start scanning
from.  We know the length of the register field format, therefore
given the file pointer position align to the nearest register
field and scan from there onwards.  We round down in this calculation
and we let the rest of the code figure out where to start scanning
from.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Add a `max_reg' member in struct regmap_debugfs_off_cache</title>
<updated>2013-02-11T11:25:32+00:00</updated>
<author>
<name>Dimitris Papastamos</name>
<email>dp@opensource.wolfsonmicro.com</email>
</author>
<published>2013-02-08T12:47:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c2c1ee66016a45477f58f0fd30907b1e959ca76b'/>
<id>c2c1ee66016a45477f58f0fd30907b1e959ca76b</id>
<content type='text'>
We are keeping track of the maximum register as well, this will make
things easier for us in sharing this code with the code implementing
the register ranges functionality.  It also simplifies a bit the
calculations when looking for the relevant block:offset from within
the cache.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are keeping track of the maximum register as well, this will make
things easier for us in sharing this code with the code implementing
the register ranges functionality.  It also simplifies a bit the
calculations when looking for the relevant block:offset from within
the cache.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: debugfs: Fix reading in register field units</title>
<updated>2013-02-08T11:31:34+00:00</updated>
<author>
<name>Dimitris Papastamos</name>
<email>dp@opensource.wolfsonmicro.com</email>
</author>
<published>2013-02-07T10:51:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f3eb83994cb4c172ce5028b5ae7ea08462cc3f1d'/>
<id>f3eb83994cb4c172ce5028b5ae7ea08462cc3f1d</id>
<content type='text'>
At the moment, if the length of the register field format is
N bytes, we can only get anything meaningful back to userspace
by providing a buffer that is N + 2 bytes large.  Fix this
so we that we only need to provide a buffer of N bytes.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At the moment, if the length of the register field format is
N bytes, we can only get anything meaningful back to userspace
by providing a buffer that is N + 2 bytes large.  Fix this
so we that we only need to provide a buffer of N bytes.

Signed-off-by: Dimitris Papastamos &lt;dp@opensource.wolfsonmicro.com&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regmap: regmap: avoid spurious warning in regmap_read_debugfs</title>
<updated>2013-01-27T02:45:10+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2013-01-26T11:45:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a3471469bcba61f8f18ca4c267b0cdd90a61e035'/>
<id>a3471469bcba61f8f18ca4c267b0cdd90a61e035</id>
<content type='text'>
Gcc warns about the case where regmap_read_debugfs tries to walk an
empty map-&gt;debugfs_off_cache list, which would results in uninitialized
variable getting returned, if we hadn't checked the same condition
just before that.

After an originally suggested inferior patch from Arnd Bergmann,
this is the solution that Russell King came up with, sidestepping
the problem by merging the error case for an empty list with the
normal path.

Without this patch, building mxs_defconfig results in:

drivers/base/regmap/regmap-debugfs.c: In function 'regmap_read_debugfs':
drivers/base/regmap/regmap-debugfs.c:147:9: : warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Reported-by: Vincent Stehle &lt;v-stehle@ti.com&gt;
Cc: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Gcc warns about the case where regmap_read_debugfs tries to walk an
empty map-&gt;debugfs_off_cache list, which would results in uninitialized
variable getting returned, if we hadn't checked the same condition
just before that.

After an originally suggested inferior patch from Arnd Bergmann,
this is the solution that Russell King came up with, sidestepping
the problem by merging the error case for an empty list with the
normal path.

Without this patch, building mxs_defconfig results in:

drivers/base/regmap/regmap-debugfs.c: In function 'regmap_read_debugfs':
drivers/base/regmap/regmap-debugfs.c:147:9: : warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Reported-by: Vincent Stehle &lt;v-stehle@ti.com&gt;
Cc: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
