Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1595317pxb; Thu, 4 Feb 2021 18:01:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwELrty9myQft/H/VSL2rFFC6h1VDLKe2ss2q3/ji6mGjC2dtraJHb6QrgIoXHFwdwnomx1 X-Received: by 2002:a17:906:2f09:: with SMTP id v9mr1810915eji.151.1612490491257; Thu, 04 Feb 2021 18:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612490491; cv=none; d=google.com; s=arc-20160816; b=oGA4/VXIczznvVz2G5QSCoj3SxzU+yxGgVKzbva8MNwGiabCk1ASubxSsovwn9xd9k GA3Acr3GtpYPJ83CqGkwp28OlbziaU2EnLPuBuDgqRdlD2BSoZiOIglZqseYVA5L+nmd p8aWQMAeAmqcI+kknlE4vn8Wpq+aj0HiMJS73X3lPPn94oRy+bEAu08e1TdZuu8PCwGM y6WX+iyO793cJXCM3IQ74mAWukO5z02S8Ad5nZGkJYp5ypQx9HUgxQDzTDg/FvSZ8z8F BeSsrGd/4dtF7wmDmN90qu0cglPGelZchKw3rLfatPCT/0IxCNzPncFHWAgo2f3tiwQ2 aykA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6cxI6fZNStXxMO/aSetmOwSh08Jb00YMW0Z3C4YiT+4=; b=UmDR7U4VcDSTHimNC1G2yQPo3TP0EcUQ61v47Crf9RfNldggnPpejs3gAdQWaI9xw0 88sq94GcxfoDmYJsISoVMEh7jBjn3k08F1SJw201RTvT4qpRmNuc0Np55pADNFGpdyzo i6KVF6/uck1WuZuF1MJXwUesTW57spxGQWxtXzbxazCnNfpqqh9J/iwFAX6ObchzqWo4 FshyekQ0vl3mh/cYT2h5/aDOKNqyGldG/TKf6sasJxpSC8AjeaNBl3bG3uRIsOi3l33X I4u+dhYnHuMJOc7gJOn3zfFAKWh5dg8a5d+2xY4cSOWfM3Yy2SniKOhaqmtTxINUZwm2 zYeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=I7tOFQ2e; 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=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si4161126ejr.334.2021.02.04.18.01.06; Thu, 04 Feb 2021 18:01:31 -0800 (PST) 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=@chrisdown.name header.s=google header.b=I7tOFQ2e; 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=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232198AbhBEAso (ORCPT + 99 others); Thu, 4 Feb 2021 19:48:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbhBEAsl (ORCPT ); Thu, 4 Feb 2021 19:48:41 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38DB9C0613D6 for ; Thu, 4 Feb 2021 16:48:01 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id w1so8821970ejf.11 for ; Thu, 04 Feb 2021 16:48:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6cxI6fZNStXxMO/aSetmOwSh08Jb00YMW0Z3C4YiT+4=; b=I7tOFQ2enpaxxNhJTbnozjO29GdRwNQaBkgUWYPwRQhECNdl4aZLGkxYF95XaQygqV YCfqA8vKImogXJbbsaDNRfRdUWHXFK95ZrKSR10cNIoxooyiRiYYxzjkt7F04+8AlnJQ yVwu/RdggeZUvv/s3KsBDYfzeUWnGwWYia5qk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6cxI6fZNStXxMO/aSetmOwSh08Jb00YMW0Z3C4YiT+4=; b=fLGEbNxDFglryfq6pKW0XDlmhUoDt+f7Ag9DJP1cPDqvUGLGaoC2cFpTeePC6/FElG ee3F4awsGFeTbTfIEScRo3E/0UrtU7dq6LPjfITfeHp9hg15vkcCkCUIlobK5ZOs+YNH hb1kVMf8Z1wR/+93AUw4J4wpbHcrcnuZGTRRH/U9pMrTQIRZ5bKF6UCJc2+0OvsGmiTw 1c0nkz9o/nwYmcH25/f+SN9ByqjkLs1K3N3DypQ1E0XcQq/Z/NmOkZCpEU/TzJH6WVZB qyQO+eFRKWQIe9AXtImkk1XCCLlfbko5bp0pjnokQBc5snQejDLjTrE6aITcSkPU2Jqo 9i8A== X-Gm-Message-State: AOAM531mGQvTbTrfPf1qqEKQyiihbEs+S192E3/Ec4hsZpvBobG6Xc9G Dma4aS/Zj6x+rsF3MWInsxQShOAy6j2vpF2a X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr1674012ejb.252.1612486079699; Thu, 04 Feb 2021 16:47:59 -0800 (PST) Received: from localhost ([2620:10d:c093:400::4:2256]) by smtp.gmail.com with ESMTPSA id l12sm1195546edn.83.2021.02.04.16.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 16:47:59 -0800 (PST) Date: Fri, 5 Feb 2021 00:47:58 +0000 From: Chris Down To: linux-kernel@vger.kernel.org Cc: Petr Mladek , Sergey Senozhatsky , John Ogness , Johannes Weiner , Andrew Morton , kernel-team@fb.com Subject: Re: [PATCH] printk: Userspace format enumeration support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.5 (da5e3282) (2021-01-21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some improvements I noticed that I'll include when sending v2. Chris Down writes: >+static void remove_printk_fmt_sec(const struct module *mod) >+{ >+ struct printk_fmt_sec *tmp = NULL, *ps = NULL; >+ const char **fptr = NULL; fptr can be scoped to list_for_each_entry_safe, I'll move it. >+static int proc_pf_show(struct seq_file *s, void *v) >+{ >+ const struct printk_fmt_sec *ps = NULL; >+ const char **fptr = NULL; Ditto for list_for_each_entry. >+ >+ mutex_lock(&printk_fmts_mutex); >+ >+ list_for_each_entry(ps, &printk_fmts_list, list) { >+ const char *mod_name = ps_get_module_name(ps); >+ >+ for (fptr = ps->start; fptr < ps->end; fptr++) { >+ seq_puts(s, mod_name); >+ seq_putc(s, ','); >+ seq_puts(s, *fptr); >+ seq_putc(s, '\0'); >+ } >+ } Not sure why I didn't just use seq_printf here. I'll do that. I'll wait a few days for feedback then will send v2 either way. :-)