<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/nand-utils/nanddump.c, branch v2.3.1</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2025-01-30T17:30:16+00:00</updated>
<entry>
<title>nand-utils: nanddump: Fix unexpected type compiling warning for argument 'dumpfile'</title>
<updated>2025-01-30T17:30:16+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2025-01-26T06:41:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=9d755ba03f6947ed0f77df8a2bcdb1b6585dabf9'/>
<id>urn:sha1:9d755ba03f6947ed0f77df8a2bcdb1b6585dabf9</id>
<content type='text'>
The const pointer argument cannot be passed into libc function 'free()',
otherwise the compiler will complain following message:
 nand-utils/nanddump.c:168:10: warning: passing argument 1 of ‘free’
 discards ‘const’ qualifier from pointer target type

Fixes: c89009463888 ("nanddump: don't leak copied command line arguments")
Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nand-utils: nanddump: Add support for testing continuous reads</title>
<updated>2024-10-08T06:14:36+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2024-08-26T09:46:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=7bf7d98cc094f4b0c6e535a7231ce310a9c6e23c'/>
<id>urn:sha1:7bf7d98cc094f4b0c6e535a7231ce310a9c6e23c</id>
<content type='text'>
In order to trigger a continuous read, the user needs to request more
than one data page. So far the tool would split the length into page
chunks. This is no longer the case when the -C option is passed (-c is
already used for the canonical output style).

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nand-utils: nanddump: Explicitely use the page size when relevant</title>
<updated>2024-10-08T06:14:33+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2024-08-26T09:46:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=bc6f5df46460fe00b953fb81706770b49bd36e77'/>
<id>urn:sha1:bc6f5df46460fe00b953fb81706770b49bd36e77</id>
<content type='text'>
Using bs when skipping the bad sector is abusive as what we want is
using the size of a block and the size of a page. The fact that bs
currently is the size of a page is misleading here, has I intend to make
this amount grow.

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nand-utils: nanddump: Use a specific variable for the buffer size</title>
<updated>2024-10-08T06:14:30+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2024-08-26T09:46:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=11c30d73d3927373a114e9ed274f627a124d9ad7'/>
<id>urn:sha1:11c30d73d3927373a114e9ed274f627a124d9ad7</id>
<content type='text'>
The read buffer size happen to be as big as the bs variable, but this is
going to change. When accessing the buffer size, use a specific variable
instead.

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: nanddump: fix writing big images on 32bit machines</title>
<updated>2022-06-08T07:53:51+00:00</updated>
<author>
<name>Sascha Hauer</name>
<email>s.hauer@pengutronix.de</email>
</author>
<published>2022-06-08T07:51:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=f79d2b21614f11ea9f99dc5a3155d23439cec773'/>
<id>urn:sha1:f79d2b21614f11ea9f99dc5a3155d23439cec773</id>
<content type='text'>
When writing a full 4GiB NAND to a file end_addr becomes 0x100000000.
With that writing out the first page to the file doesn't happen
because size_left is calculated to 0x100000000 - 0 = 0x100000000
which is then truncated to 32bit and becomes zero. Fix this by
using an appropriate 64bit type for size_left.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: Fix wrong argument to sizeof in nanddump</title>
<updated>2020-02-09T21:13:18+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-01-24T22:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=7d40c1a1420bc95af20624aa22e254a8eb3356f0'/>
<id>urn:sha1:7d40c1a1420bc95af20624aa22e254a8eb3356f0</id>
<content type='text'>
Some temporary buffers are allocated with "sizeof(pointer) * count" as
size argument, which cannot possibly be correct.

Assuming what was meant was "sizeof(pointer[0]) * count" makes sense
in the context of how the buffers are used, but is actually pretty
pointless, since the buffers are unsigend char.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: Fix potential negative arguments passed to close(2)</title>
<updated>2020-02-09T21:13:18+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-01-24T22:01:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=b636250e211198210ab996671bccc2983300c6f5'/>
<id>urn:sha1:b636250e211198210ab996671bccc2983300c6f5</id>
<content type='text'>
Many tools open a file descriptor, close it a the end and have some
form of error path in between that jumps to the end.

In some cases, if opening the file fails the error path is taken and
the utility ends up closing one or more invalid file descriptors. It's
technically not a real issue but something that pretty much any static
analysis tool barks at.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nanddump: don't leak copied command line arguments</title>
<updated>2019-11-10T14:30:04+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-11-10T13:56:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=c890094638880072cfa95a06cb1353f0214a11a0'/>
<id>urn:sha1:c890094638880072cfa95a06cb1353f0214a11a0</id>
<content type='text'>
For some command line flags, the argument string is copied. Simply
writing over the buffer leads to a resource leak if the same flag
is specified on the command line more than once.

This patch adds a free() call to the old buffer before overwriting
it with the new copy.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Mark or fix switch cases that fall through</title>
<updated>2017-11-02T00:34:18+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2017-09-21T09:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=475bf707b958f37844534b7b45c905521c7401a2'/>
<id>urn:sha1:475bf707b958f37844534b7b45c905521c7401a2</id>
<content type='text'>
Now that C++17 introduced a special fallthrough keyword for
explicitly tagging switch cases that are supposed to fall
through, newer gcc versions also implement a feature request
from 2002 to warn about maybe unwanted fall-throughs in switch
cases in other languages (like C).

For C code, we can either add a gcc specific attribute at the
end of the switch case, or use a special comment that gcc checks
for, indicating that the fall-through behaviour is indeed
intended.

This patch adds a "/* fall-through */" comment at the end of
various case blocks to silence gcc warnings and in some cases
a break, where fall-through was probably not intended.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nanddump: Add --skip-bad-blocks-to-start option</title>
<updated>2017-01-18T13:42:25+00:00</updated>
<author>
<name>Mike Crowe</name>
<email>mac@mcrowe.com</email>
</author>
<published>2017-01-17T11:54:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=44558d1de053cd2772b419bb306a926f07365ae6'/>
<id>urn:sha1:44558d1de053cd2772b419bb306a926f07365ae6</id>
<content type='text'>
The --skip-bad-blocks-to-start option will increase the start address by
the size of each bad block encountered between the start of the partition
and the specified start address.

This can be useful if other readers of the partition will be reading using
a simple bad-block-skipping algorithm.

Signed-off-by: Mike Crowe &lt;mac@mcrowe.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
