diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-06-22 14:35:46 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-06-28 06:54:58 -0700 |
commit | 72eed063767e131831fa10a0909c39a0254836ec (patch) | |
tree | efbdc4af62c07473102982fe0931fed1c43939cd /Documentation/driver-model/devres.txt | |
parent | c4d9d598fd2a82136175706e599c4150d0962b1b (diff) |
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>
Diffstat (limited to 'Documentation/driver-model/devres.txt')
0 files changed, 0 insertions, 0 deletions