From patchwork Tue May 2 10:19:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13229181 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 260D4C77B7E for ; Tue, 2 May 2023 16:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C5E16B0071; Tue, 2 May 2023 12:59:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 976966B0072; Tue, 2 May 2023 12:59:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83E866B0074; Tue, 2 May 2023 12:59:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 720D86B0071 for ; Tue, 2 May 2023 12:59:03 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id F2A271A101D for ; Tue, 2 May 2023 16:28:53 +0000 (UTC) X-FDA: 80745848946.28.56D2F8B Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by imf05.hostedemail.com (Postfix) with ESMTP id CAC84101633 for ; Tue, 2 May 2023 13:16:46 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=RJH0mIwp; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf05.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.141.245 as permitted sender) smtp.mailfrom="prvs=479dded8d=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683033481; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6gN+DiTA+/9c3wZqFyeMfWipuKVVV7MzHdNdjuLDekQ=; b=d+ercAfOLIvuPcSMv01465rm2MFjryUoVTHEbvVVwAOJrGYCoPHzRPS1Ulb6iKXMLJcr6k JPffmHu/2yNIK79tfbHnxoB59SkiuRzN4yYuQL0pzKyTjrQwa6wvQoON/IyLkyvQlBJUfh fjfkj9rseJ4vck2lBLO+1XdHCEwmYJw= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=RJH0mIwp; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf05.hostedemail.com: domain of "prvs=479dded8d=johannes.thumshirn@wdc.com" designates 68.232.141.245 as permitted sender) smtp.mailfrom="prvs=479dded8d=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683033481; a=rsa-sha256; cv=none; b=4gA13y9+ec/Vp/AN96/bKbRctdDwjYzSWrjt29nQ0Mrj3Vssrq+s2cG/oxW6vHahqo4rRZ 6vDr6SV5GKBPB4HsQxtWbi1eqV+LCCdN3stNvE06vIz8eeCZY4zIHBuke2cmBJCSNMOSrF rW4aCBtFPTJIXI/w1FtfDcT/x8lEChM= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1683033481; x=1714569481; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lM+HCnb2fRYqmeoa2+i+xDIe68f4nLZ6E3joh0Z1hsQ=; b=RJH0mIwpy+r7+QZ3R8nrgISsX8DLbW3SwAObC84eKiKPNaV4qu1diaJQ E3Fq7aBYw/RaZZwwu45VMVWdyM/zQ7kGlY2eyk71OvL7hpw/CyNlOib5L o544QxkLhRYYgMOkfylplgWpI+IFRnJ113Tf0qVztKpupxR6PS/JLPn87 1e5QhNlGqzBIjJK2QAX6tXHdflqBpMYqcx0kX9sxy34BoSwuBRjpgs7yT K5bvjv6l4BeJbq/0cjToVkZwm40pf9aKqfoz/Gm6bIMJ+iZ4gJjwyveaF I1iBm+NiJRTM4of3UU+iVFD2Cpw2Wyw5ctfBQOcGuCLOa+tY47E9mUz0q Q==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="341747200" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 May 2023 18:21:32 +0800 IronPort-SDR: KwADaa3xjgp95S5leiZ4DDbD64Tv/UdExHB5AuqQxxNSlxIdNJ5ToR4NEJoXvt/DLfhTZrUe91 A2d785Dmy15+NM6eA6CBejwpYt3T9tPKdM36C5fdjF4HI13I6MUGmPCU7MU+QqoLVkb67ttIHd Y/5s9XNRE7ONwljdt2KL6pKbSrA1G+k4jZ9HZQ+U2aYY/PUhK6TJhahaU8puCkMRzkgXD290rE YC0FsmqI3MDge8hxewYwYjHDhkKkXWs++O732usdBctNvSp8VFlWNZHd1oqUXUK2dued8ktajP JZo= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 May 2023 02:31:20 -0700 IronPort-SDR: TkiaafEvpeoB5UVbk6lYF+MYIKTW0x1TS2RRFIsFup5dg77OzPOoA5o4aAAos3PeRXd1TAf24l JlqeganwqRXCePrMzLLQEwqwOlT9adKZ9UM/6C0SJSTqBI7//XMecxlqe0zSjF0DpZR+H3rbbZ XfOqZl2WmlO21QDDTnBVjbgyy0RtJrgM6I1boLg5EX+OGdLvmaW0Ll6RgEcSoJodKWqqflGCKs Tu8A1VT6jrxtAAfmzI+1Km/Qb4+fbicaPop5zyn8h+LvanboVG81oLtfNfwngSXAbDiAnyp6YK ZDE= WDCIronportException: Internal Received: from myd008205.ad.shared (HELO localhost.localdomain) ([10.225.1.100]) by uls-op-cesaip02.wdc.com with ESMTP; 02 May 2023 03:21:28 -0700 From: Johannes Thumshirn To: "axboe @ kernel . dk" Cc: agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@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, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v5 12/20] floppy: use __bio_add_page for adding single page to bio Date: Tue, 2 May 2023 12:19:26 +0200 Message-Id: <20230502101934.24901-13-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502101934.24901-1-johannes.thumshirn@wdc.com> References: <20230502101934.24901-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 X-Stat-Signature: ndowm66m6bzinjhidmdfa1o73abkf59g X-Rspam-User: X-Rspamd-Queue-Id: CAC84101633 X-Rspamd-Server: rspam07 X-HE-Tag: 1683033406-30714 X-HE-Meta: U2FsdGVkX1+myHC0v1UuVaxRsNAl16rMYfy1QxiiSTsp5e01ZC00GpgJ5eBEudNQ7Fh6sMIZc3mP+RhIDB0rPeyABHWfSiKVOxIlgM5zaGcKmjPjxkfwX1y8dZuwsIG2g2l+qt+jJXtx8n4L3MEUnhl9kCV+biQRxk6RMtReWljPcAyHhqJJ6JtDInfU1rLbXEvNelxU8eW1OWZjbqY7tg9a2ixW2g2PXdNVRoRFyp1Y2dNBnPcKjG8gqE3w9gCC7Rih0Dy63bJCnPfn9zL8hRiF9Zh/lTElgeb14vypviq0IWiHzl7pJvJcbXzkSG9cwQeIz9UJnudB6B35LwVXQeJZTX6icEcksaw9uHhJbGAkXNmDoiQ5yiMhzGfLKDo33xq2TgcGrQD+IprOnXXAW3kb/W+w7hyOMCOLeXzlWLOVPQGpPGqTftl3ZkvZFbqD0Msxh92WASx9d5SnN/pTFnuNDq6cVYlWQ3vUsYw5om6O5XUNVbRbWDnuew7advgeZ5HCSs9TBsacMlLN7MY61GmDXbTBo7GZEVdrsPNpoEdyDWYIGHL4+He1gNIPC5j22moEXS2qViFxfNohgi4wYI3rTpXTx5lDco5tMprerta5cOZANzmKOIWDHZIu1chIu3dOZO6pp5ErPNkXH0EXAlRuFIEcfqv2laqqPwx24Kdy4AwqJd2LK4/PsG5Uc7H3soFQa4JbuWokU36/RuyVItqYpV3/mr+3+dwdfJJ0ec2kLpy9LYzvx+wwYtNgxf2a3RJNEvfzFWlJ2AAE1BcixU2AkE5k7CtzqUaJuGaPdpi1HRdkSw0O3uVSXuJ4OxCpIaTXqvwNktw/VJTHvWrBX0ECd3HUjnHZf++A90twXKFUnwowLeqne9GM4tlMznolcVWc7w2peAnvs4poJ/fU3ESZOEE/P014robCfk+JP2UK1N2/x6uku5uuYTgQm4J6HvK3Ru1JQirfQQDaGR8 Hlk5Pz7k ZyfQdJ3M4Ql45MmwAAQGtgCEPmEULG7ot7NHu0eSpVQM3MBYU1wgOD8tx7Xojv53CyrHVPLJmpWpwcfEVKldQEltrwfFtXA3UwJ9rBOCnnEVD86Ny1YbE/OAYuYCBPnhMsGEpeLwhRgVC+9TVLYjDd7h6eY5C4jpFeZNaoL3TZ8LgUcjkRA4/YTtnfpF8WoxtFXIiQeNy8lvZ5BPFXLepmuctgl9GDrCyTCli X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- 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 cec2c20f5e59..28ec6b442e9c 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);