From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D230C433EF for ; Tue, 5 Oct 2021 20:56:00 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55B886121F for ; Tue, 5 Oct 2021 20:56:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 55B886121F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1mXrTR-0005lc-1s; Tue, 05 Oct 2021 16:55:41 -0400 Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mXrTO-0005jw-NH for kernelnewbies@kernelnewbies.org; Tue, 05 Oct 2021 16:55:38 -0400 Received: by mail-ua1-x92f.google.com with SMTP id i13so234844uat.4 for ; Tue, 05 Oct 2021 13:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=pywAetVKyJVExfNX3lwdmbJwr0NvyfuQy7KmlTGNw2o=; b=hiYIiUEBFaDb8hGkoNNc2gusdgAITgQefteWyIRRMB9oQJ6OwtceTWr20YEqf3ifTY bMohMovneSth09YgCly7XXwFlPhKOo++vLdvN+wpRf/kgj9RPEdG/ZqYG0jlAhBuWAfg iOywifylCQWcJuNpzcXUwMBjwCNk/Fv3Z2aqDzP356dut18UlmvwfHAP0998IPqXktM5 Op1QVMwSjzakEcKnxMxc/Q6TXFcA9cixta93+rlP4SSnebGondyI71vVXep1MpJaPIN6 kL2LBx9uyNkuG808DsrnW6ro9KKyxybSgTK97uap7PnYJg0p7hjZH7KolMY2DGQkl9w3 ZNbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=pywAetVKyJVExfNX3lwdmbJwr0NvyfuQy7KmlTGNw2o=; b=4TtPuTAPP8ADtssxP+KFGAjzuh4JK335G2SZl2h9o4d+bzrQoDmgeXJWZyRY85Io3I U2/IXkvzKaOhwWT55qEnCAXXaya4H1JzCoFP21t1sYgacI0dBPwfo/tgcGx1XgEYwOLK we+uASFYRSn/sW4F76yAFwljXX57JiVx4lCY7LIP21s3W7AFb7i3sx1Yh+ypMOUaSCN7 r3PYqEsYzmZnoawRxgLAqM5neNJ/ohDmuakZAuDvaHwW5EhE0T8iBiU+lzblbMCqeZPB 3LyTmBEaediaJdsp2q26BXvf3AU2iLMZrjumMQiWSOX2OYH0f2qu/qcwff8G+HZ9ki5j GqSg== X-Gm-Message-State: AOAM530Ip6LhckiXI+RXN+1VgcBdT/5c1B4k31SOgwXuiWd7/sRf9cJw LDVkJnQJyj4rvdj1DzM1JINePxwFX6tAqsRgyYZgEuAKuMw= X-Google-Smtp-Source: ABdhPJxOPMxwJsuRm8kZ8f9nNj9KYjsLrHtWrra6OoA1gp3ZaASElZfGf6X5UD0gGTmla0O2lJ4tyVHYvrRsJ8P9dnw= X-Received: by 2002:ab0:1111:: with SMTP id e17mr14468797uab.128.1633467337500; Tue, 05 Oct 2021 13:55:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: jim.cromie@gmail.com Date: Tue, 5 Oct 2021 14:55:11 -0600 Message-ID: Subject: Re: advice on checkpatch error To: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Tue, Oct 5, 2021 at 1:14 PM wrote: > > so I have this macro, with some helpers, > the helper gets a checkpatch error. > > DEFINE_DYNAMIC_DEBUG_CATEGORIES(debug_gvt, __gvt_debug, > "i915/gvt bitmap desc", > /* map each bit to a category */ > _DD_cat_(0, "gvt:cmd:"), > _DD_cat_(1, "gvt:core:"), > _DD_cat_(2, "gvt:dpy:"), > _DD_cat_(3, "gvt:el:"), > _DD_cat_(4, "gvt:irq:"), > _DD_cat_(5, "gvt:mm:"), > _DD_cat_(6, "gvt:mmio:"), > > > +#if defined(CONFIG_DYNAMIC_DEBUG) || \ > + (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) > +/** > + * DEFINE_DYNAMIC_DEBUG_CATEGORIES() - bitmap control of categorized prdbgs > + * @fsname: parameter basename under /sys > + * @_var: C-identifier holding bitmap > + * @desc: string summarizing the controls provided > + * @...: list of struct dyndbg_bitdesc initializations > + * > + * Intended for modules with substantial use of "categorized" prdbgs > + * (those with some systematic prefix in the format string), this lets > + * modules using pr_debug to control them in groups according to their > + * format prefixes, and map them to bits 0-N of a sysfs control point. > + * Each @... gives the index and prefix map. > + */ > +#define DEFINE_DYNAMIC_DEBUG_CATEGORIES(fsname, _var, desc, ...) \ > + MODULE_PARM_DESC(fsname, desc); \ > + static struct dyndbg_bitmap_param ddcats_##_var = \ > + { .bits = &(_var), .map = { __VA_ARGS__, { .match = NULL }}}; \ > + module_param_cb(fsname, ¶m_ops_dyndbg, &ddcats_##_var, 0644) > + > +/* helper macros provide combos of '^' anchor and ' ' postfix */ > +#define _DD_cat_(N, str) [N] = { .match = str " " } > +#define _DD_cats_(N, str) [N] = { .match = str } > +#define _DD_pfx_(N, str) [N] = { .match = "^" str " " } > +#define _DD_pfxs_(N, str) [N] = { .match = "^" str } > + > > ERROR: space prohibited before open square bracket '[' > #250: FILE: include/linux/dynamic_debug.h:273: > +#define _DD_cat_(N, str) [N] = { .match = str " " } > > Ive tried various (encapsulations) to no avail. > > what am I missing ? I'll just do it more like this ... static const struct intel_step_info kbl_revids[] = { [1] = { .gt_step = STEP_B0, .display_step = STEP_B0 }, [2] = { .gt_step = STEP_C0, .display_step = STEP_B0 }, [3] = { .gt_step = STEP_D0, .display_step = STEP_B0 }, [4] = { .gt_step = STEP_F0, .display_step = STEP_C0 }, [5] = { .gt_step = STEP_C0, .display_step = STEP_B1 }, [6] = { .gt_step = STEP_D1, .display_step = STEP_B1 }, [7] = { .gt_step = STEP_G0, .display_step = STEP_C0 }, }; _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies