Skip to content

Commit 5ca636b

Browse files
ddstreetherbertx
authored andcommitted
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 <[email protected]> Signed-off-by: Dan Streetman <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 4537992 commit 5ca636b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/842/842_decompress.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct sw842_param {
6969
((s) == 2 ? be16_to_cpu(get_unaligned((__be16 *)d)) : \
7070
(s) == 4 ? be32_to_cpu(get_unaligned((__be32 *)d)) : \
7171
(s) == 8 ? be64_to_cpu(get_unaligned((__be64 *)d)) : \
72-
WARN(1, "pr_debug param err invalid size %x\n", s))
72+
0)
7373

7474
static int next_bits(struct sw842_param *p, u64 *d, u8 n);
7575

@@ -202,10 +202,14 @@ static int __do_index(struct sw842_param *p, u8 size, u8 bits, u64 fsize)
202202
return -EINVAL;
203203
}
204204

205-
pr_debug("index%x to %lx off %lx adjoff %lx tot %lx data %lx\n",
206-
size, (unsigned long)index, (unsigned long)(index * size),
207-
(unsigned long)offset, (unsigned long)total,
208-
(unsigned long)beN_to_cpu(&p->ostart[offset], size));
205+
if (size != 2 && size != 4 && size != 8)
206+
WARN(1, "__do_index invalid size %x\n", size);
207+
else
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));
209213

210214
memcpy(p->out, &p->ostart[offset], size);
211215
p->out += size;

0 commit comments

Comments
 (0)