20 Aug, 2020
1 commit
-
The header file algapi.h includes skbuff.h unnecessarily since
all we need is a forward declaration for struct sk_buff. This
patch removes that inclusion.Unfortunately skbuff.h pulls in a lot of things and drivers over
the years have come to rely on it so this patch adds a lot of
missing inclusions that result from this.Signed-off-by: Herbert Xu
26 Jun, 2020
1 commit
-
The variable err is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King
Signed-off-by: Herbert Xu
22 Feb, 2020
1 commit
-
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:struct foo {
int stuff;
struct boo array[];
};By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.Also, notice that, dynamic memory allocations won't be affected by
this change:"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")Signed-off-by: Gustavo A. R. Silva
Signed-off-by: Herbert Xu
27 Dec, 2019
1 commit
-
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.By using dma_request_chan() directly the driver can support deferred
probing against DMA.Signed-off-by: Peter Ujfalusi
Signed-off-by: Herbert Xu
09 Aug, 2019
2 commits
-
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.Reported-by: Hulk Robot
Signed-off-by: YueHaibing
Signed-off-by: Herbert Xu -
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.//
@@
expression ret;
struct platform_device *E;
@@ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);if ( \( ret < 0 \| ret
While we're here, remove braces on if statements that only have one
statement (manually).Cc: Greg Kroah-Hartman
Cc: Herbert Xu
Cc: "David S. Miller"
Cc:
Signed-off-by: Stephen Boyd
Signed-off-by: Herbert Xu
19 Jun, 2019
1 commit
-
Based on 2 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundationthis program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Enrico Weigelt
Reviewed-by: Kate Stewart
Reviewed-by: Allison Randal
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman
03 Aug, 2017
1 commit
-
Remove unnecessary static on local variable hdev. Such variable
is initialized before being used, on every execution path throughout
the function. The static has no benefit and, removing it reduces the
object file size.This issue was detected using Coccinelle and the following semantic patch:
https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocciIn the following log you can see a significant difference in the object
file size. This log is the output of the size command, before and after
the code change:before:
text data bss dec hex filename
14842 6464 128 21434 53ba drivers/crypto/img-hash.oafter:
text data bss dec hex filename
14789 6376 64 21229 52ed drivers/crypto/img-hash.oSigned-off-by: Gustavo A. R. Silva
Signed-off-by: Herbert Xu
23 May, 2017
1 commit
-
Here, Clock enable can failed. So adding an error check for
clk_prepare_enable.Signed-off-by: Arvind Yadav
Signed-off-by: Herbert Xu
23 Jan, 2017
1 commit
-
The fourth argument of dma_map_sg() and dma_unmap_sg() is an item of
dma_data_direction enum. Function img_hash_xmit_dma() wrongly used
DMA_MEM_TO_DEV, which is an item of dma_transfer_direction enum.Replace DMA_MEM_TO_DEV (which value is 1) with DMA_TO_DEVICE (which
value is fortunately also 1) when calling dma_map_sg() and
dma_unmap_sg().Signed-off-by: Nicolas Iooss
Signed-off-by: Herbert Xu
09 Aug, 2016
7 commits
-
Properly allocate enough memory to respect the fallback.
Signed-off-by: Will Thomas
Signed-off-by: Herbert Xu -
Currently the probe function only emits an output on success
when debug is specifically enabled. It would be more useful
if this happens by default.Signed-off-by: James Hartley
Reviewed-by: Will Thomas
Signed-off-by: Herbert Xu -
Currently the img-hash accelerator does not probe
successfully due to a change in the checks made during
registration with the crypto framework. This is due to
import and export functions not being defined. Correct
this.Signed-off-by: James Hartley
Signed-off-by: Will Thomas
Signed-off-by: Herbert Xu -
Current img hash claims sys and periph gate clocks
and this can be gated in system suspend scenarios.Add support for Device pm ops for img hash to gate
the clocks claimed by img hash.Signed-off-by: Govindraj Raja
Reviewed-by: Will Thomas
Signed-off-by: Herbert Xu -
Burst length of 16 drives the hash accelerator out of spec
and causes stability issues in some cases. Reduce this to
stop data being lost.Signed-off-by: Will Thomas
Reviewed-by: James Hartley
Signed-off-by: Herbert Xu -
Move 0 length buffer to end of structure to stop overwriting
fallback request data. This doesn't cause a bug itself as the
buffer is never used alongside the fallback but should be
changed.Signed-off-by: Will Thomas
Reviewed-by: James Hartley
Signed-off-by: Herbert Xu -
Sporadic null pointer exceptions came from here. Fix them.
Signed-off-by: Will Thomas
Reviewed-by: James Hartley
Signed-off-by: Herbert Xu
04 Aug, 2015
1 commit
-
Trival change, fix spelling mistake 'aquire' -> 'acquire' in
dev_err message.Signed-off-by: Colin Ian King
Signed-off-by: Herbert Xu
23 Mar, 2015
2 commits
-
"hdev->req->nbytes" is an unsigned int so we so we lose the upper 3 bits
to the shift wrap bug.Signed-off-by: Dan Carpenter
Signed-off-by: Herbert Xu -
GCC complains about that %u is the wrong format string for size_t and
also that "ret" is unused.Signed-off-by: Dan Carpenter
Signed-off-by: Herbert Xu
17 Mar, 2015
1 commit
-
crypto: img-hash - Add missing semicolon to fix build error
There is a missing semicolon after MODULE_DEVICE_TABLE.
Reported-by: Stephen Rothwell
Signed-off-by: Herbert Xu
16 Mar, 2015
1 commit
-
This adds support for the Imagination Technologies hash accelerator which
provides hardware acceleration for SHA1 SHA224 SHA256 and MD5 hashes.Signed-off-by: James Hartley
Reviewed-by: Andrew Bresticker
Signed-off-by: Herbert Xu