diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2020-09-23 10:36:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-23 12:07:54 -0700 |
commit | ab29c480b19465a5174ea8eddfa1bd42becf72c9 (patch) | |
tree | 1128dbc31d0b8cf0c3dd08cd42ddad6e927bdbd4 /drivers/s390/net/qeth_l3_main.c | |
parent | s390/qeth: clean up string ops in qeth_l3_parse_ipatoe() (diff) | |
download | wireguard-linux-ab29c480b19465a5174ea8eddfa1bd42becf72c9.tar.xz wireguard-linux-ab29c480b19465a5174ea8eddfa1bd42becf72c9.zip |
s390/qeth: replace deprecated simple_stroul()
Convert the remaining occurences in sysfs code to kstrtouint().
While at it move some input parsing out of locked sections, replace an
open-coded clamp() and remove some unnecessary run-time checks for
ipatoe->mask_bits that are already enforced when creating the object.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_l3_main.c')
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 810d65fd48b4..876a21d451f5 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -105,11 +105,9 @@ static bool qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card, (ipatoe->proto == QETH_PROT_IPV4) ? 4 : 16); if (addr->proto == QETH_PROT_IPV4) - rc = !memcmp(addr_bits, ipatoe_bits, - min(32, ipatoe->mask_bits)); + rc = !memcmp(addr_bits, ipatoe_bits, ipatoe->mask_bits); else - rc = !memcmp(addr_bits, ipatoe_bits, - min(128, ipatoe->mask_bits)); + rc = !memcmp(addr_bits, ipatoe_bits, ipatoe->mask_bits); if (rc) break; } @@ -561,7 +559,7 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card, int qeth_l3_del_ipato_entry(struct qeth_card *card, enum qeth_prot_versions proto, u8 *addr, - int mask_bits) + unsigned int mask_bits) { struct qeth_ipato_entry *ipatoe, *tmp; int rc = -ENOENT; |