From patchwork Mon Oct 24 12:39:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9829 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp555980wru; Mon, 24 Oct 2022 10:00:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PpPMw/Imnw4VN3ppKXJgS6PFKiPGqqZGZmV3K2eC1JEjyP+CPvXn8EK/kaj+ghABBSxjg X-Received: by 2002:a17:90b:1c06:b0:20a:f070:9f3c with SMTP id oc6-20020a17090b1c0600b0020af0709f3cmr40427531pjb.151.1666630858606; Mon, 24 Oct 2022 10:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666630858; cv=none; d=google.com; s=arc-20160816; b=KVgvLIGIeslM+oxdYVnqE2/NSbIK1NSIbyvWWLi7IbA6BcyoYJzxmzZqD4jk3trbYE 0JpJS0mrwgX7zB0CMwVnuhUFAVule/ofpoaNWy3Fp7bJpsD3ALRxCdtacwDn5oYO38C8 b4hk8hA2Ps5Hcay8gNHZi5b06sa0+7cIv8FbCKHsE+7V7lZABUmeFh84nBjvdGGBXKWR 2tYL0/SQBPUnGhgDWk+z2qDrud4dJ//EBTgocSRrZPeFlyufAZz0IprNT569L8O1vGRO WO1W8ZKalC96Bl5Kl41Lg6tsJisdo/wlY9xRc8RnIlU5gBz4upIn8EBY9kUzCwH+OdRJ fASQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=z4Mfyb1/9If1mUMFi+lM6S6vDTAqlnZgLlv102EJICU=; b=hvB0Kamq3JPJTZAGwkGZd3+plfZ02czlPa8BV3XcSBFGOWADM8ggtgLzQHRE/imIGD MyfDpZfYeVRTb0pLeWVE1NExz1oHzyyrVKWVs1UIbpKJnDDbrlAe0gqThMdbvKaELSHe uEuV1BTIjRocpv2jtVXb3ixYrqV7ibaPIqkJGNID2o/npIemy/8IhoFiDQKa2epmV5pH MazFEcpFA+00aj+RmQLTXyUPu7fHHXNvGF6AkBY/BMSRQyQ5Sco1i3VqEbat0lYmQHon R45DnV/IeQ7nMkhQz/ZT7iwUtZCpa3WJ+XqbmNmCtefxYc/Vyl9u7bk4priu+2Tm9TOQ xKKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MVaVZ1Mc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w35-20020a634923000000b0046b03475683si37201737pga.831.2022.10.24.10.00.32; Mon, 24 Oct 2022 10:00:58 -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=@linuxfoundation.org header.s=korg header.b=MVaVZ1Mc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235055AbiJXQyF (ORCPT + 99 others); Mon, 24 Oct 2022 12:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235427AbiJXQte (ORCPT ); Mon, 24 Oct 2022 12:49:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 703FA183E32 for ; Mon, 24 Oct 2022 08:32:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 64A1DB818A7 for ; Mon, 24 Oct 2022 12:56:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5490C433D6; Mon, 24 Oct 2022 12:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666616207; bh=PCI6tEJdeb5cr0TT+br6JH/c5LPc/5OCtHMIqdIbwGk=; h=From:To:Cc:Subject:Date:From; b=MVaVZ1McalaJgbNPMmtxQ0nxlBBPOiM62rw89vuIixE73VIcaUQMXr82uDCT1xr7G f9pr3DuabDNvrSp6VYom3lH0pFSv1N2hgtDLBX2OXLU8L00Tc10NHMIwHByR4kMyD4 lgvZ+C2fBX1HhFQsDfySn9zWeS/ML7up8zvafQ6A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Sakari Ailus , Andy Shevchenko , "Rafael J. Wysocki" Subject: [PATCH] container_of: remove container_of_safe() Date: Mon, 24 Oct 2022 14:39:33 +0200 Message-Id: <20221024123933.3331116-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1576; i=gregkh@linuxfoundation.org; h=from:subject; bh=PCI6tEJdeb5cr0TT+br6JH/c5LPc/5OCtHMIqdIbwGk=; b=owGbwMvMwCRo6H6F97bub03G02pJDMlh7c1X17N9qIsPWDBfLFEwuPD4r5U5pTk7i1PvxMhKRHD1 nxXoiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIl4ODEsOP8nXPaifruM1fXQNwe419 +StCpYx7BgtUVbz6ygtZW5MxfNmZL0KO6GsG4aAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747581193519239385?= X-GMAIL-MSGID: =?utf-8?q?1747589119061146259?= It came in from a staging driver that has been long removed from the tree, and there are no in-kernel users of the macro, and it's very dubious if anyone should ever use this thing, so just remove it entirely. Cc: Sakari Ailus Cc: Andy Shevchenko Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman Reviewed-by: Sakari Ailus --- include/linux/container_of.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/include/linux/container_of.h b/include/linux/container_of.h index 2f4944b791b8..a6f242137b11 100644 --- a/include/linux/container_of.h +++ b/include/linux/container_of.h @@ -21,20 +21,4 @@ "pointer type mismatch in container_of()"); \ ((type *)(__mptr - offsetof(type, member))); }) -/** - * container_of_safe - cast a member of a structure out to the containing structure - * @ptr: the pointer to the member. - * @type: the type of the container struct this is embedded in. - * @member: the name of the member within the struct. - * - * If IS_ERR_OR_NULL(ptr), ptr is returned unchanged. - */ -#define container_of_safe(ptr, type, member) ({ \ - void *__mptr = (void *)(ptr); \ - static_assert(__same_type(*(ptr), ((type *)0)->member) || \ - __same_type(*(ptr), void), \ - "pointer type mismatch in container_of_safe()"); \ - IS_ERR_OR_NULL(__mptr) ? ERR_CAST(__mptr) : \ - ((type *)(__mptr - offsetof(type, member))); }) - #endif /* _LINUX_CONTAINER_OF_H */