Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1440721ybl; Fri, 10 Jan 2020 18:49:09 -0800 (PST) X-Google-Smtp-Source: APXvYqz+G5er6GnPpiGCwuyyGCwf3NYgc+DjgIw2e9HS/q2po2hp70bh6cO4hzwCcNuPReyohSqz X-Received: by 2002:a05:6808:f:: with SMTP id u15mr5120734oic.100.1578710949464; Fri, 10 Jan 2020 18:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578710949; cv=none; d=google.com; s=arc-20160816; b=ZXpJME0qGWo2utguX26fQuwD/B4rly3ub4CX21Wq1v0ZGBPi7zl94C8RXEjVblmomN ZDMSRtMXc0zjJSB6KdSRqHjQfEzgoyyvFseXcV9Kka/Mzsz3F6OUOvhgmqshU2m+KO5L DcM/T6LTtbInJUyKC2VxzDFZTNDk+UaYzoDukP+Sa7zQcwlgI9emu7JdyUbPz9yfOfLG GxSyu7SCD9QGWGO3v+u1W3c8GqSpX7ofxJMxx64QzJWsWjL1AgBmK5MeMtedSTvTHRAa JJtJkKcRVvkh45FY9diwDj3EaWtleF+3hyLi1RJlSckLY27M0WrxtdIG+6XSGv4MfsBn hwEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Mu5+/Fa2bPK68XTGdLy7tpMrahLSB9AEV2Ha6vAtulo=; b=jyM/BBBfbPKvdTqI35IYTObCZAHbv5C4G69OZDUupYAma+sPyigIpTK9f0Pc60AVMI oTKRUBE5KLoRGC6M8Bnr4dsIfLqNwvZF6V6OY4B9w/gBKD1qcFzG4lnxZASiZOxNUDl7 ZTubiypkFhhvMk8ywqncK5aT89lV+VWrWW/JYTWHOmMLJrScml3ddqeI4lE2ZUAKdlqz 5FznTPqAi9JPOe8CqV6jC3l4G08rWoUlyYYSLCv0iWN7Gz1lOGfIsEdofrGA3kqpdatE z29Y2LI3L2LegoLDpYQsqArDiVQmKIBhKTL2DGLbse0rusLsoxT1V93fd+iJbH0PlZkm a+iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si2347148oic.62.2020.01.10.18.48.58; Fri, 10 Jan 2020 18:49:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728207AbgAKCpy (ORCPT + 99 others); Fri, 10 Jan 2020 21:45:54 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:45372 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728187AbgAKCpw (ORCPT ); Fri, 10 Jan 2020 21:45:52 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 52C9365E8DE33757C1FD; Sat, 11 Jan 2020 10:45:49 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Sat, 11 Jan 2020 10:45:41 +0800 From: Zaibo Xu To: , CC: , , , , , , , , , , Subject: [PATCH v2 2/9] crypto: hisilicon - fix print/comment of SEC V2 Date: Sat, 11 Jan 2020 10:41:49 +0800 Message-ID: <1578710516-40535-3-git-send-email-xuzaibo@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1578710516-40535-1-git-send-email-xuzaibo@huawei.com> References: <1578710516-40535-1-git-send-email-xuzaibo@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fixed some print, coding style and comments of HiSilicon SEC V2. Signed-off-by: Zaibo Xu --- drivers/crypto/hisilicon/sec2/sec_crypto.c | 8 ++++---- drivers/crypto/hisilicon/sec2/sec_crypto.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index 2475aaf..9dca958 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c @@ -245,16 +245,16 @@ static int sec_skcipher_init(struct crypto_skcipher *tfm) sec = sec_find_device(cpu_to_node(smp_processor_id())); if (!sec) { - pr_err("find no Hisilicon SEC device!\n"); + pr_err("Can not find proper Hisilicon SEC device!\n"); return -ENODEV; } ctx->sec = sec; qm = &sec->qm; dev = &qm->pdev->dev; - ctx->hlf_q_num = sec->ctx_q_num >> 0x1; + ctx->hlf_q_num = sec->ctx_q_num >> 1; /* Half of queue depth is taken as fake requests limit in the queue. */ - ctx->fake_req_limit = QM_Q_DEPTH >> 0x1; + ctx->fake_req_limit = QM_Q_DEPTH >> 1; ctx->qp_ctx = kcalloc(sec->ctx_q_num, sizeof(struct sec_qp_ctx), GFP_KERNEL); if (!ctx->qp_ctx) @@ -704,7 +704,7 @@ static int sec_process(struct sec_ctx *ctx, struct sec_req *req) ret = ctx->req_op->bd_send(ctx, req); if (ret != -EBUSY && ret != -EINPROGRESS) { - dev_err(SEC_CTX_DEV(ctx), "send sec request failed!\n"); + dev_err_ratelimited(SEC_CTX_DEV(ctx), "send sec request failed!\n"); goto err_send_req; } diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.h b/drivers/crypto/hisilicon/sec2/sec_crypto.h index 097dce8..46b3a35 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.h +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.h @@ -48,8 +48,8 @@ enum sec_addr_type { struct sec_sqe_type2 { /* - * mac_len: 0~5 bits - * a_key_len: 6~10 bits + * mac_len: 0~4 bits + * a_key_len: 5~10 bits * a_alg: 11~16 bits */ __le32 mac_key_alg; -- 2.8.1