Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp637813pxa; Thu, 27 Aug 2020 11:33:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqbzZSwFWiOJjD6gHmTDcj9KA4fySUZCj3Aee1Vy9qOa6OMLrfwmilAOuelDETC1/FOyxl X-Received: by 2002:a17:906:274d:: with SMTP id a13mr19298468ejd.434.1598553207197; Thu, 27 Aug 2020 11:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598553207; cv=none; d=google.com; s=arc-20160816; b=J+++RBqiZ0QRe7B/IxMw9ZeDVZxeNRickdtZQrq+itIzfd/2EQAaFWAfAU18ELGH7j Z0qasbdK9nBE2wW1m+lMVz4+/BzoOyGWRpmCzcbB6koQy9pZTtnVwDybc6kqR8HaHPxV xVzcVLgzt7Afl3aa0n0se4f6FRh1zGNACjFBOv+cNcbCVxOyFZwNKksOAS9puMlsg+hh XSYF+dOz73GVXltsSKQhR0VH5xhAeE3WfkqByS3uZsZW0dxDLWqadTcv0FzecFaq3Pya 7gKynoskSxpbKeQY3N++BPTUa1WUvhfZfw0QHby+Yg/PAWhwG8Y2oiaJijCe/Gzz5DWU AFAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature; bh=olaQUP1wZSYm5PApDPCp3rNdWOHx7GXEbfPGRyLIEwE=; b=uUVsk678wBoraSRKZP5kwt1ouTD+zOn50YE8blovOhZcxSXMX/YeMU/UVofee0YNbN XLQSYHOgnPtmy6HqexuzsvjtgAmY4y3ku/X+PgF99hZxjy3VSE8/hPE6BT5jmyCUUIh+ B5KdgMWE32uhLqjl9POltwyG8nA+T4c+aWID2iptLn9EXl8AH+rGxRUNMgN4JyQa1Oil QVYz39P5eB7/WXojH7ZtAfW2eNkZ7qk/2dm/CpUY/0akfblqHaJEbyv24PpI/LJp2Ms0 4lQPOcRx3sc1rHlkd/YBG4GD4L97JKkBAiSCzEcqJbI53ZH2oMt+JPZvJQ6Rv9rxJXMK tLOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=tYxmWHhG; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=cXh3H2oy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m2si1977305eds.146.2020.08.27.11.33.04; Thu, 27 Aug 2020 11:33:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=tYxmWHhG; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=cXh3H2oy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbgH0ScS (ORCPT + 99 others); Thu, 27 Aug 2020 14:32:18 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:56100 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726266AbgH0ScS (ORCPT ); Thu, 27 Aug 2020 14:32:18 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 8CC8F8EE119; Thu, 27 Aug 2020 11:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1598553137; bh=eYZG2X+x0TFOwkl/HfsO2QFElq5sw75da5er1mYDlEk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=tYxmWHhG6BAEQiVHMsCA7B2s4KWYhSBJS1oWfItmzIQLOWBsVQse0G4OT3cVs6T4O DqE0r6/loHrd2IijFOhzddlBQ9TBYlBtfrbbbI8j0rujrR7qMB33/PrZGhDzogvoep 4KVbZyEi2kjZksnEVDP9PCnGs6H4ipvpcaWZ/Idk= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xBWXnSaZook7; Thu, 27 Aug 2020 11:32:16 -0700 (PDT) Received: from [153.66.254.174] (c-73-35-198-56.hsd1.wa.comcast.net [73.35.198.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id C3DCA8EE105; Thu, 27 Aug 2020 11:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1598553136; bh=eYZG2X+x0TFOwkl/HfsO2QFElq5sw75da5er1mYDlEk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=cXh3H2oyT7bN/UGPe185OteeIg7+ouZnly4zeMUGWHD/AHs4oO/+n2bPTyJEVotJZ MdLqByWn6pGXGmR7qkvjewNNysamaLQrAp4C7DW653RsskkjIpVhhm1/jQgO3t0YO2 nv2ZwDABXSqitRrB5TBz4+JQ5GJNIMtKYCj4injc= Message-ID: <1598553133.4237.8.camel@HansenPartnership.com> Subject: Re: [PATCH] linux/kernel.h: add container_from() From: James Bottomley To: Linus Torvalds , Allen Pais Cc: Andrew Morton , Kees Cook , Thomas Gleixner , Linux Kernel Mailing List , Greg Kroah-Hartman , Jens Axboe Date: Thu, 27 Aug 2020 11:32:13 -0700 In-Reply-To: References: <20200827013636.149307-1-allen.lkml@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-08-27 at 11:04 -0700, Linus Torvalds wrote: > On Wed, Aug 26, 2020 at 6:36 PM Allen Pais > wrote: > > > > Introduce container_from() as a generic helper instead of > > sub-systems defining a private from_ > > NAK. > > This seems completely broken. > > The documentation comment doesn't even match the macro, and claims > that "container" is a type. > > Which it isn't. That's what container_of()" already takes. > > And if the argument is that a broken commit introduced a broken > macro, > then that's not a great argument. Yes, we have that broken > "from_tasklet()" macro, but it's not even *USED* anywhere. > > So instead of adding a broken new concept that adds absolutely no > value, let's just remove the broken macro that isn't even used. The argument is more over the tasklet rework adding from_tasklet that was effectively completely generic. https://lore.kernel.org/dri-devel/20200817091617.28119-1-allen.cryptic@gmail.com/ The tasklet rework people don't want to use container_of, which was our first suggestion, because it produces lines which are "too long". So container_from is a compromise that takes the actual structure pointer as a second argument instead of the structure type, thus being completely generic and suitable for line length reduction in the tasklet rework code. James