Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: cavium - Fix smp_processor_id() warnings

Switch to raw_smp_processor_id() to prevent a number of
warnings from kernel debugging. We do not care about
preemption here, as the CPU number is only used as a
poor mans load balancing or device selection. If preemption
happens during a compress/decompress operation a small performance
hit will occur but everything will continue to work, so just
ignore it.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
Reviewed-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Jan Glauber and committed by
Herbert Xu
e7a9b05c 1cc7e01f

+3 -3
+2 -2
drivers/crypto/cavium/zip/zip_device.c
··· 87 87 * Distribute the instructions between the enabled queues based on 88 88 * the CPU id. 89 89 */ 90 - if (smp_processor_id() % 2 == 0) 90 + if (raw_smp_processor_id() % 2 == 0) 91 91 queue = 0; 92 92 else 93 93 queue = 1; 94 94 95 - zip_dbg("CPU Core: %d Queue number:%d", smp_processor_id(), queue); 95 + zip_dbg("CPU Core: %d Queue number:%d", raw_smp_processor_id(), queue); 96 96 97 97 /* Take cmd buffer lock */ 98 98 spin_lock(&zip_dev->iq[queue].lock);
+1 -1
drivers/crypto/cavium/zip/zip_main.c
··· 113 113 */ 114 114 int zip_get_node_id(void) 115 115 { 116 - return cpu_to_node(smp_processor_id()); 116 + return cpu_to_node(raw_smp_processor_id()); 117 117 } 118 118 119 119 /* Initializes the ZIP h/w sub-system */