From patchwork Thu Mar 30 10:43:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193833 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4DF30C6FD1D for ; Thu, 30 Mar 2023 10:45:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680173099; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2t/nMrUkWqPmkzvO61ZfXv27K9hfcswzY+5Buj76//M=; b=O+O37MDph80Yj91eaJ0wvkFJbYeXXRWkXMhZZKAeglOWbuLCSwT2lsbbH1JJosFPtRFeQf w7tU5kLSvoQliG8jOUHnoyAxx59biNnCYbpafQkI5K/gkt+hNPOoIPgnh360ZZ+6IVf0FQ g3rWlfVmakhs05ITTP6365RB5dSslg4= 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-3-jXwhiG9APFuil0Sk8iNQSA-1; Thu, 30 Mar 2023 06:44:56 -0400 X-MC-Unique: jXwhiG9APFuil0Sk8iNQSA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6844685C064; Thu, 30 Mar 2023 10:44:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 572BF492C3E; Thu, 30 Mar 2023 10:44:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 45B6E194658F; Thu, 30 Mar 2023 10:44:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D24D31946587 for ; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C2781C15BB8; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB1E1C15BA0 for ; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9E7703C11784 for ; Thu, 30 Mar 2023 10:44:52 +0000 (UTC) Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-599-87uQbyGQOJiEami38Kxvmw-15; Thu, 30 Mar 2023 06:44:48 -0400 X-MC-Unique: 87uQbyGQOJiEami38Kxvmw-15 X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="338948173" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 18:44:47 +0800 IronPort-SDR: Jj7zaSYuKT6EQSljRkHahOEv+IPgkJq9m39R9RyUkrpQqWHmNoCVoDcS/AJ8ZL1IF+MpQyqLVt tVohzyZ0cZhLL4z1Le8a9pabbWldzEWaiacI1v8G7lRMOlcthvlYmpa+rN2jGgdSRBWcrpfZ+y R5BNG1fa283bU05PxcZMgg7QP1xxoPhPRYxAcHtHpIV8IGq662vGhs3MtIpJR6LY4QV0xEtEtk 81Kk0IMoq85FC45KaMVsuAdIR8WF2U4JWnS21UfzNgFhjzDOrcM5ymJcF2pFXgYfblp5FP16h7 4t8= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:55:14 -0700 IronPort-SDR: bPTbKVKtlEcHRrx/gshidhFG8cTmJ7BMiKZMBOrx7BvqKjv6JDBLA7DtLgnQ8cD5tBy5QB4Li8 EChWA24CGnvJ2Bor2+MClUrPy+r+I5aXuZR5uVZa+29PcBU56ON0tvsmmOLEdtLGgyfwshq8on uLUa5y4KbY1OsCGTLPOq9tHpy9dt3I1YsfvmNS3+L0GgTwHGeuOWfftTPpLJxuguO4KUD7Csdp y4baPtiMCCJStynBrqY2vXX+RwLmiiCo6Jnox1p4aCnNgMOXQOiTLaht7Zdw65/ETNfesjB+DJ BFM= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:45 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Thu, 30 Mar 2023 03:43:56 -0700 Message-Id: <35c82b6fbc054342cce6a2084707bf3866813f33.1680172791.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Subject: [dm-devel] [PATCH v2 14/19] floppy: use __bio_add_page for adding single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , David Sterba , linux-block@vger.kernel.org, Damien Le Moal , linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The floppy code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- drivers/block/floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 487840e3564d..6f46a30f7c36 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4147,7 +4147,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); - bio_add_page(&bio, page, block_size(bdev), 0); + __bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET);