<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/mtd/maps, branch v4.4.80</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>mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy</title>
<updated>2017-03-18T11:09:56+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2017-02-03T09:49:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3dc8f1e3a8f2cd8481578689f49c586184f25eed'/>
<id>3dc8f1e3a8f2cd8481578689f49c586184f25eed</id>
<content type='text'>
commit 906b268477bc03daaa04f739844c120fe4dbc991 upstream.

kernelci.org reports a warning for this driver, as it copies a local
variable into a 'const char *' string:

    drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Using kstrndup() simplifies the code and avoids the warning.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Marek Vasut &lt;marek.vasut@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&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 906b268477bc03daaa04f739844c120fe4dbc991 upstream.

kernelci.org reports a warning for this driver, as it copies a local
variable into a 'const char *' string:

    drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Using kstrndup() simplifies the code and avoids the warning.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Marek Vasut &lt;marek.vasut@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: pmcmsp-flash: Allocating too much in init_msp_flash()</title>
<updated>2016-09-30T08:18:37+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-07-14T10:44:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a52c63ade338cfddb7a5e779cef913624b25fded'/>
<id>a52c63ade338cfddb7a5e779cef913624b25fded</id>
<content type='text'>
commit 79ad07d45743721010e766e65dc004ad249bd429 upstream.

There is a cut and paste issue here.  The bug is that we are allocating
more memory than necessary for msp_maps.  We should be allocating enough
space for a map_info struct (144 bytes) but we instead allocate enough
for an mtd_info struct (1840 bytes).  It's a small waste.

The other part of this is not harmful but when we allocated msp_flash
then we allocated enough space fro a map_info pointer instead of an
mtd_info pointer.  But since pointers are the same size it works out
fine.

Anyway, I decided to clean up all three allocations a bit to make them
a bit more consistent and clear.

Fixes: 68aa0fa87f6d ('[MTD] PMC MSP71xx flash/rootfs mappings')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&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 79ad07d45743721010e766e65dc004ad249bd429 upstream.

There is a cut and paste issue here.  The bug is that we are allocating
more memory than necessary for msp_maps.  We should be allocating enough
space for a map_info struct (144 bytes) but we instead allocate enough
for an mtd_info struct (1840 bytes).  It's a small waste.

The other part of this is not harmful but when we allocated msp_flash
then we allocated enough space fro a map_info pointer instead of an
mtd_info pointer.  But since pointers are the same size it works out
fine.

Anyway, I decided to clean up all three allocations a bit to make them
a bit more consistent and clear.

Fixes: 68aa0fa87f6d ('[MTD] PMC MSP71xx flash/rootfs mappings')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: sa1100-flash: potential NULL dereference</title>
<updated>2016-09-30T08:18:37+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-07-15T11:06:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=45987838305b660f44b6edffc8b653361bef7390'/>
<id>45987838305b660f44b6edffc8b653361bef7390</id>
<content type='text'>
commit dc01a28d80a42cef08c94dfc595565aaebe46d15 upstream.

We check for NULL but then dereference "info-&gt;mtd" on the next line.

Fixes: 72169755cf36 ('mtd: maps: sa1100-flash: show parent device in sysfs')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&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 dc01a28d80a42cef08c94dfc595565aaebe46d15 upstream.

We check for NULL but then dereference "info-&gt;mtd" on the next line.

Fixes: 72169755cf36 ('mtd: maps: sa1100-flash: show parent device in sysfs')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: rbtx4939-flash: fix compile error</title>
<updated>2015-10-20T01:21:25+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2015-10-19T19:22:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ff84d2b76312681c1b751b1cc1ec6c476937f101'/>
<id>ff84d2b76312681c1b751b1cc1ec6c476937f101</id>
<content type='text'>
We got the syntax wrong here. Compile tested this time!

Error:

   drivers/mtd/maps/rbtx4939-flash.c: In function 'rbtx4939_flash_probe':
&gt;&gt; drivers/mtd/maps/rbtx4939-flash.c:99:11: error: request for member 'dev' in something not a structure or union
     info-&gt;mtd.dev.parent = &amp;dev-&gt;dev;
              ^

Fixes: 9aa7e50276c1 ("mtd: maps: rbtx4939-flash: show parent device in sysfs")
Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Frans Klaver &lt;fransklaver@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We got the syntax wrong here. Compile tested this time!

Error:

   drivers/mtd/maps/rbtx4939-flash.c: In function 'rbtx4939_flash_probe':
