Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp970406rdb; Sun, 20 Aug 2023 10:46:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDX9TMB89gVvQXpKN5tvZO9bASN0I8noqmEhA2+ugZlfGOwJyQ/aOoToYE59Dfmw2rWrEG X-Received: by 2002:a05:620a:4481:b0:76d:9ea7:69e4 with SMTP id x1-20020a05620a448100b0076d9ea769e4mr5008625qkp.28.1692553590524; Sun, 20 Aug 2023 10:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692553590; cv=none; d=google.com; s=arc-20160816; b=xJRRXxh7swlhUjs/C/anli+6mKtNvEL9d3XCUJZghVFCe0YPHGsfeIGQHQ5/lCItz+ RYfw1FEZMT71Tm9AVS7bNXoWpPc/LsvWnCoZuCWdCsFWDBk1hz+4IvuJAbf2zOvJ2lle QDuFTZV6PhMloPvryesfn7UV5RoGyT49YwdslRR7sPqVrTQUTW0HTVjjbOBqLgaEP2gg pjtqgR7Qrnxc56V/XY68fVDal+ibPOkuzKVAU0zNL+TMkCZ+X0jMYX+8uX2KNL0JgchH unZuZQRZCR6HcQCTy/o9Yp1graCg1qUgyXm6llUSxgoyCH1EpEiSSac591MMkJumsoA3 muHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PukU1OiKGCaM3Gmb1RzhUup8WkSa0BGsgtWLF72+9EQ=; fh=YfyT1sQdAu9g1lL6gfL62aL5sxZqv3B3B3hCNewGHjY=; b=SVHi9JSZYJ+7rn9mXDlenZ7rXYxFW1y4jmacxViYRsj3dgY25emYnPDTh0SAzL1Fcd oggls83c3bldJcsCAFswwXWjFvOVZ+jPzKZgS3ioIJOAAl3NDrzjTnQ0sjoAyA2hqIVA JjP/JB7Zyi9YhxBrcI1WPiUPT0Rnp+bvTsJRFvVY0b7Y2ZrEjA1Ii0aTGIafVP8Biosk 1xgDfWS/MkksajGyj3nd79D0qa+t4Z7fkhJ9njM4ZpbYAPhtAPAZdXKDHkXBNEgnE+jo upcoQNJmFMP0cXEzYyjo3gd7ergUUZMHck3GFVUXxyGBC7CmzQmD/2ENLHKRvyqwPpGx y1lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="O9Itv/dg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k5-20020a632405000000b0056535e2b751si5662889pgk.782.2023.08.20.10.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 10:46:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="O9Itv/dg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EC8E23DDC91; Sat, 19 Aug 2023 12:21:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237160AbjHON6z (ORCPT + 99 others); Tue, 15 Aug 2023 09:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237461AbjHON60 (ORCPT ); Tue, 15 Aug 2023 09:58:26 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0929D19A1 for ; Tue, 15 Aug 2023 06:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692107895; x=1723643895; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=AMwlw5rr1xM9LnWBVlGLBOruP5s9VUwls2zs+mXeGDo=; b=O9Itv/dgdOHv2eCAyl0pdJ4dEBPw1a8QuxnqavR93JHEoMB56zkqH+DL ij2UF18Kmweeke9MZPp69ZX7IGQIqBeMgUuiMVCnslcsLyPhM0jkQ/Es/ oPQJpzOLWZ0xiZRmxVrOXotyQYyf2CkKa+N9u9gx8ci5xcdWOEL2Wx36i POp2mgsffopWibLmGD9LXy9rxPmtGSR7Rjlv8EyXjCQRjAhGazXmSBMPn THaIhq2pp5Y0G4q11lZK75Aoc5v/k7eYCmvKcUFwNBqbK06s5iBVRTbBP fv9JpjT1qzQe792xRbnT4XRlFPk0EsKYLrjTgMjfF6NnhfBz48s/BFH22 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="375050874" X-IronPort-AV: E=Sophos;i="6.01,174,1684825200"; d="scan'208";a="375050874" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2023 06:58:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="683660599" X-IronPort-AV: E=Sophos;i="6.01,174,1684825200"; d="scan'208";a="683660599" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 15 Aug 2023 06:58:04 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qVuYd-004Act-0n; Tue, 15 Aug 2023 16:58:03 +0300 Date: Tue, 15 Aug 2023 16:58:02 +0300 From: Andy Shevchenko To: Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Mark Brown Subject: Re: [PATCH 19/25] ASoC: mediatek: Convert to generic PCM copy ops Message-ID: References: <20230814115523.15279-1-tiwai@suse.de> <20230814115523.15279-20-tiwai@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230814115523.15279-20-tiwai@suse.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 14, 2023 at 01:55:17PM +0200, Takashi Iwai wrote: > This patch converts the mediatek BT SCO driver code to use the new > unified PCM copy callback. It's a straightforward conversion from > *_user() to *_iter() variants. As copy_form/to_iter() updates the > internal offset at each read/write, we can drop the cur_*_idx counter > in the loop, too. > > Note that copy_from/to_iter() returns the copied bytes, hence the > error condition is inverted from copy_from/to_user(). ... > + if (!copy_to_iter(bt->rx_packet_buf + cur_read_idx, != read_size ? > + read_size, buf)) { > dev_warn(bt->dev, "%s(), copy_to_user fail\n", Forgot to fix the message. > __func__); > return -EFAULT; ... > + if (!copy_from_iter(bt->tx_packet_buf + cur_write_idx, > + write_size, buf)) { > dev_warn(bt->dev, "%s(), copy_from_user fail\n", > __func__); > return -EFAULT; As per above. -- With Best Regards, Andy Shevchenko