Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10969438rwp; Fri, 21 Jul 2023 07:26:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlE3T8eWSNmrxvSkB6ajTgFuW3Wr1f0PyGNHspLYi+ReWf96J3imRq3skhcGzG0+UhX/Yj0b X-Received: by 2002:ac2:44c5:0:b0:4fb:85ad:b6e2 with SMTP id d5-20020ac244c5000000b004fb85adb6e2mr1425406lfm.50.1689949586876; Fri, 21 Jul 2023 07:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689949586; cv=none; d=google.com; s=arc-20160816; b=MCVualQqdwHp1vRXFtI1yoqimTdXTQbgY3JR9jAUNeTVl7XT+9MsJgc55bjkkoIgVc G6iArQi8ywcL215VUmFqmCFmE4WhAjgWZwUGjDe//I43U2bc8gThUFHd+8glUfjjWZPr i6MGtz1wpx+Gjyxmg3AKLeBH9uEB6wkbVzHRevHsDnkjKx6/Tgfsmv2hxRlPEoCnXQ+1 Mz0Qey3Ul72DP2IQKS5KoxZOQMGI3YfApi9shfLNz8ltGppBbeqS+Lt7u0zUS5xuw3SB f/F1mFHvz4J0gDmHSbAigEGXU0Mk2mWOtNjJtqn+6DakwTxYDYjQYoCwQd5uyAAbHiMc IMZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=f5x99Cmf1cVRbKFKXPYArDjK6VVkMPWrzzg5u1hHfAw=; fh=R3QeH16QrwrWV4OoRKThmu9YkHKYHjHR2Ry0fL/dN1A=; b=EUnFxHxAWBT7odNwiVA6zYiKifNGc/cxLMRG89hl6EGdiqrQwR+4PS/mZCowOhzn2h 8y4i5WwaT5xn6qQb+MDKj1Ix9JKK/tbs1wwAACxZQw205YUUo8vPrOwrVb8ETo8exLA1 PjRu6I0Ko/8bertXAgPBqco0hy4BZne+nD2AOlLEWRZqLfNLn4FLNf1uYGusOuS2oUbp C7y5hOhEtl2LaonBIlmZwRtqzwQBLGEdv4OhWRlmmeQIyeX2CD/F/XmsRARFCsYe7Xqp 24NHUIg6GJjrv3avajJUYfNYvSdrn+ZFocHBUm1bpUVCLBO1ra0gczG5yzZtKRQQXjYF mX3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c1-20020aa7c981000000b0051be93a4395si2337007edt.52.2023.07.21.07.25.50; Fri, 21 Jul 2023 07:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231684AbjGUN7T convert rfc822-to-8bit (ORCPT + 99 others); Fri, 21 Jul 2023 09:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231752AbjGUN7H (ORCPT ); Fri, 21 Jul 2023 09:59:07 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7094A3A84 for ; Fri, 21 Jul 2023 06:58:56 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-27-tUZJkKfjPuSYNBamH4xjCA-1; Fri, 21 Jul 2023 14:58:54 +0100 X-MC-Unique: tUZJkKfjPuSYNBamH4xjCA-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 21 Jul 2023 14:58:53 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 21 Jul 2023 14:58:52 +0100 From: David Laight To: 'Andy Shevchenko' , Takashi Iwai CC: "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "Jaroslav Kysela" , Takashi Iwai , Dan Williams Subject: RE: [PATCH v1 1/1] ALSA: korg1212: Re-use sockptr_t and respective APIs Thread-Topic: [PATCH v1 1/1] ALSA: korg1212: Re-use sockptr_t and respective APIs Thread-Index: AQHZu8ALiLW3NE9rpEyBJunRSGnWfK/EPjVA Date: Fri, 21 Jul 2023 13:58:52 +0000 Message-ID: References: <20230721100146.67293-1-andriy.shevchenko@linux.intel.com> <878rb9h901.wl-tiwai@suse.de> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PDS_BAD_THREAD_QP_64, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Andy Shevchenko > Sent: 21 July 2023 11:42 > > On Fri, Jul 21, 2023 at 12:08:46PM +0200, Takashi Iwai wrote: > > On Fri, 21 Jul 2023 12:01:46 +0200, > > Andy Shevchenko wrote: > > > > > > The sockptr_t (despite the naming) is a generic type to hold kernel > > > or user pointer and there are respective APIs to copy data to or > > > from it. Replace open coded variants in the driver by them. > > > > While I see the benefit, I feel this is very confusing. If we use the > > API for a generic use, it should be renamed at first. > > > > Also, the current function actually follows the call pattern, and we > > know in the caller side whether it's called for a kernel pointer or a > > user pointer. So, if any, the PCM core callbacks should be revised to > > use a generic pointer instead of fiddling in each driver side. > > Any suggestion for the name? > And I believe for the bigger series the new callback should be added first. It would also be better to replace the current sockptr_t with a structure that contains separate user and kernel addresses (instead of a union of the pointer types and a flag). The size of the structure wouldn't change and the code might even come out better. There is also scope for adding a length and passing the structure by reference instead of by value. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)