aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@ieee.org>2015-12-21 12:52:10 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2015-12-23 05:20:01 -0500
commit5ca636b986eecce09d4935d490f8d16248b6ce08 (patch)
tree2a96c0312e85362c8ff9919d8c8b6c4b79343349
parent4537992be7cb9954d19647bec4008ee39ad77217 (diff)
crypto: 842 - remove WARN inside printk
Remove the WARN() from the beN_to_cpu macro, which is used as a param to a pr_debug() call. With a certain kernel config, this printk-in-printk results in the no_printk() macro trying to recursively call the no_printk() macro, and since macros can't recursively call themselves a build error results. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Dan Streetman <ddstreet@ieee.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--lib/842/842_decompress.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/842/842_decompress.c b/lib/842/842_decompress.c
index 8881dad2a6a0..a7f278d2ed8f 100644
--- a/lib/842/842_decompress.c
+++ b/lib/842/842_decompress.c
@@ -69,7 +69,7 @@ struct sw842_param {
69 ((s) == 2 ? be16_to_cpu(get_unaligned((__be16 *)d)) : \ 69 ((s) == 2 ? be16_to_cpu(get_unaligned((__be16 *)d)) : \
70 (s) == 4 ? be32_to_cpu(get_unaligned((__be32 *)d)) : \ 70 (s) == 4 ? be32_to_cpu(get_unaligned((__be32 *)d)) : \
71 (s) == 8 ? be64_to_cpu(get_unaligned((__be64 *)d)) : \ 71 (s) == 8 ? be64_to_cpu(get_unaligned((__be64 *)d)) : \
72 WARN(1, "pr_debug param err invalid size %x\n", s)) 72 0)
73 73
74static int next_bits(struct sw842_param *p, u64 *d, u8 n); 74static int next_bits(struct sw842_param *p, u64 *d, u8 n);
75 75
@@ -202,10 +202,14 @@ static int __do_index(struct sw842_param *p, u8 size, u8 bits, u64 fsize)
202 return -EINVAL; 202 return -EINVAL;
203 } 203 }
204 204
205 pr_debug("index%x to %lx off %lx adjoff %lx tot %lx data %lx\n", 205 if (size != 2 && size != 4 && size != 8)
206 size, (unsigned long)index, (unsigned long)(index * size), 206 WARN(1, "__do_index invalid size %x\n", size);
207 (unsigned long)offset, (unsigned long)total, 207 else
208 (unsigned long)beN_to_cpu(&p->ostart[offset], size)); 208 pr_debug("index%x to %lx off %lx adjoff %lx tot %lx data %lx\n",
209 size, (unsigned long)index,
210 (unsigned long)(index * size), (unsigned long)offset,
211 (unsigned long)total,
212 (unsigned long)beN_to_cpu(&p->ostart[offset], size));
209 213
210 memcpy(p->out, &p->ostart[offset], size); 214 memcpy(p->out, &p->ostart[offset], size);
211 p->out += size; 215 p->out += size;