From patchwork Fri Oct 14 10:03:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 2640 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp98811wrs; Fri, 14 Oct 2022 03:14:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4fbBnIhAGMgcGwiAXM39HiIe0yiJ/4ZqaGOSNyyg3LA+FuMZhqgIVjFofxjgVgAO/ZAU1u X-Received: by 2002:a05:6a00:1587:b0:563:39f5:3fba with SMTP id u7-20020a056a00158700b0056339f53fbamr4432781pfk.64.1665742465053; Fri, 14 Oct 2022 03:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665742465; cv=none; d=google.com; s=arc-20160816; b=WK1GxpOgZCnLkcFs8PEemNeEn8RpGLvTclRoWmS5RVd+mIcACWdajRu1lVHn1kCq4S 3r9MbeQJCn/0qOFxJCnSugHqyzep+itY+ZfE8vT7Ohs/3rKVsfNC0AA36buEEdMzLxxg f5W4x26WtClwz76NrQOODxnfk5pivV5CWpwlXiu57Y9ejwkNhZKK+cphaNV75eyYkXr4 PWBbPVKwIvxwfrUrnWbYwpi92W4FU86PWzfwIHNU5yySK3ovkq4Fx7G5nmgieiIQTCLZ 2T7WQPonNar6jXHHZqC0Kt7geGQWb2HmHRlzYZeKf6+QZS756Uu1VURhc0MVZZiAusnn nrfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Mg7sgRbpuOhFyVNI47Y+nErS1jV1WgoVgvux6oPQ7t0=; b=UlLQgJ3AGxDdXKAd8aa0oTaRLIj4gvsCRgXIJJtOlp0Q8qOCbfFqQcoTt1ma1qGtlA 0HSJ9IJMsQ2TxWna0pEF0CBG820KcBPdg+Ctqmbccz4xN4JY5Z+vCV7/FUNlz2mj8KTh dYyiqoAeYkSR0alxfLdzAIWxVnn9NbbW6QMmK6hYc/AShFcp/nY+vEbGSSKvOzkvwSz5 NPpH2gwkj6sUThKyy75KF4N6hy1wfITnxJNscOT9aVjl3rJZXkf0X26pRmNEhn2qEgfj UZaNRmvrk3Je6vusD44WZPNbdEKnCfxGYWQ0QhCLw6spywKLSzZypWYd46Gr4AVKQtcI lQ4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i62-20020a638741000000b0045466821a09si2397492pge.371.2022.10.14.03.14.11; Fri, 14 Oct 2022 03:14:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbiJNKJb (ORCPT + 99 others); Fri, 14 Oct 2022 06:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbiJNKJM (ORCPT ); Fri, 14 Oct 2022 06:09:12 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D70695A2DC; Fri, 14 Oct 2022 03:09:03 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MphnN3xDPzmVPw; Fri, 14 Oct 2022 18:04:24 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 18:09:01 +0800 Received: from huawei.com (10.67.165.24) by dggpeml100012.china.huawei.com (7.185.36.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 18:09:01 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH v2 1/3] crypto: hisilicon/qm - increase the memory of local variables Date: Fri, 14 Oct 2022 10:03:17 +0000 Message-ID: <20221014100319.5259-2-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221014100319.5259-1-yekai13@huawei.com> References: <20221014100319.5259-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml100012.china.huawei.com (7.185.36.121) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746657571322216858?= X-GMAIL-MSGID: =?utf-8?q?1746657571322216858?= Increase the buffer to prevent stack overflow by fuzz test. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/qm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index e3edb176d976..5d79e9f0e7e1 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -250,7 +250,6 @@ #define QM_QOS_MIN_CIR_B 100 #define QM_QOS_MAX_CIR_U 6 #define QM_QOS_MAX_CIR_S 11 -#define QM_QOS_VAL_MAX_LEN 32 #define QM_DFX_BASE 0x0100000 #define QM_DFX_STATE1 0x0104000 #define QM_DFX_STATE2 0x01040C8 @@ -4612,7 +4611,7 @@ static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf, unsigned int *fun_index) { char tbuf_bdf[QM_DBG_READ_LEN] = {0}; - char val_buf[QM_QOS_VAL_MAX_LEN] = {0}; + char val_buf[QM_DBG_READ_LEN] = {0}; u32 tmp1, device, function; int ret, bus; From patchwork Fri Oct 14 10:03:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 2642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp99567wrs; Fri, 14 Oct 2022 03:16:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dBgJrD/YpoKpKBTyf9jGNh27G0vOi+ujy/x4m7dh+K27oUVZI85tBi4VewhvLqe6nFH8U X-Received: by 2002:a17:902:ea82:b0:183:a85a:9b26 with SMTP id x2-20020a170902ea8200b00183a85a9b26mr4656006plb.166.1665742565944; Fri, 14 Oct 2022 03:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665742565; cv=none; d=google.com; s=arc-20160816; b=WR3z/2rOX1wwtDn5rAP4HT5QsIz++D/BgQ8kjWJewXAi1nYyELVK7ZGotT9TP+UvaE X7Xebg1UwOt5tLr8wKp9Mb1b7DS7xxtfNWON9xE5hpROWXD2XSc+iwb3w5i2yWEsBWTX TeJQ7VtQEE6zweWKPKjT2SsLyO/CWzrGchC3P0eiIxKQYAaT4Dsut/GXXtqtexzCWx+k p230Hrt3LwgjboYw+pbJX1f45Bf8HhhscxjJnl5/jJLWBgapgQpDZg09afeuqB6mBaoR 9GJBxjImGCtsuGNEpdeNWUyxDvUcMw51Q4TVmHukRR2NfM5cXx3ZTKq8JFeORGs7PbNv U96Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=KCyMXomirBhNE+PGYaW2ctJtm3ZZvMGDsppN/at8JsU=; b=XdalQ23STI1hsPlCOMiDUK54UTz9aVxAIZWiM59AQ7onc/WNiwHVRInTGpUkUwRvdy m+ZOjESLGJqCypXqObkbUYakO0Fb6gALQ9EJA8WEj8VuR22uuBH0vx9e3lLhsn4qt2DZ gMyEqQJ3yQgqWGVoxj+kthMnjYWUsJVOwx6odiRPLHwvknUjwp4YIFdxPMRLlWqNMXXh W/yJXROeQoWdyuV0XcNph0D3E21yUC1Qyljx8SfYdLOsT7gy30odEAIpcXcc6pXb6KRt cuqGo/IqnQ/lbfOD9uI6OyRq8KKqd2Fc+w+eWNZrFmVVuw5WEurW7FxBd3yQFbW6Xi6+ fSRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a056a0002ae00b00565e7a78039si1921458pfs.249.2022.10.14.03.15.53; Fri, 14 Oct 2022 03:16:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229688AbiJNKJt (ORCPT + 99 others); Fri, 14 Oct 2022 06:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbiJNKJM (ORCPT ); Fri, 14 Oct 2022 06:09:12 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FE40181D8C; Fri, 14 Oct 2022 03:09:04 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Mphqm1PPqzDrCl; Fri, 14 Oct 2022 18:06:28 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 18:09:02 +0800 Received: from huawei.com (10.67.165.24) by dggpeml100012.china.huawei.com (7.185.36.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 18:09:01 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH v2 2/3] crypto: hisilicon/qm - add pci bdf number check Date: Fri, 14 Oct 2022 10:03:18 +0000 Message-ID: <20221014100319.5259-3-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221014100319.5259-1-yekai13@huawei.com> References: <20221014100319.5259-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml100012.china.huawei.com (7.185.36.121) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746657677210007579?= X-GMAIL-MSGID: =?utf-8?q?1746657677210007579?= The pci bdf number check is added for qos written by using the pci api. Directly get the devfn by pci_dev, so delete some redundant code. And use the kstrtoul instead of sscanf to simplify code. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/qm.c | 37 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 5d79e9f0e7e1..80eeb966cf89 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -4589,49 +4589,36 @@ static ssize_t qm_algqos_read(struct file *filp, char __user *buf, return ret; } -static ssize_t qm_qos_value_init(const char *buf, unsigned long *val) -{ - int buflen = strlen(buf); - int ret, i; - - for (i = 0; i < buflen; i++) { - if (!isdigit(buf[i])) - return -EINVAL; - } - - ret = sscanf(buf, "%lu", val); - if (ret != QM_QOS_VAL_NUM) - return -EINVAL; - - return 0; -} - static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf, unsigned long *val, unsigned int *fun_index) { + struct bus_type *bus_type = qm->pdev->dev.bus; char tbuf_bdf[QM_DBG_READ_LEN] = {0}; char val_buf[QM_DBG_READ_LEN] = {0}; - u32 tmp1, device, function; - int ret, bus; + struct pci_dev *pdev; + struct device *dev; + int ret; ret = sscanf(buf, "%s %s", tbuf_bdf, val_buf); if (ret != QM_QOS_PARAM_NUM) return -EINVAL; - ret = qm_qos_value_init(val_buf, val); + ret = kstrtoul(val_buf, 10, val); if (ret || *val == 0 || *val > QM_QOS_MAX_VAL) { pci_err(qm->pdev, "input qos value is error, please set 1~1000!\n"); return -EINVAL; } - ret = sscanf(tbuf_bdf, "%u:%x:%u.%u", &tmp1, &bus, &device, &function); - if (ret != QM_QOS_BDF_PARAM_NUM) { - pci_err(qm->pdev, "input pci bdf value is error!\n"); - return -EINVAL; + dev = bus_find_device_by_name(bus_type, NULL, tbuf_bdf); + if (!dev) { + pci_err(qm->pdev, "input pci bdf number is error!\n"); + return -ENODEV; } - *fun_index = PCI_DEVFN(device, function); + pdev = container_of(dev, struct pci_dev, dev); + + *fun_index = pdev->devfn; return 0; } From patchwork Fri Oct 14 10:03:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yekai (A)" X-Patchwork-Id: 2641 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp99467wrs; Fri, 14 Oct 2022 03:15:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ecx+g4qrUmcZG771YaK0J2mOsErYTggTSi0mtnmjMuC+R+/gJNIaDa/iXxJXDtHq3zdV2 X-Received: by 2002:a17:90b:4a51:b0:20d:4ded:3c26 with SMTP id lb17-20020a17090b4a5100b0020d4ded3c26mr16194215pjb.23.1665742553239; Fri, 14 Oct 2022 03:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665742553; cv=none; d=google.com; s=arc-20160816; b=bU165fzUQINM7UbyYdyEdnbu8AhXO+zAryKgPNBFZLrpLXG2rhArCK48nMdpVWXvjn XNWPtQ8w4skvlAZAuT3DSIkDl1+YrlIUz9JJFNCkbN2k0X4zsGA1JNt0mxz7cwW1aHKU OynVApPKNSp0ArUo4CVOHf5UwsaP/J7sQjqjWvGatH3EapVUlqJRG4hlTBpxGRN56/NI 97/O9vEqZz8acuOQf3hUuau9T573uDHwxGI8Z98Kd7d34u52c9y07emel4b+anv1ld9H zXpnhWKxeXauofzs1AlKqyZPK66vdNu0jytkwEAIj+yAwVkdaAJvfujESjYRwyCDKjKp 555A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=thi3XuDv5vw8t+0z3omISxYNIexCY4+Q50HY9zNJ5rQ=; b=QeB1vZcjNAGW6WQyKAEWb9ZlDZnXTpWeUEu7Vw/gmZpY09EPB2oOcHooNVIvYiPhL2 fFRS21s/KwfJinh/v6zqQweN9kqfWfVgKTYH9giPwfinAXaNbG08NkXc5Lww49PJw6Gw GvVCSHWtJhnPgVrNPV3YQEjGU6eQ+h+0EDKaBidIt+x5vFLN0Mc6gGSwoclgRhjuBTYC rgrOqZ4BlV3PddDEkInrh6krevcWFPHN7k0XtjQyH1yj/wrOjb6aPWIRQumTTsMyBdud s4FrMpMY8l8hTlejyhzF81poca2u7tXzkzctw6sM+UKsCEO2JVKleMhB7lk3hsTzXWoD 8M5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb5-20020a17090b4a4500b0020ab4faf62dsi2725948pjb.159.2022.10.14.03.15.39; Fri, 14 Oct 2022 03:15:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbiJNKJk (ORCPT + 99 others); Fri, 14 Oct 2022 06:09:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiJNKJM (ORCPT ); Fri, 14 Oct 2022 06:09:12 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92E0181DA2; Fri, 14 Oct 2022 03:09:03 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MphnN61XnzmVLp; Fri, 14 Oct 2022 18:04:24 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 18:09:02 +0800 Received: from huawei.com (10.67.165.24) by dggpeml100012.china.huawei.com (7.185.36.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 18:09:02 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH v2 3/3] crypto: hisilicon/qm - delete redundancy check Date: Fri, 14 Oct 2022 10:03:19 +0000 Message-ID: <20221014100319.5259-4-yekai13@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221014100319.5259-1-yekai13@huawei.com> References: <20221014100319.5259-1-yekai13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml100012.china.huawei.com (7.185.36.121) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746657663356483344?= X-GMAIL-MSGID: =?utf-8?q?1746657663356483344?= Because the permission on the VF debugfs file is "0444". So the VF function checking is redundant in qos writing api. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/qm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 80eeb966cf89..363a02810a16 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -4632,9 +4632,6 @@ static ssize_t qm_algqos_write(struct file *filp, const char __user *buf, unsigned long val; int len, ret; - if (qm->fun_type == QM_HW_VF) - return -EINVAL; - if (*pos != 0) return 0;