crypto: amlogic - Remove kcalloc without check
[ Upstream commit 3d780c8a9850ad60dee47a8d971ba7888f3d1bd3 ]
There is no real point in allocating dedicated memory for the irqs array.
MAXFLOW is only 2, so it is easier to allocated the needed space
directly within the 'meson_dev' structure.
This saves some memory allocation and avoids an indirection when using the
irqs array.
Fixes: 48fe583fe5
("crypto: amlogic - Add crypto accelerator...")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
10ed78c85b
commit
22a59bb0aa
@ -237,7 +237,6 @@ static int meson_crypto_probe(struct platform_device *pdev)
|
||||
return err;
|
||||
}
|
||||
|
||||
mc->irqs = devm_kcalloc(mc->dev, MAXFLOW, sizeof(int), GFP_KERNEL);
|
||||
for (i = 0; i < MAXFLOW; i++) {
|
||||
mc->irqs[i] = platform_get_irq(pdev, i);
|
||||
if (mc->irqs[i] < 0)
|
||||
|
@ -95,7 +95,7 @@ struct meson_dev {
|
||||
struct device *dev;
|
||||
struct meson_flow *chanlist;
|
||||
atomic_t flow;
|
||||
int *irqs;
|
||||
int irqs[MAXFLOW];
|
||||
#ifdef CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG
|
||||
struct dentry *dbgfs_dir;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user