linux/drivers/crypto/qat
Arnd Bergmann 72eed06376 crypto: qat - avoid an uninitialized variable warning
After commit 9e442aa6a753 ("x86: remove DMA_ERROR_CODE"), the inlining
decisions in the qat driver changed slightly, introducing a new false-positive
warning:

drivers/crypto/qat/qat_common/qat_algs.c: In function 'qat_alg_sgl_to_bufl.isra.6':
include/linux/dma-mapping.h:228:2: error: 'sz_out' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/crypto/qat/qat_common/qat_algs.c:676:9: note: 'sz_out' was declared here

The patch that introduced this is correct, so let's just avoid the
warning in this driver by rearranging the unwinding after an error
to make it more obvious to the compiler what is going on.

The problem here is the 'if (unlikely(dma_mapping_error(dev, blp)))'
check, in which the 'unlikely' causes gcc to forget what it knew about
the state of the variables. Cleaning up the dma state in the reverse
order it was created means we can simplify the logic so it doesn't have
to know about that state, and also makes it easier to understand.

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2017-06-28 06:54:58 -07:00
..
qat_c3xxx crypto: qat - modify format of dev top level debugfs entries 2016-12-30 19:52:34 +08:00
qat_c3xxxvf crypto: qat - modify format of dev top level debugfs entries 2016-12-30 19:52:34 +08:00
qat_c62x crypto: qat - modify format of dev top level debugfs entries 2016-12-30 19:52:34 +08:00
qat_c62xvf crypto: qat - modify format of dev top level debugfs entries 2016-12-30 19:52:34 +08:00
qat_common crypto: qat - avoid an uninitialized variable warning 2017-06-28 06:54:58 -07:00
qat_dh895xcc crypto: qat - modify format of dev top level debugfs entries 2016-12-30 19:52:34 +08:00
qat_dh895xccvf crypto: qat - modify format of dev top level debugfs entries 2016-12-30 19:52:34 +08:00
Kconfig crypto: qat - Add DH support 2016-07-11 18:03:10 +08:00
Makefile crypto: qat - add support for c62xvf accel type 2015-12-09 20:03:56 +08:00