Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7024830rwb; Mon, 12 Dec 2022 09:08:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6xf3TUGH6eEr9SsPsyIXLQZc3/UbqEKL9mT8aQj2i9Do11tNIW1BTRsAhVZxXOroMifgp9 X-Received: by 2002:a05:6402:2a09:b0:461:a5ac:61e5 with SMTP id ey9-20020a0564022a0900b00461a5ac61e5mr16543009edb.15.1670864907008; Mon, 12 Dec 2022 09:08:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670864906; cv=none; d=google.com; s=arc-20160816; b=zMAX5ZnRkW4egKPx1hdf8VM9gsXI2GdFHb+g6QKsmAUi+0xJWi/x3hlhqTlm+gE4Qe RpGr0OadyhlWD392nRo+h9vzkMmpOPENvE/pjByltYnUvKLsaAlPZIpGVQTGyMqBnyc3 rRY8H4QDLEOByClOQP5FzVlrv6zcsvT+o+bLm7g0u6ID9tbjqiyRxPL/1b215r3S/Vkc CSDmI1E9qF1k3IrzaALMZW0HOYsKxy+Ygp5egub7FlGb1SNtYo3QUovLXxmzC9CLO6aT seYDUcx+ftf4SBYH+EizwmdV1D35lZrAmZGdbPzswh1IST2I4Ea2ZNmcndbUE3vaKM7J RtmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=AibZqLUT2jHYZzYRwS9DlLupdaNJ2OflBETMC6U1ywo=; b=fCi0gA+Hn/JV1osZRdVVP4wLdRoXqgVTwKunwoPVXSEI84n7kGIK+fHPUfKbUvk66A 5SDGh29ShRmLLB/sSiJEUEboJE/q9M2Wcwmd9KB+9vpD/N0hmkhSHs8giloif/R+GqLm txFAffQMkYraSwXLSLKK8OYNHIF2KOqopOAb/CPvvaIf6FMw/4TT1UkA+ebJ2Iy3TYvO nva91Z/mGbEllZxC6AvsuSxNTeyXRbTnn5c8JzBvWvmmxZTTTWJtKYHzHofvPxstr38Q g2zovnOUprqaDs6e5uY2TJKi0WmjyraV20HPgnZ6mTKLPhYV+vy6FfUU2XrN7n6LKy6M GnoA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a509f05000000b00461dca37cd0si7594715edf.126.2022.12.12.09.08.07; Mon, 12 Dec 2022 09:08:26 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231715AbiLLQmQ (ORCPT + 74 others); Mon, 12 Dec 2022 11:42:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbiLLQlc (ORCPT ); Mon, 12 Dec 2022 11:41:32 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id AC11E17053 for ; Mon, 12 Dec 2022 08:39:16 -0800 (PST) Received: (qmail 857704 invoked by uid 1000); 12 Dec 2022 11:39:15 -0500 Date: Mon, 12 Dec 2022 11:39:15 -0500 From: Alan Stern To: Johan Hovold Cc: Oliver Neukum , Greg Kroah-Hartman , Vincent Mailhol , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB: drop misleading usb_set_intfdata() kernel doc Message-ID: References: <4cf7bce3-dfbb-b064-9d91-27616bf11d6a@suse.com> <2a2935e6-ae3c-85d9-a2e9-f42fb4ca7d59@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS 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 Mon, Dec 12, 2022 at 05:08:17PM +0100, Johan Hovold wrote: > The fact that USB core and driver core clears the pointer is an > implementation detail which in principle could change. With the new kerneldoc, the fact that the USB core clears the pointer becomes part of the API. It is no longer an implementation detail but rather a guarantee that drivers can depend on. (I.e., if it does change, all the USB drivers will need to be audited.) > The important > part is that drivers generally should not touch the struct device or > containing structure after unbind (and must do so with care otherwise). While that certainly is an important point, it is not the point of usb_set_intfdata() or its kerneldoc. The main reason for adding the kerneldoc -- Vincent's original motivation -- was to inform coders that drivers generally don't need to worry about clearing the data pointer. A subtext was that clearing the pointer while the driver is still using it can lead to problems, but I don't think we need to mention this. It's pretty obvious. Alan Stern