[flashrom] [PATCH] spi25.c: Remove assignment to variable `pos`

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Tue Jan 20 08:57:11 CET 2015

On Mon, 19 Jan 2015 23:00:35 +0100
Paul Menzel <paulepanter at users.sourceforge.net> wrote:

> Date: Mon, 19 Jan 2015 22:51:31 +0100
> Address the warning below found by Clang’s static analyzer scan-build
> 3.6 and remove that assignment.
> 	spi25.c:1163:3: warning: Value stored to 'pos' is never read
> 			pos += pos % 2;
> 			^      ~~~~~~~
> 	1 warning generated.
> This was introduced in revision 1211 (Switch all flash chips to partial
> write.).

Hi Paul,

thanks for the patch. Coverity does detect that as well. Removal is not
the only option though. We could also check if pos is correct
afterwards. That would make that assignment vital... I am not sure yet
how to proceed and will leave it as is since it does no harm.

Kind regards/Mit freundlichen Grüßen, Stefan Tauner

More information about the flashrom mailing list