Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4029054rwj; Tue, 20 Dec 2022 05:18:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ThZDZ2T3lvYUmptBvoLgCSK6Nn5L9O7CdrbLDzVcabArSokYGkfrrgPFBugOIdyK4SjDD X-Received: by 2002:a17:90b:1916:b0:21a:4bf:eeb0 with SMTP id mp22-20020a17090b191600b0021a04bfeeb0mr47871943pjb.28.1671542316347; Tue, 20 Dec 2022 05:18:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671542316; cv=none; d=google.com; s=arc-20160816; b=lwX7od1SmDilTMtujNGJu8fMsE+pZ9QbpV0YtiJ+sOIAsa5gfnG1FrrYxcibZFAFvU UJtSjXFZJw8GDcEgX2KRunoLlQ92geZPk57OSvtV8wJ4YBIT5Ty8PoG2hzj+89C/Nic4 N0hshFt3Zv1CVyIqbWuGt9IQWQuF7Pon0AghP+VgLZwrVPDlyuXIGCFI4fPtTr6EHJLe HachdL/kUr8yQ5/QPcEQL7C9+zgVnBaBbWg9Ttvo+1EJtQ3NsqOCQWGQCkxgPO2oMyE4 1pHgIfF1BarHRpfuhtM7Rk86Du1ZTW7wleU5Q9V/7URNzDb0gLdC6nw8uM/lDxBCMMoy xgjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=a9dphcXJKbDgaDzxRRBiVFA9p7kE9yji17UDhT5ug+8=; b=lGSKMnp41IDSNV7OvyeKJil+eqKmMrpFAaoJ/OKHP6+co44JV1Vs9R7tyRPFdQsHaM fdi2n2MBbVwWjJe10i5e9nuZZY46TemIdtxDdHLeXf4Leu3mFVzyU7Lh3MNyrATrjjMK wLQ/ToMD4SmxXP8/Qe0Ocnu3CF0Qccw2rfIeeTiPsUl2ixB8JIwlYa3O4vySHPWlyu8H 2plUpzOFH/gcHzD5bQknxJV+G/8dl6Nr16aK/1naSowDcIa5ByNh9yJQmdft2sKuKWNF IV+4KvKasdAKbyHUWwoC59kOoXzbiyLVZvyDenHBrnUcBomjMJ3X2FQiLE3UfzOkIXL8 nGXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jDlbCVx5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc5-20020a17090b3b8500b00213dc988b24si14338153pjb.13.2022.12.20.05.18.27; Tue, 20 Dec 2022 05:18:36 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jDlbCVx5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbiLTMqH (ORCPT + 70 others); Tue, 20 Dec 2022 07:46:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233700AbiLTMpV (ORCPT ); Tue, 20 Dec 2022 07:45:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FFB913D23 for ; Tue, 20 Dec 2022 04:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671540120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=a9dphcXJKbDgaDzxRRBiVFA9p7kE9yji17UDhT5ug+8=; b=jDlbCVx5ASW9WXd/pM0qM3JKtx5JDLczj05mZ/T2tx3j0JEJLNlBevQSTFkX69JY6oVB/1 b4dITTT2oSk8ueGT+FDcKRgoHHg+EdroInniqMs45LSF6jleOztdCILOUBTeG3O3WVGOx8 UD/5q+Kq63GELU0sYr2RDhIJh1veFRs= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-486-QPCcPzcRNLy3P7IjJkXiwg-1; Tue, 20 Dec 2022 07:41:59 -0500 X-MC-Unique: QPCcPzcRNLy3P7IjJkXiwg-1 Received: by mail-qt1-f198.google.com with SMTP id bt4-20020ac86904000000b003a96b35e7a8so5417343qtb.8 for ; Tue, 20 Dec 2022 04:41:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a9dphcXJKbDgaDzxRRBiVFA9p7kE9yji17UDhT5ug+8=; b=AojLgKbjrw8xOw+luvIwJDIu1NqJp5rCR738Yjz0/emluJUsXJqbrIDG2JGNAtkjtQ J017ucEFZcbeQ0WMaKYQ/MXMB4g8CRfh4E/huiTxZkuzGk6HO9FxMM1E0bi0WpgvhAhF AEnragPuP3Uzjks+glfDtoxUyB+Nb7stfnytakEv69o3i9ejvzAhpQ8mE+CuJOM7K3qg OifyYFj8fuf7TcNhg9pHF7Xd21LaxlbRLXNyhyR818Aw80mgS+ZNXoI7QV4dwZSAdgj6 Q3a0tyCBPGkDJD0zwXF7OWApTsVVWmCwOKvVikUDFYinw3TYvATTaoCoBgNZqb26C8sB 1Rkw== X-Gm-Message-State: AFqh2kqqrKromN57WzZ4lUGcSSOB34vxps89PXAxV7FUt8nawbabqx/1 qKUZQ69W3cgde+V1/kt3XiOnWKwPlreC++4jDtZ9LMAVBfZEktdBslvtwtlrD7PJ0Eg5i7nGEhj XPNiZnBPZn9J9gQCgYVjHQZUVabiwg5KYSh1XbJeKeNmILo2uttfEoNfiSyFk59i65bJnDg== X-Received: by 2002:ac8:6904:0:b0:3a9:6b48:a130 with SMTP id bt4-20020ac86904000000b003a96b48a130mr25323887qtb.34.1671540119087; Tue, 20 Dec 2022 04:41:59 -0800 (PST) X-Received: by 2002:ac8:6904:0:b0:3a9:6b48:a130 with SMTP id bt4-20020ac86904000000b003a96b48a130mr25323850qtb.34.1671540118802; Tue, 20 Dec 2022 04:41:58 -0800 (PST) Received: from redhat.com ([37.19.199.118]) by smtp.gmail.com with ESMTPSA id i8-20020a05620a404800b006fbaf9c1b70sm8781028qko.133.2022.12.20.04.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 04:41:58 -0800 (PST) Date: Tue, 20 Dec 2022 07:41:53 -0500 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org Subject: [PATCH] virtio_blk: temporary variable type tweak Message-ID: <20221220124152.523531-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 virtblk_result returns blk_status_t which is a bitwise restricted type, so we are not supposed to stuff it in a plain int temporary variable. All we do with it is pass it on to a function expecting blk_status_t so the generated code is ok, but we get warnings from sparse: drivers/block/virtio_blk.c:326:36: sparse: sparse: incorrect type in initializer (different base types) @@ expected int status @@ +got restricted blk_status_t @@ drivers/block/virtio_blk.c:334:33: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted +blk_status_t [usertype] error @@ got int status @@ Make sparse happy by using the correct type. Signed-off-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 88d8410ecc5e..73cd5db0d7d5 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -336,7 +336,7 @@ static blk_status_t virtblk_setup_cmd(struct virtio_device *vdev, static inline void virtblk_request_done(struct request *req) { struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); - int status = virtblk_result(vbr->status); + blk_status_t status = virtblk_result(vbr->status); virtblk_unmap_data(req, vbr); virtblk_cleanup_cmd(req); -- MST