Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5822175rwb; Wed, 9 Aug 2023 09:31:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTVC7rChvuKSqNb3lz2WF47cq5fkahm6jPSdY7vmMykhIqzJ5pSA8zdqez8toPmwU4my7Z X-Received: by 2002:a05:6a00:1884:b0:66c:6678:3776 with SMTP id x4-20020a056a00188400b0066c66783776mr4326130pfh.7.1691598704202; Wed, 09 Aug 2023 09:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691598704; cv=none; d=google.com; s=arc-20160816; b=AGsO18x/x4izwgR8r71kL5mzVCmCOoQNZkX74NQupka1FS+/twCjGjHTIiTEs02YDX IMf472paXHkWnKtgTdTevNAjL7hoGzzFzdN/Ch/IH9G4JNKlNWw8vgdAcnoT2Wm2j6mb e7n7mDpg2rGeKx09YoW7iIw9Df7YYdHlgzmoP9Aqz00kwjstGqx3vsy1MWS6FKytsrzg bYhM+dyB+oYBItUp26IvFk3VlFu9lzdi0y44OFuEGBVLqg0JRm2GyOl2Rvs3sg7fwRyz 14zRwop8RDKcVIBc4M+ckWGku5PRu1xlMz2vE37B5REmmVKSzmpjqUTOVuqRD3V8PuDj fcQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pKgMv/zwB6Y77QMgXunD2xiaajtdokS/KsQJJ/MXzU4=; fh=NSkFotND6f5n2CzMUgfO7aVimyigURJh9i0vO3oG4pQ=; b=X7uB36l85VwxxObfW84NsZh/11vY5lRI6Cb0REhuPDeHAOJFWY8+o8wiCtR+6D/Z+u oHQmOCKPjWnJE/cVRK+5i/Qf5sCANFEIJ8KPmiMR8tRcz1vORQBO2pBZEA5PAADbTG9d fuO1X6AmKADnMHOuGwzGXid+CGO6jWb8VUN8wyENMyKDI67HrrkpbsI3jNL2PaLUnwSG nHI9ZwHqBNJQ3hN9O1x4D4uCLP50HxQFWl2L0tQJcpPP5rwOaToi/rrur2glBsUr/hDW e5OggNTtk6Y7cGxFzqwhidUQM4rBMzLaCttlsi/gqsbFBVW/BxdMmOCIMDRj6Vc8Rce/ hIEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=OmBebYbe; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a637705000000b005649a48340esi9516842pgc.797.2023.08.09.09.31.31; Wed, 09 Aug 2023 09:31:44 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=OmBebYbe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbjHIP7u (ORCPT + 99 others); Wed, 9 Aug 2023 11:59:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbjHIP7t (ORCPT ); Wed, 9 Aug 2023 11:59:49 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7966B1FD8 for ; Wed, 9 Aug 2023 08:59:40 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-991c786369cso3300466b.1 for ; Wed, 09 Aug 2023 08:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1691596779; x=1692201579; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pKgMv/zwB6Y77QMgXunD2xiaajtdokS/KsQJJ/MXzU4=; b=OmBebYbe7hv/gEeawP8PcRY/on45Yjtob4z+tFNFAxSTxM74jgchB58wPNTdDxitDr Z8EtPWG++LumdreGGgQDO0SV+UTULp5L81gPus7scKWW6u+fqTfDF7OGGiHrhjY2NdKt nAtli2KRF24vM9+9RMXES5hDWhb3i2CD6/CT4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691596779; x=1692201579; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pKgMv/zwB6Y77QMgXunD2xiaajtdokS/KsQJJ/MXzU4=; b=awXkYJvTNlPl0XJ6EzEMCpsaE8wMBIQlSHtujzCMkD9B8K+7WjRdz4qldEnFDn/2Mq UO+yBOZIsKG2IylXAcYJ5FZ4LqtEzFPMdggD10vhMnSb6RlCR/NG//ySbSf+ukiVMBqG Ehz0OQP+bcYezNOSrv3mVlq0nvB7ypHCLO7RFtBXjNYO5B6s8wHl+tCLsj3k7SMkh2Pb pnJWZRga09iJW/5KHY90dUPmQjkPqpee0mHiaF90tcwyc9hM6hHslwklzVxBDMES1HrB GuU9mwnSXSpNuxDmpuUzieTEIAFyLSgqY8EDX5eCajRm2GGVANRqKJitFd3eQ3OxOWjo C9eg== X-Gm-Message-State: AOJu0YwyY0mHZ/wd6q6JK0CABV0LJZ6TMJFVKIFqthT3MRMmANoRuBlG yG9Ion3s2s4C9qorPc6aLtCCaONUMK502CH+9ytAuRsv X-Received: by 2002:a17:906:53d1:b0:99c:7134:4f95 with SMTP id p17-20020a17090653d100b0099c71344f95mr2321557ejo.32.1691596778863; Wed, 09 Aug 2023 08:59:38 -0700 (PDT) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com. [209.85.218.47]) by smtp.gmail.com with ESMTPSA id l22-20020a170906079600b009934b1eb577sm8241026ejc.77.2023.08.09.08.59.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Aug 2023 08:59:38 -0700 (PDT) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-991c786369cso3296266b.1 for ; Wed, 09 Aug 2023 08:59:37 -0700 (PDT) X-Received: by 2002:a17:906:5350:b0:992:d013:1131 with SMTP id j16-20020a170906535000b00992d0131131mr2505461ejo.52.1691596777526; Wed, 09 Aug 2023 08:59:37 -0700 (PDT) MIME-Version: 1.0 References: <87edkce118.wl-tiwai@suse.de> <20230809143801.GA693@lst.de> <87a5v0e0mv.wl-tiwai@suse.de> In-Reply-To: <87a5v0e0mv.wl-tiwai@suse.de> From: Linus Torvalds Date: Wed, 9 Aug 2023 08:59:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC] Introduce uniptr_t as a generic "universal" pointer To: Takashi Iwai Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, Andy Shevchenko , Mark Brown , netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 On Wed, 9 Aug 2023 at 07:44, Takashi Iwai wrote: > > The remaining question is whether the use of sockptr_t for other > subsystems as a generic pointer is a recommended / acceptable move... Very much not recommended. sockptr_t is horrible too, but it was (part of) what made it possible to fix an even worse horrible historical mistake (ie getting rid of set_fs()). So I detest sockptr_t. It's garbage. At the very minimum it should have had the length associated with it, not passed separately. But it's garbage exactly because it allowed for conversion of some much much horrid legacy code with fairly minimal impact. New code does *not* have that excuse. DO NOT MIX USER AND KERNEL POINTERS. And don't add interfaces that think such mixing is ok. Pointers should be statically clearly of one type or the other, and never lied about. Or you go all the way, and do that whole iterator thing, and make it very clear that you're doing something truly generic that can be passed fairly widely along across subsystem boundaries. Linus