Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6575155rwi; Mon, 24 Oct 2022 03:23:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4yZl17pNts9KxbiBFXqNlynRlELdQndW7a1Qt4gdEqiMjBOfKRIcSgQinlyltQo+wm1sTC X-Received: by 2002:a17:902:e552:b0:179:e796:b432 with SMTP id n18-20020a170902e55200b00179e796b432mr32190393plf.21.1666606988216; Mon, 24 Oct 2022 03:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666606988; cv=none; d=google.com; s=arc-20160816; b=zf2NWjAGA/elPfHZJogeexDLbeOrFFs/xEgAmFULomB9ehZidL7Bvc8QZDZVSF0ETf x8tHKyqVd8ZVuOMfrYUXCLI+HlNuQF6bG3k9xTWocv9TAnXDbzHr9KV6BJpE1/w2idaa C4uJ3C21hS6Z3mu4Dd6N5nb1wkKkMep06Z8/zmhhOWfz+waYrjrgji3CSGN/Ccz6qrd5 7BaservSDyZE7J+RPsd8PoakKpgqtkDtES2bWigQVs2W+T9h3Rnlu0D18nLxIET6Fe8R OMh5up73rbOO6PGWHOadKJbk9rrlrYwfAeq9ER3A/ZagHLka5/TEFPR7N2dRzRlHvPmd D5cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=KVg9tlBAiE9/E22upzef6+2tuN1UPI+JcgZE86HVq9Y=; b=xaZBhH1P4qeC4Um4+31+cIBaIgtvtJoc0aZHX1sgEYE3v+Q4VOPFesM/3CT3YpOlsi Gisqh2Crpj69S4riVUKBc0MFuauccFzdWXbUfprkZyQ7iUcJAfWkMQM9TFBYMeZMGf7E xPAABcibmwikjYXIdYY4SfJy3aLspcgMhsJa8w7SA7sE0pMkpGPv2zZAjBNY/3KnUQ7n 0Al3Ppywo3qCtaQCugT464RiE4shFMxgZx6BYBNgI3dSDUcLyP+2x/XrNoRHwf03wwaD kRN/cBZ9NF199cxk1C3tZ4bwl8hlSe7wuMVCSXnBoQm6A5nfZ1bPzUl48QNbeVkMyJY5 cTWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LgOdVDXS; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a056a00178a00b00565a581ecc0si38793111pfg.11.2022.10.24.03.22.56; Mon, 24 Oct 2022 03:23:08 -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=@intel.com header.s=Intel header.b=LgOdVDXS; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbiJXJXN (ORCPT + 99 others); Mon, 24 Oct 2022 05:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbiJXJXM (ORCPT ); Mon, 24 Oct 2022 05:23:12 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8DA761736 for ; Mon, 24 Oct 2022 02:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666603391; x=1698139391; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=1IDCnTWE2rq8375NnRl516ZEPqpmCW5m5j0ASaRzdig=; b=LgOdVDXSiyNmERselKAW1rGPTqKwJRQ3YJWZCADnqD5tGnC1Hf5iRWWc TTSkmbjK4wl5ooLKyqSc1Re5Imp/1UTsPCCQ0V0Kq6SuglRRJVZdJhW8M u0GjKGnTd4euEjIrtT6sYA0q4b3Rw5m0ckcax23ATZB6kVuauG63BKUG+ rNfFV8r20eW1tIpoNFIz+dFf2F2/wQh80Lk5dy93kJu/aCgO+DziJwng3 zwBS1fAQRo3enMcKPd3A3Dmg2gENaIAQhE7XjpbUklZtcwrldX1wK9z+v d4NHVFh9YYgNZDdZD9VRy0E2r/laSf7vc4DUXqouT85+IxlJVg8McYI74 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10509"; a="287094060" X-IronPort-AV: E=Sophos;i="5.95,207,1661842800"; d="scan'208";a="287094060" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 02:23:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10509"; a="806249867" X-IronPort-AV: E=Sophos;i="5.95,207,1661842800"; d="scan'208";a="806249867" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP; 24 Oct 2022 02:22:58 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1omtfd-001MnD-0O; Mon, 24 Oct 2022 12:22:57 +0300 Date: Mon, 24 Oct 2022 12:22:56 +0300 From: Andy Shevchenko To: Sakari Ailus Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , David Laight Subject: Re: [PATCH 1/1] linux/container_of.h: Warn about loss of constness Message-ID: References: <20221024082610.74990-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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 On Mon, Oct 24, 2022 at 09:11:53AM +0000, Sakari Ailus wrote: > On Mon, Oct 24, 2022 at 10:45:25AM +0200, Greg Kroah-Hartman wrote: > > On Mon, Oct 24, 2022 at 10:43:52AM +0200, Greg Kroah-Hartman wrote: ... > > Wait, no one uses this macro, so why not just remove it entirely? > > Good question. It appears to be a (relatively) common pattern to look up > something and the return its containing object if the lookup was > successful. Doing a quick > > $ git grep 'container_of.*:' drivers include > > reveals more than 20 instances of the pattern. There are probably more > those that use if for testing for NULL. I guess people don't know about > this macro, apart from the developers of the staging driver it was added > for (commit 05e6557b8ed833546ee2b66ce6b58fecf09f439e). Maybe we can provide an example to keep this macro in the kernel, meaning convert one of the drivers / subsystem to actually use it? -- With Best Regards, Andy Shevchenko