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

Configure Feed

Select the types of activity you want to include in your feed.

s390/zcrypt: Explicitly use a card variable in _zcrypt_send_cprb

Use an explicit variable "card" for the card addressing in
function _zcrypt_send_cprb instead of the confusing field
"user_defined" from the ica_xcRB struct. This makes the code
somewhat cleaner and easier to understand.

Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Harald Freudenberger and committed by
Vasily Gorbik
0e72b785 227a9197

+4 -4
+4 -4
drivers/s390/crypto/zcrypt_api.c
··· 854 854 struct ica_xcRB *xcrb) 855 855 { 856 856 bool userspace = xflags & ZCRYPT_XFLAG_USERSPACE; 857 - unsigned int domain, func_code = 0; 857 + unsigned int card, domain, func_code = 0; 858 858 unsigned int wgt = 0, pref_wgt = 0; 859 859 struct zcrypt_queue *zq, *pref_zq; 860 860 struct zcrypt_card *zc, *pref_zc; ··· 899 899 900 900 pref_zc = NULL; 901 901 pref_zq = NULL; 902 + card = xcrb->user_defined; 902 903 spin_lock(&zcrypt_list_lock); 903 904 for_each_zcrypt_card(zc) { 904 905 /* Check for usable CCA card */ ··· 907 906 !zc->card->hwinfo.cca) 908 907 continue; 909 908 /* Check for user selected CCA card */ 910 - if (xcrb->user_defined != AUTOSELECT && 911 - xcrb->user_defined != zc->card->id) 909 + if (card != AUTOSELECT && card != zc->card->id) 912 910 continue; 913 911 /* check if request size exceeds card max msg size */ 914 912 if (ap_msg.len > zc->card->maxmsgsize) ··· 951 951 952 952 if (!pref_zq) { 953 953 pr_debug("no match for address %02x.%04x => ENODEV\n", 954 - xcrb->user_defined, domain); 954 + card, domain); 955 955 rc = -ENODEV; 956 956 goto out; 957 957 }