Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3661316ioo; Mon, 30 May 2022 07:04:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1FvPwg5hYSiB1311NzcHpTnwOXF0+yRaSP+Y8dycDzuc+Qq9oX4ER5eK+ja2q2wO7OU6m X-Received: by 2002:a17:90b:4f4b:b0:1e0:6356:8a07 with SMTP id pj11-20020a17090b4f4b00b001e063568a07mr23373820pjb.9.1653919445590; Mon, 30 May 2022 07:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653919445; cv=none; d=google.com; s=arc-20160816; b=AZraP18NmXk3s9khOxuVKyUmdB+Q7yed5NhcWWmbuBS0+qLXpF4lq3g2ydfalmvHiV r+9ivQqyhj07WjjIDjV1/O5x3XiXTVoRZSsC1GWS2J65mGjMiVnJzdK2G393khS2lQ1g 9q6xD5FKvJ8J3r8QDqR25r9jK2Gbzu3IZYHwa/v4ieDIy4T2oQi+QhPp7Wwm3Xg3ym/i mZmIzUr+tmhQQ9h7VEVvi9ZNtrTCnvnGOgyaBXLfm/SDwVnIFXwgIljxP/Kux8oS1Ssv SsxZUWpQWVynQ1k7T/rCXzbBLzFf4V41tbsdKOtDr77PeM13koefutc/HOE+59Y/Px/a rlvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=jd5oJcBCVQQDO/AtMPbIgmyzJ5fEewQuJbjaoRkV8Og=; b=h5qz6UyVzvMgeA3lqkREGBI2dKlN94vrz6KzRPcDNOVa3eOYYyD0FUybyH8pgaAOTg kPgZZfJiFVl5NGWPgx4YXmgKj/VtTSb7fkbcoQaWIQdnWkSLmRcbiU+Il0+6JMPNmYWd iPgA7eXIoWhLGCnHTdZ18I8AdGyhvOsiYg40wITNd3LlGOebhbCv5eSYx98SR8qG75QT QFZudLQ0t+1kSogBL6A0SCgTXubhSIi34FytqA+6cH6FTbeqZ9MpszZRnLvf++/XwtO8 Rchlu+GQ57X9ZZESGEVZwIyNBFqbJ2865k/iRYRKMqPh4hC20T34aOfTV+/4x2i1FdA0 C0+Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a633509000000b0039db57e26c3si16236996pga.509.2022.05.30.07.03.49; Mon, 30 May 2022 07:04: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232192AbiE3CJa (ORCPT + 99 others); Sun, 29 May 2022 22:09:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232174AbiE3CJ2 (ORCPT ); Sun, 29 May 2022 22:09:28 -0400 Received: from smtpbg.qq.com (smtpbg136.qq.com [106.55.201.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD00957B2C; Sun, 29 May 2022 19:09:21 -0700 (PDT) X-QQ-mid: bizesmtp91t1653876553tmjo7znn Received: from localhost.localdomain ( [125.70.163.149]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 30 May 2022 10:09:05 +0800 (CST) X-QQ-SSF: 01000000000000B0G000000A0000000 X-QQ-FEAT: I9ND0OY2eBBcEnb4rKrPQb7iIEPvTdW2xFR6PBMGrnnHidp6DhYeutlEf892f seS4nL8r/AE9CoxugJP4k4bSZ9fFH5qdeb9N++v8nmqLM+bXkpsr78xHSSldUB2J2d+nNDv sNUzFs31bbyh+H4ESl/eyMjneJUXMcKO2lxKoPNlbXSlrO4APTBGRdVAiTKVcp8GNl/opr8 V7i3pUkKPpM/YiXyHDrxddjOomhy/uRZwaB5xNnhaUluZ2vUGqRdcRX67kjhxnBnf3uTDiO 2be0Gh5rZXuHmBTQkzePyUaV/auCUtOuEumpzYIBNDam7I X-QQ-GoodBg: 0 From: Xiang wangx To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiang wangx Subject: [PATCH] KVM: Add const to file_operations Date: Mon, 30 May 2022 10:08:57 +0800 Message-Id: <20220530020857.2565-1-wangxiang@cdjrlc.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:cdjrlc.com:qybgspam:qybgspam7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR 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 Struct file_operations should normally be const. Signed-off-by: Xiang wangx --- virt/kvm/kvm_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 3f6d450355f0..7dc2433f1b01 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -3550,7 +3550,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp) return 0; } -static struct file_operations kvm_vcpu_fops = { +static const struct file_operations kvm_vcpu_fops = { .release = kvm_vcpu_release, .unlocked_ioctl = kvm_vcpu_ioctl, .mmap = kvm_vcpu_mmap, @@ -4599,7 +4599,7 @@ static long kvm_vm_compat_ioctl(struct file *filp, } #endif -static struct file_operations kvm_vm_fops = { +static const struct file_operations kvm_vm_fops = { .release = kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl, .llseek = noop_llseek, @@ -4701,7 +4701,7 @@ static long kvm_dev_ioctl(struct file *filp, return r; } -static struct file_operations kvm_chardev_ops = { +static const struct file_operations kvm_chardev_ops = { .unlocked_ioctl = kvm_dev_ioctl, .llseek = noop_llseek, KVM_COMPAT(kvm_dev_ioctl), -- 2.36.1