&gt;&gt; drivers/mtd/maps/rbtx4939-flash.c:99:11: error: request for member 'dev' in something not a structure or union
     info-&gt;mtd.dev.parent = &amp;dev-&gt;dev;
              ^

Fixes: 9aa7e50276c1 ("mtd: maps: rbtx4939-flash: show parent device in sysfs")
Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Frans Klaver &lt;fransklaver@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: sa1100-flash: show parent device in sysfs</title>
<updated>2015-10-13T19:56:24+00:00</updated>
<author>
<name>Frans Klaver</name>
<email>fransklaver@gmail.com</email>
</author>
<published>2015-06-10T20:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=72169755cf36ce28bed83d6742d28ce4157f7538'/>
<id>72169755cf36ce28bed83d6742d28ce4157f7538</id>
<content type='text'>
Fix a bug where mtd parent device symlinks aren't shown in sysfs.

While at it, make use of the default owner value set by mtdcore.
Incidentally, it seems the owner field in the concatenated mtds is not
actually used, so this shouldn't make much of a difference anyway.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a bug where mtd parent device symlinks aren't shown in sysfs.

While at it, make use of the default owner value set by mtdcore.
Incidentally, it seems the owner field in the concatenated mtds is not
actually used, so this shouldn't make much of a difference anyway.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: rbtx4939-flash: show parent device in sysfs</title>
<updated>2015-10-13T19:56:24+00:00</updated>
<author>
<name>Frans Klaver</name>
<email>fransklaver@gmail.com</email>
</author>
<published>2015-06-10T20:38:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9aa7e50276c17d0658f1035ffe3480085f2a7471'/>
<id>9aa7e50276c17d0658f1035ffe3480085f2a7471</id>
<content type='text'>
Fix a bug where mtd parent device symlinks aren't shown in sysfs.

While at it, make use of the default owner value set by mtdcore.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a bug where mtd parent device symlinks aren't shown in sysfs.

While at it, make use of the default owner value set by mtdcore.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: pxa2xx-flash: show parent device in sysfs</title>
<updated>2015-10-13T19:56:23+00:00</updated>
<author>
<name>Frans Klaver</name>
<email>fransklaver@gmail.com</email>
</author>
<published>2015-06-10T20:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2451581f94e3f5c0e9d75ab5a59f3d5b0f557ca3'/>
<id>2451581f94e3f5c0e9d75ab5a59f3d5b0f557ca3</id>
<content type='text'>
Fix a bug where mtd parent device symlinks aren't shown in sysfs.

While at it, make use of the default owner value set by mtdcore.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a bug where mtd parent device symlinks aren't shown in sysfs.

While at it, make use of the default owner value set by mtdcore.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: plat_ram: drop owner assignment</title>
<updated>2015-10-13T19:56:22+00:00</updated>
<author>
<name>Frans Klaver</name>
<email>fransklaver@gmail.com</email>
</author>
<published>2015-06-10T20:38:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7f6b5dbfd8d95c200ac0de8e5f5842369eee3839'/>
<id>7f6b5dbfd8d95c200ac0de8e5f5842369eee3839</id>
<content type='text'>
Owner is automatically set by mtdcore. Make use of that.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Owner is automatically set by mtdcore. Make use of that.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: physmap_of: drop owner assignment</title>
<updated>2015-10-13T19:56:22+00:00</updated>
<author>
<name>Frans Klaver</name>
<email>fransklaver@gmail.com</email>
</author>
<published>2015-06-10T20:38:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0df415598ef6551070267b1d8c9dc63f4ac00117'/>
<id>0df415598ef6551070267b1d8c9dc63f4ac00117</id>
<content type='text'>
Owner is automatically set by mtdcore. Make use of that.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Owner is automatically set by mtdcore. Make use of that.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: maps: physmap: drop owner assignment</title>
<updated>2015-10-13T19:56:21+00:00</updated>
<author>
<name>Frans Klaver</name>
<email>fransklaver@gmail.com</email>
</author>
<published>2015-06-10T20:38:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=201f230b23cb0252679038d9669af21a99f65614'/>
<id>201f230b23cb0252679038d9669af21a99f65614</id>
<content type='text'>
Owner is automatically set by mtdcore. Make use of that.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Owner is automatically set by mtdcore. Make use of that.

Signed-off-by: Frans Klaver &lt;fransklaver@gmail.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
