Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp970029pxb; Fri, 13 Aug 2021 10:18:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZXBpop4fwIskD3nuHTLfH8jz/sjdyZXfuKT/SGO8mhwU7Wm6efQ8/Pmn/F95DrXT03R2Z X-Received: by 2002:a17:906:a894:: with SMTP id ha20mr3552070ejb.229.1628875114208; Fri, 13 Aug 2021 10:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628875114; cv=none; d=google.com; s=arc-20160816; b=fZ9h9TzOQfQVJ+KK8mbPjT4aD8CGy/AN+rYaqeqtw4BXG98A1Tjfq5rgABNUpD752B 9Fg3wCyradAYhYIDaxcYrLpG0RfIcy1VCL4Ozk17OF3qZOMG3otcbxCMMd/cNPbWIXZ9 WlcRKJpg+vctXA+i2wc2oK32nyMkmUkdei23+63CDwwqjF5PPV906DH8nVgX1uZ0M6Xt 0gfa2jM7UnUjmtyGcqTaerP2QCHaqaBZUUu8n399+5tQX/qnlxf2Lg2eNJyZru9Fg1E2 P4ompJCs9xh0GguIEdsoJVLaL3Usda/uTFrQvLJuRWxE2ZzaENBalOEixKDFOzm02FaI xEGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zlUEA9e1VkT1gKXLNSjj1Okgcd3GspYEDUxv1J4Esdc=; b=0tKM/7R6foXHBPzlnl2b8QAHClT0YUBK+Vj7H9MVXi6LGTNE05pWqah6e8I5Oi8pPh X/KF1BMPMzhXTy4+vOsIUP4n72mhvndshOWTkGrd2iEu5KYRpS8qrA876NXo4V+VOwKQ XJJ/pg9qv4rTS/Qyxx/oMhTI+q6J/DWVJAnN3GaqbUxnvsak68rPUnFk2X8tBLlk7pCp IPlyhy5byRZYvc0cSx5+9bw2XV1PIrd5x/eYdqfMaDZhSAdHO5q+h6yFy1DHeGRdkJHF in75OJS6qV+JeljvYX6PCBfbpDLX7tL0IWyWtIjAZtLFwSTZbzyXGtPqg9ojbNMBR3s9 VAsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fA8sxxgK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si2147084edv.168.2021.08.13.10.18.08; Fri, 13 Aug 2021 10:18:34 -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=pass header.i=@gmail.com header.s=20161025 header.b=fA8sxxgK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbhHMRPv (ORCPT + 99 others); Fri, 13 Aug 2021 13:15:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbhHMRPt (ORCPT ); Fri, 13 Aug 2021 13:15:49 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC85C061756 for ; Fri, 13 Aug 2021 10:15:22 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id v2so6012769edq.10 for ; Fri, 13 Aug 2021 10:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zlUEA9e1VkT1gKXLNSjj1Okgcd3GspYEDUxv1J4Esdc=; b=fA8sxxgKhksZ1i4Qq5qRH12NiDHha3/axZgW4UCqa9o6CPE7sxYCS7rBOg2/0txpSW 9+CrDumsBSyBBbBOgASKG9jgN4jCYaWf65uXG4ctkYYMZRsdKpewJCdKa5BsgvDVsEiQ lugujmU729iB3ptr+YbPg+hzVpo3j3hrNsPMQ3TcqJrNMAv5nR+Oml2UD6+SC6DE+TS7 tR40hw02reD9jMswhju68QwoefFwFXeKZxcuYQwQjzGEd4RlAG9oeAhbRxPcaeTw9hzH 6N9GvTCTUuzi8s5WaICar7uNOE9CsKOl2V0hhkKWwZHOGFF8Od4q+JLKItGPOpoA0HFA apkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zlUEA9e1VkT1gKXLNSjj1Okgcd3GspYEDUxv1J4Esdc=; b=Poxv6lj6ovmhdX84JV4MfBvs3/9IoEtV0jjVN7ij5w9cCqRpONphfUzadyhB9lqkmg 1RpwTSYs2S0KXlbgFXpC/JzqMp/LygbC0MLZkE9E0Ut8rPTP/C7EDUyylzxQ0O4pqpqJ 4nu/zwRF8VJmVJZHkXST1ZHH13JxOIu+quZxO4QsQOfU2NpEZcBe2SSEFZ8kp2of7qxP LczmQ3+jhrh3NnWTXw9pQAu7VkAgw48XdFylmVcr9EMcTrsfT2CdjklpuOkQGAvzk2KU 6xdeqn3xQnSdR/CzoewTqNkdd93cWiGWAySXhdi4km2HCMI02t0cX3HqJBFLOJ00lKpB 6EDw== X-Gm-Message-State: AOAM530WsEv8PUqN8F6MkQ9YvDRSz+90jj3/jv+h9dMThE+X5C8u6fe+ +R+/xSvii0j28WnT78NyBA/cMz2fkbZ86nv7jE0= X-Received: by 2002:a05:6402:31ad:: with SMTP id dj13mr4363446edb.296.1628874920810; Fri, 13 Aug 2021 10:15:20 -0700 (PDT) MIME-Version: 1.0 References: <20210813151734.1236324-1-jim.cromie@gmail.com> <20210813151734.1236324-3-jim.cromie@gmail.com> In-Reply-To: From: jim.cromie@gmail.com Date: Fri, 13 Aug 2021 11:14:54 -0600 Message-ID: Subject: Re: [PATCH v5 2/9] moduleparam: add data member to struct kernel_param To: Andy Shevchenko Cc: Greg KH , Sean Paul , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "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 , LKML , dri-devel , amd-gfx mailing list , intel-gvt-dev@lists.freedesktop.org, Intel Graphics Development Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 13, 2021 at 9:44 AM Andy Shevchenko wrote: > > 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 > > yes to all renames, revised. thanks