Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp791260rbd; Fri, 23 Feb 2024 03:55:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX2LRGmKS/jsqFw2l/2KkQAcFIJ8A3re+KYQfli+cdBPzn7dbO3XQfH6szFsNldIFGLC/WWMrO+WGN7aiG7afLSzb7vO1lLnqGrnOED7g== X-Google-Smtp-Source: AGHT+IEVxut+3kkd4P1JXBvVJ9dOaZQBGqUVvGYbVPzMrdpo7yhfMFRxwFOD34teAW9fk2MSfxC4 X-Received: by 2002:a17:90b:3ec7:b0:299:f750:9670 with SMTP id rm7-20020a17090b3ec700b00299f7509670mr1270051pjb.7.1708689347250; Fri, 23 Feb 2024 03:55:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708689347; cv=pass; d=google.com; s=arc-20160816; b=NuKwebisG4O5DhC6iaMzlRSWakdMW7of0ra6N8DCGexOSnYFmQ27fI47dYM1iUGVQY /GDsdWIsusY5vaWHYr17SROs5J7AGgmNsXQBcjlslJuuLRvGoX3feOttvgHTPsYPAO2f wOl5ZMgtV4rlvsPyQ9Qa/oFifh3paxvZ4u7tLad3SrontLKOU1HcvZBV2oNw0m7uO7Uo UeTwPFsz7g/0tDxEtiOeIxJS+8h8qfeAgjexBgiG4v1WgciIJMVEfaKrAnsnKKwNgYu5 uV2bb3zip6CN78Olu4ga1Flri/H2RRE3qs8fADu9FyRZBKY28B60Zg9fIQEwrOcjS9i4 L5+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=AASS7S/uespnM/8mjuzQ+XIWUthMWCYk2v6ruXBFHJI=; fh=yVWAH+qjENBc8W+DnwvizvHwRB+f/WDFypmctMuObHA=; b=WQM0jCMEcfWr4Y9YOzhoxdj02y0YiLMnNIXqDRtgzacK7vCDQVZ19qBkC+06ybW9lX Q9s+i8JrJvpe27Wjq/0CfKipJBxpKjg96TLgwiFururdaPZ7uQjYIERH4ujMoaL2sx0v p3Aw9KC654gNFTRDrMJgLPRdBm9X9D14gwMHiJeHkh6aUz3lk+1z7FgorfUAK2YH4y6c Wo6W3KLMcVvomTjc8JihdHiDSqfIpVIGgfgZhc0t49bydiP8AhccK3PQOkQ5bR/uY+Nn 1LtrL2XnxP3T2tOb8f4rAjZLcOB94DiujuTPSB4nfCbk5FzMXSwrfDEo644LPa8zREVE uVyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sht5ZwHj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d1-20020a17090a6f0100b0029927708227si1020059pjk.167.2024.02.23.03.55.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:55:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sht5ZwHj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C1F75B2548E for ; Fri, 23 Feb 2024 11:52:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F360F7A73A; Fri, 23 Feb 2024 11:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sht5ZwHj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29DDA692E0 for ; Fri, 23 Feb 2024 11:51:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708689119; cv=none; b=Adxo1ySSjUT1TnQu5ZuHkLKVD/IC24RqU+EFBNDl77S5bm6iQcZb7VjOEBDTnUBTZZTU5sd4J2OvNiY8ZsGayiPEAI2yEq/1xrewpOOa8c4kebweZqReTx4sVLCp5e8G3mCO8DnxYthavLUnxyL6452Y7h8COnNnTWqBPrH0aVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708689119; c=relaxed/simple; bh=v/IYgrsTfauy5qjfc9IS9CKoqO7gauf6fJVHxS4uPDw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Cz7ihqNxQlCOg8exYa5oRseBo7BHzjQTO/6Bw5NFLaxQeXj9Nq7cXEKWX8hbqXfwCScUppWyyjXIxZW8gvG2DKjnZnbozyJxbyvu669TocMtdtcyy4CSrGbl+lgK3Vu1OhzJ0Z1+glWyhhoNZ943mvOg7quVxMMrzE3UdhAGkPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sht5ZwHj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A67EFC43390; Fri, 23 Feb 2024 11:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708689118; bh=v/IYgrsTfauy5qjfc9IS9CKoqO7gauf6fJVHxS4uPDw=; h=From:To:Cc:Subject:Date:From; b=Sht5ZwHjntGAxj9BtZU08wMvSwAvZ23py0Kp5DAfZ77xcfZ14w7W9VfU7AL6axZ2T S/VsHWfrByX/jVZYv4MNV2sHJOXGrSKlaLBhwrXvXx8M06HCIHIjW37tMMPjjQVlS7 pOrMpgUH/aRrFgE1dt78Zlq3d1ytEeXhY1EGP4ktzEtwUTnMZih6ZCM7vB+XNFv9/D 3MQghG+Zm3UvPwama+wrOB8Fq5w7VSOSqO0mmAg3ZFXad1wkcnkQYIYiN6nNcnqM8m nK7PQ3VGT0ne+XWrx3eJceCEHbFou9KuKj4lU0N6Fktj7lSwkVGXKHoQF/w4QovvPO KtExGB2jKX1aQ== From: "Jiri Slaby (SUSE)" To: stefani@seibold.net Cc: linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 0/4] kfifo: small cleanup + linear and skip helpers Date: Fri, 23 Feb 2024 12:51:51 +0100 Message-ID: <20240223115155.8806-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, this is a small cleanup of kfifo. More importantly, it introduces three helpers: kfifo_skip_count(), kfifo_out_linear() and kfifo_out_linear_ptr(). They allow using kfifo in the serial layer. They are needed as up to now, there is no way to "peek" the data without actually copying to a temporary buffer. kfifo_out_linear*() allow that and kfifo_skip_count() then allows for tail moving after the copy is done. Note the copy is usually performed directly to hardware e.g. via outb(), hence the need for peek without copying anywhere. Jiri Slaby (SUSE) (4): kfifo: drop __kfifo_dma_out_finish_r() kfifo: introduce and use kfifo_skip_count() kfifo: add kfifo_out_linear{,_ptr}() kfifo: fix typos in kernel-doc include/linux/kfifo.h | 105 +++++++++++++++++++++++++++++++++--------- lib/kfifo.c | 36 +++++++++++---- 2 files changed, 111 insertions(+), 30 deletions(-) -- 2.43.2