Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1241926lfc; Wed, 1 Jun 2022 12:50:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7OTXo6P4H1WduFCqnt+hL1HbBLnxPriSF3FpwooQTTDNehN1DhBIF2Jv/ZN3Pa+0eyu/Q X-Received: by 2002:a17:902:8487:b0:15f:b2c:435 with SMTP id c7-20020a170902848700b0015f0b2c0435mr1053773plo.33.1654113011648; Wed, 01 Jun 2022 12:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113011; cv=none; d=google.com; s=arc-20160816; b=cEnBDupNciegQpqXQrd3k5ebfDEprCiJf/egpsIXV8NV+j3hGcYE2104rNeWVoKaIx Shi4DMgmp79gdKOi4SB1Ia1LxsqzvzZN81kLjWUxchdxHfOLEP0HwsAAuoPM933PREKT L2/04RYkN55CmzpCQD16ollItW3FAS9DYyaTd6N/li2kntgLnNkp3YnSZlqCsVRncM3u TwXweRtb+RkBNeoiE19VHjxgwAZIKbxb/ca5KRkodMkFbRfcptb+2YvJ11P7Xfjxo/HH soHshA+JLg1FFBd4/CPQK5wsB6gZac+YcpFKXrTWozHt0BimuFLhRPvc4R7xrYt6fJFq 3nyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tvCRh6wMybfz1jQ+oOGAFWgP9hwbhrbOUgkVnS4S7M0=; b=lOXrOb5bgtBzF2ym2XeUGq6gw7VqxAGjwcI/sOBTq7UKxy4cdCGReab57EQjd7lOK7 k2ZnwpCiBtLI/UogiOcBY3YUYj3VZBKTPYCZpTYC8fa2mDH7LUZ7VapPmNWE+o46AzLQ FbwvB4opBnimlTzrem140gvVHfMJcANo31DEhpr/g+4CZeKnJYHNmPdqqr5eyc5W0xt/ 4uPDe9u56VWrmXzkYlbXj8eSPfgVILxo62xjS3Iit4vXPzcwZmDwEh+ZSqv7RUna9rW2 DzvudINuSxxEDOaAH4fhbZ3C1CBGHG9V2akhSfPossgwiJ3uYQWzDt8htXMVGNW/SI7s jaiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XnMvhiJL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j19-20020a63e753000000b003aa55f5cad4si2969826pgk.457.2022.06.01.12.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:50:11 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XnMvhiJL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 786101F2316; Wed, 1 Jun 2022 12:13:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244654AbiEaHzx (ORCPT + 99 others); Tue, 31 May 2022 03:55:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244649AbiEaHzt (ORCPT ); Tue, 31 May 2022 03:55:49 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A48036B677 for ; Tue, 31 May 2022 00:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653983747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tvCRh6wMybfz1jQ+oOGAFWgP9hwbhrbOUgkVnS4S7M0=; b=XnMvhiJLjQhQSD+ZDtYpTo6e9kfg8h3FmL+5SnZtvt8erx0DXrlwgg6K/jPl9oSKS/rQPQ ZrGidYshPIIdhlDg5YMazsZlY2fTbGrLe27AUr7ZTucf8SpdG7DFlkv27qajdLvB34OxRw MC6L6u96NeHyjYmK4vlLla/bAbJtqVY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-191-sXXc57MwP_GSPXQrM3jxFw-1; Tue, 31 May 2022 03:55:44 -0400 X-MC-Unique: sXXc57MwP_GSPXQrM3jxFw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C82ED101AA45; Tue, 31 May 2022 07:55:43 +0000 (UTC) Received: from thuth.com (unknown [10.39.194.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id C66302026D64; Tue, 31 May 2022 07:55:42 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: linux-kernel@vger.kernel.org Subject: [PATCH] KVM: Adjust the return type of kvm_vm_ioctl_check_extension_generic() Date: Tue, 31 May 2022 09:55:40 +0200 Message-Id: <20220531075540.14242-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 kvm_vm_ioctl_check_extension_generic() either returns small constant numbers or the result of kvm_vm_ioctl_check_extension() which is of type "int". Looking at the callers of kvm_vm_ioctl_check_extension_generic(), one stores the result in "int r", the other one in "long r", so the result has to fit in the smaller "int" in any case. Thus let's adjust the return value to "int" here so we have one less transition from "int" -> "long" -> "int" in case of the kvm_vm_ioctl() -> kvm_vm_ioctl_check_extension_generic() -> kvm_vm_ioctl_check_extension() call chain. Signed-off-by: Thomas Huth --- This patch is of very low importance - if you don't like it, please just ignore. I just came across this nit while looking through the code and thought that it might be somewhat nicer this way. virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 64ec2222a196..e911331fc620 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -4309,7 +4309,7 @@ static int kvm_ioctl_create_device(struct kvm *kvm, return 0; } -static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) +static int kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) { switch (arg) { case KVM_CAP_USER_MEMORY: -- 2.31.1