Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp901090pxb; Fri, 13 Aug 2021 08:46:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykM6A/iAUm9RySmDxmfBu8qptM40rIGU7R6W3xW8R7VdxcR/L9hFzdbIFMJRCs6A+Eb05M X-Received: by 2002:a17:906:9747:: with SMTP id o7mr3085932ejy.486.1628869562488; Fri, 13 Aug 2021 08:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628869562; cv=none; d=google.com; s=arc-20160816; b=NlaecMG5MyACJCyIu9XCMsZqLaxl4fYpgPMtkNlp//0MJ3mSSyFLxb+DEfsDdnIbWn sco1vk62OoFcXRg/Q1SzxUDfeG+xR5doewo1+CbQjcsNRi047U3WnJ6ASKS0/olJOkLG bSwCvZgAACU4pIvI3pNXelJLvans2kuJ6M8w0zQOg3SjXCs5IKYm2qG7W8VHcLLQ674R a16NvLuuifiWfpVC8kxhhuLVcVqdiD5CyOwY367vXrgKM3WDDb9WmxCGxhlWjJ6mAL7r BCAWRANpDT7SnYdZLKgfQgIjnRJpM1KK6wAMbqDS/ruQJb0Ani9Z1ECXH9DeqyN0jpyJ JDVA== 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; bh=VHuzPK8wpun4p/hla/YAOAiRGtiKqjUyctl9c3BXYwI=; b=cUbPH66F1V7hZsc28/bnWvoGnj9I0gATbeY282fqSHBLkosU4OBYpzsJYDdbsK9ltq 382y0R3bUU1ni3AnhaQ7jn/AeQqgtsdMQ2euOBPbN+i2yJnApibWcwTtcCZYlGVt1DRV WZM7mCA9hHWfCc218C3YtOiyiEwOrnjIyuuu3MZ+rCWzrMZSMe972pvfSYgVAFFilfdR rHC1y6Gyt/1EhQrok3GUkqupK22GXbCi2CVObCCI48qdmRKlqjE8LGZKVD84gEpWBEER Mh9IuF+BKis919dbhbKuSx6ZIOvvWd19t2ZL4FoqUPH9yRxg/WVWHumHXe4mdXTkcSeA JnxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b25si1989965edr.51.2021.08.13.08.45.37; Fri, 13 Aug 2021 08:46:02 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236771AbhHMPod (ORCPT + 99 others); Fri, 13 Aug 2021 11:44:33 -0400 Received: from mga02.intel.com ([134.134.136.20]:32407 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236037AbhHMPoc (ORCPT ); Fri, 13 Aug 2021 11:44:32 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10075"; a="202771790" X-IronPort-AV: E=Sophos;i="5.84,319,1620716400"; d="scan'208";a="202771790" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2021 08:44:05 -0700 X-IronPort-AV: E=Sophos;i="5.84,319,1620716400"; d="scan'208";a="571833136" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2021 08:43:52 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1mEZLU-009Hky-Ik; Fri, 13 Aug 2021 18:43:44 +0300 Date: Fri, 13 Aug 2021 18:43:44 +0300 From: Andy Shevchenko To: Jim Cromie Cc: gregkh@linuxfoundation.org, seanpaul@chromium.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , Harry Wentland , Leo Li , Zhenyu Wang , Zhi Wang , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Jason Baron , Hawking Zhang , Tao Zhou , Huang Rui , Likun Gao , Chengming Gui , Aaron Liu , John Clements , Kevin Wang , Ashley Thomas , Qingqing Zhuo , Wyatt Wood , Aurabindo Pillai , Johan Hovold , Jessica Yu , Nick Desaulniers , Joe Perches , Miguel Ojeda , Andrew Morton , Masahiro Yamada , Peter Zijlstra , "Paul E. McKenney" , Tetsuo Handa , Thomas Gleixner , Vitor Massaru Iha , Sedat Dilek , Zhen Lei , Marco Elver , Jarkko Sakkinen , Alexander Potapenko , Palmer Dabbelt , Patricia Alfonso , Jiri Olsa , James Bottomley , Arvind Sankar , Johannes Berg , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: Re: [PATCH v5 2/9] moduleparam: add data member to struct kernel_param Message-ID: References: <20210813151734.1236324-1-jim.cromie@gmail.com> <20210813151734.1236324-3-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210813151734.1236324-3-jim.cromie@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 13, 2021 at 09:17:10AM -0600, Jim Cromie wrote: > Add a const void* data member to the struct, to allow attaching > private data that will be used soon by a setter method (via kp->data) > to perform more elaborate actions. > > To attach the data at compile time, add new macros: > > module_param_cbd() derives from module_param_cb(), adding data param, > and latter is redefined to use former. > > It calls __module_param_call_wdata(), which accepts a new data param > and inits .data with it. Re-define __module_param_call() to use it. > > Use of this new data member will be rare, it might be worth redoing > this as a separate/sub-type to de-bloat the base case. ... > +#define module_param_cbd(name, ops, arg, perm, data) \ > + __module_param_call_wdata(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0, data) Cryptic name. Moreover, inconsistent with the rest. What about module_param_cb_data() ? > #define module_param_cb_unsafe(name, ops, arg, perm) \ > __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, \ > KERNEL_PARAM_FL_UNSAFE) (above left for the above comment) ... > +#define __module_param_call_wdata(prefix, name, ops, arg, perm, level, flags, data) \ Similar __module_param_call_with_data() -- With Best Regards, Andy Shevchenko