From patchwork Wed Apr 19 14:09:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216952 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0881C6FD18 for ; Wed, 19 Apr 2023 14:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232321AbjDSOLW (ORCPT ); Wed, 19 Apr 2023 10:11:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232338AbjDSOLF (ORCPT ); Wed, 19 Apr 2023 10:11:05 -0400 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AF8216B30; Wed, 19 Apr 2023 07:10:52 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-2f95231618aso1846693f8f.1; Wed, 19 Apr 2023 07:10:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913451; x=1684505451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KLQcibH4QQVSvQQ/bVwiqZIZ4Gz6ywI38VTMDoqxjbc=; b=b3mYxQ4D4Hvby8nYejKKD6gSvlP0G1soFUBrT89jgGIjcKCZ+WIZMtE4WLCn9yoTtE rGuYYhPYS8LkadNFhiemFc4wYqeZHgzXGRteloJ3O6zj4LvI71kS9/ACV2dUsnXb82yg OgSrdZlI99va+gM4250fynOrKxOY+I1BcKwM6cIiZl6INcTrE8AhlWiYgaJX8Cc0FPMR fZthulI6xBxobixoHX8R72GDunGMwiTNwxv70pRW6NuXFpb4o50q2lxpnR3yalG2siYW LaaVc7KTb9FwvQBM5Zr9KztlM0EERYMosYXEHVoTvrUoPANkFgtaK/BUhjAcjMDaCkTe 7aPw== X-Gm-Message-State: AAQBX9f/L2iuF22A9Ha6IDDFButmBAqlpwXvb4KPK7xW3Bnj0CKF6bVf PmtHsEt16LxBIeczSaKm1uc= X-Google-Smtp-Source: AKy350a8pHXX4xoTqjmCp8VzLpP9Mr6nWBR11mzOBYZ2TpzRIUZcgG4OmK15TMBBeqCZ8wsfO4biJw== X-Received: by 2002:adf:df05:0:b0:2ce:9d06:58c6 with SMTP id y5-20020adfdf05000000b002ce9d0658c6mr4762888wrl.53.1681913450788; Wed, 19 Apr 2023 07:10:50 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:49 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Damien Le Moal Subject: [PATCH v3 14/19] floppy: use __bio_add_page for adding single page to bio Date: Wed, 19 Apr 2023 16:09:24 +0200 Message-Id: <20230419140929.5924-15-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Johannes Thumshirn 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);