From mboxrd@z Thu Jan 1 00:00:00 1970 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C343EB64DC for ; Fri, 21 Jul 2023 14:00:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7569A201; Fri, 21 Jul 2023 15:59:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7569A201 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1689948014; bh=zqjR6hm055Hl9z3dKM2WeMRqxZN0OBDSyb3Rxgd4HGM=; h=From:To:CC:Subject:Date:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=AUMG16NF+oyLliC+REWZ5S5dBIXxuzT6KWlUOVBrRdzAPzvzxKZY+AeZJdZkQqAOz Hf25NPT6ZX/CAvfWLRALa2SI2EU2iEb5103n5fJZ7jebRezDcOIFnrN8d5aDbvACZP F1s10IA03U9jFIMvhe2+vmRJszMJ4CtrA5qqy/3g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 279B9F8007E; Fri, 21 Jul 2023 15:59:01 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 59617F80520; Fri, 21 Jul 2023 15:59:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DD435F8047D; Fri, 21 Jul 2023 15:58:57 +0200 (CEST) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5E777F8027B for ; Fri, 21 Jul 2023 15:58:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5E777F8027B 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: quoted-printable Message-ID-Hash: AXR3FSKPZ4CNVWGUFUGDJQJLG5KAGWJ6 X-Message-ID-Hash: AXR3FSKPZ4CNVWGUFUGDJQJLG5KAGWJ6 X-MailFrom: david.laight@aculab.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Andy Shevchenko > Sent: 21 July 2023 11:42 >=20 > 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. >=20 > Any suggestion for the name? > And I believe for the bigger series the new callback should be added firs= t. 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. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)