Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp59156lqj; Thu, 11 Apr 2024 09:46:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXv06z0VdTMP+CWDtfBaFrtFgq8gPUlF8iO49YgPyU7FB6ecWkWVDQj5sNHmd3ECZccqE5MbapdRpjaUJGNzKfQGMEZ43XV34Zp1+IDUQ== X-Google-Smtp-Source: AGHT+IFHrYUSLDbNoRl9psQ2I2BblOe7TYBshPfVrBsbu2lxfkvF15iMN24rcNSu5daSBFcHPWjY X-Received: by 2002:a05:6a20:718a:b0:1a7:51e1:258c with SMTP id s10-20020a056a20718a00b001a751e1258cmr308709pzb.61.1712853992034; Thu, 11 Apr 2024 09:46:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712853992; cv=pass; d=google.com; s=arc-20160816; b=i7Gxv3AOrgwZd2RgKnNqwrooGXafropjk1zhZeLQg+KqIZ816iDh+tJH/mPxaQuY2h WA1d6k+FH8C9HEsIbtcC4/Tbre/U6zZWznPDNi4hYx/dS8tgQeX4wI8j0hs20D6uBZwI V2SCw0XyF4/OJ6tGNPpk6Oc+duWmdxvWuZ/xck3obG9h3iGbI7r7bJhqm8d6ZI1osWJ/ HGUbG2PpmJaRz/g5SiptMfBhJ/rNJDcPomiCo7ddzJebwZw1rINC6kl0iVJ0c9XHCzuD JcH2063GwQmuMmu9a6Foy3Bn/MXVnS4Sh6K17SKYitaFuM/boe4BWzQmYWmG6auwqm++ 1b9A== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uL15F0ClScthbUxssz2YLqWSnBS/ZEF5VqONH3UoJfg=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=isqHjs3IFYrPcs/WIjoezilaKIsa7KJOI3JrJc7DCmqN61wbIyXACRPpR+UWbNOr84 GV7p0DjDP0T6yoSEjVPAzCqJ8T8oNA+U6nJ1+18pgjhwXAcHa3StbkpypI1uB4EVDWtI 2Am5NsKV04md+KsH4StemIIfytca/cRvvqpXVHnMWkvtIthMcg0iw1gGztNPiZTh0o4o Y967BUfHSFTRPg9fYPIbYojrKmO9+sYj3oftjEKql/k7mM4ObnsmA+GGctI28dLEOtBB z26U9Y5y8JPv85NI3MjePvIcz9PmeejdUg8FluQpoWaKxds0+RrOKkgRh/Xc/qjz0opl 0RXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=YU3GpDXv; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-140942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140942-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n8-20020a170902e54800b001dd96e5febesi1591910plf.190.2024.04.11.09.46.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=YU3GpDXv; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-140942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140942-linux.lists.archive=gmail.com@vger.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 CFB6BB24AC1 for ; Thu, 11 Apr 2024 16:18:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41A14201262; Thu, 11 Apr 2024 15:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="YU3GpDXv" Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3801C200137 for ; Thu, 11 Apr 2024 15:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849794; cv=none; b=ASg+zrT3y5bcwxSgQFoJP1ccmsk+XzTXjbm8DHm5hWoJDcRjl7Nwpyn+1HkS9h/8Je/DO2FOqz37bWg79GSKnUXMntodvMlSyJzyB4mtfHkeHaf+DK+/2caL+DayAJhEgtpO2KsU9wCvegcirjSNzFVbSiDsuarhzb2r5Y4FXmQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849794; c=relaxed/simple; bh=HF6LMEYfoWSFQPO3QyPGLT0EkvxS9ec/1TTiEkjzb2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L8u8ptv95REoRuOpHpCRaV35YwAiu7qFRNetImxsTxhiZq/6jPZGMlIg5/Emaq2M/wHtPVJ8Ge1jou3OThm9qaxCgG7oRb02nFPW+BcR2iIuCAnp6uigfoOdTNxt/9XEH8/9XFIutQTmB9aZj2qN/W2uYcdFW/I57zrb2TN5TpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=YU3GpDXv; arc=none smtp.client-ip=209.85.166.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7cc0e831e11so170522839f.1 for ; Thu, 11 Apr 2024 08:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712849792; x=1713454592; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uL15F0ClScthbUxssz2YLqWSnBS/ZEF5VqONH3UoJfg=; b=YU3GpDXvpEcIkRe9CwxDLOT3YH8vb0kyqePIf849KdU9UMcuhvG0u5DZbTU8Mt51cf ryzcUuO43tDfYa9FGmPm2wDosBejGbgao7vkcV67Mk1KRn5UpKjYyPCkyVKdPaaGWdJt BuTDKbIHhWPjXsZTEbedUibidjHwmBwbp8k/gw2qTcd1LyALYw2NsHibHfFwEmiumk3y U4OQKcYEOCpkz3kILMMQpbJxd9uVgeuBNRPZeMfqf1oBgSmBbEGHE+Di3Dr9wjw0/k+P TCAeL9ondCVd7BPsAfRt/N6FjoqNw2i+/XtYS9xiS/fDdM/tQCact7GCk0xsQBxDwLX0 LuCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712849792; x=1713454592; 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=uL15F0ClScthbUxssz2YLqWSnBS/ZEF5VqONH3UoJfg=; b=hzilUfyuWfvTcOKQU8SJwOBsXDlegWZdybBcQGcwifgYaVNI3dgcXoYZtVHhO/GUjz croD3GVL+0WutYXxd48Pp9jcHAQf2LHUab30L/zvxLXrNdLA7CuwhUXYG+WRLsYn31Cm AoTX13517W3iW0XgG3EeUNWXtJ8hB/ONT3bsnLZj3+07H/NijghmjF83ImBXufI+YLF1 KUB4iv0ix5tG3uGW+wvN5XcHi/8e5SlGvV3rjoO1UxxB993jd6+i8wllRxchVYzaeoyD ANR2w3oAqqNPWbc4sro4YSAF6dnrfvzoFZOkPELrz+cHbUJrmd5pGGyPEsaJRcd4n/uJ HjLg== X-Gm-Message-State: AOJu0Yz5TKDWT7yoFCtzotXUIkhfqw3SEvUaZN6TUzxOrut0BGSi7IWN 3ixU6xJYoud+RnA+4zfg8TWAyw1FpKJV0h4Y/qh5IP1VhGJauDrmNYu9qi/d5TN9u7yptoS1jY4 L X-Received: by 2002:a5e:9907:0:b0:7d6:751f:192 with SMTP id t7-20020a5e9907000000b007d6751f0192mr181575ioj.2.1712849792035; Thu, 11 Apr 2024 08:36:32 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:36:30 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 173/437] usb: gadget: atmel_usba_udc: convert to read/write iterators Date: Thu, 11 Apr 2024 09:15:13 -0600 Message-ID: <20240411153126.16201-174-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411153126.16201-1-axboe@kernel.dk> References: <20240411153126.16201-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Jens Axboe --- drivers/usb/gadget/udc/atmel_usba_udc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index b76885d78e8a..318e9152f295 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -122,6 +122,7 @@ static ssize_t queue_dbg_read(struct file *file, char __user *buf, return actual; } +FOPS_READ_ITER_HELPER(queue_dbg_read); static int queue_dbg_release(struct inode *inode, struct file *file) { @@ -163,16 +164,14 @@ static int regs_dbg_open(struct inode *inode, struct file *file) return ret; } -static ssize_t regs_dbg_read(struct file *file, char __user *buf, - size_t nbytes, loff_t *ppos) +static ssize_t regs_dbg_read(struct kiocb *iocb, struct iov_iter *to) { - struct inode *inode = file_inode(file); + struct inode *inode = file_inode(iocb->ki_filp); int ret; inode_lock(inode); - ret = simple_read_from_buffer(buf, nbytes, ppos, - file->private_data, - file_inode(file)->i_size); + ret = simple_copy_to_iter(iocb->ki_filp->private_data, &iocb->ki_pos, + file_inode(iocb->ki_filp)->i_size, to); inode_unlock(inode); return ret; @@ -188,7 +187,7 @@ static const struct file_operations queue_dbg_fops = { .owner = THIS_MODULE, .open = queue_dbg_open, .llseek = no_llseek, - .read = queue_dbg_read, + .read_iter = queue_dbg_read_iter, .release = queue_dbg_release, }; @@ -196,7 +195,7 @@ static const struct file_operations regs_dbg_fops = { .owner = THIS_MODULE, .open = regs_dbg_open, .llseek = generic_file_llseek, - .read = regs_dbg_read, + .read_iter = regs_dbg_read, .release = regs_dbg_release, }; -- 2.43.0