From patchwork Tue Feb 21 13:19:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 13147944 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9E18C6379F for ; Tue, 21 Feb 2023 13:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232116AbjBUNTg (ORCPT ); Tue, 21 Feb 2023 08:19:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233430AbjBUNTf (ORCPT ); Tue, 21 Feb 2023 08:19:35 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F5B41ADC3 for ; Tue, 21 Feb 2023 05:19:34 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id iv11-20020a05600c548b00b003dc52fed235so3036435wmb.1 for ; Tue, 21 Feb 2023 05:19:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jx8bse47PfJtv3OhMIw1BoYoCIVWADStrE71XZeBTMs=; b=nRWmGyWCztjAVyPBelo0N08grmwkmjw7A+l0zVuqsN/V1rFafxkp3KlfExBZzQ5zfL EMEaVFzo6e015QrGzS/V+3PH46JHfgXHlpNx9lW+OWKFqB5DglU6eFesbIMbb7Fvczl7 X+SAM7EobP7h0G5g/nmsLbvDQ7/7Zz0hh7Y6R59ApzpeX1oaY3TK3ux919uu1kx1/pmQ VaUaj96i22Qe6/1PMSqM2gO8g7T5KjDWILLqpOsPyLuGvUHevf61EBFR2rJH1yskFOXb rD1QhEfzrbu2MZXnz7MPioFQdwddMvlfjSyqGK5JMdwjM5p0mnL3NtbB7vQ+uapKEWFK Ww6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jx8bse47PfJtv3OhMIw1BoYoCIVWADStrE71XZeBTMs=; b=oqldtbMs+MIvqAzsgRAF0ujVOZoAkQ6yUiq3PgS1HZNySe51MkCbrN/qyo7oZ0O5y8 5ru0u0uET46jSHJeeohDz85lUtydkj3AIEHyMp6QrU3NVXa0T6Ky/0pOiFMUhcO5ACEh Nh7DSxp7YxEgpppP+DHXOEF6CfYjSwBsoySafDuS0MWfnCf9Zp0bA5G6JCWV6lGM9v1F CrE+8J3Vvy181UFh2VXsS/tBcNWb1/jZscMTp1wW7bOefFZ5mkDOxmPCzNhK4yQ6Gw97 t7FEw6ogJyVxhjgnfX4OA5KR1/4FFBXWUNtP/NuYofpLVXkbli+IEncM4J6E4jN41oke 5F4A== X-Gm-Message-State: AO0yUKV1iP7kKkxReZWt9Y5Ifakpqh/v/HAvhF61UgGLOxZUYaPikbZv gLvR6NzDdsbAYh2Scjx2Ielgn6KFoJw= X-Google-Smtp-Source: AK7set+5xeCVxvUt5qu3of79Ix7EUWWe9XObRkhS395G4njqiilo4qyqML6FeqMpbKMbh8WWl3GNxw== X-Received: by 2002:a05:600c:2ed3:b0:3dc:2137:d67d with SMTP id q19-20020a05600c2ed300b003dc2137d67dmr3498061wmn.16.1676985572371; Tue, 21 Feb 2023 05:19:32 -0800 (PST) Received: from localhost (cpc92308-cmbg19-2-0-cust99.5-4.cable.virginm.net. [82.24.248.100]) by smtp.gmail.com with UTF8SMTPSA id 20-20020a05600c025400b003e71a6be279sm3064277wmj.37.2023.02.21.05.19.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Feb 2023 05:19:31 -0800 (PST) From: Emil Velikov To: linux-modules@vger.kernel.org Cc: emil.l.velikov@gmail.com Subject: [PATCH 1/4] libkmod: remove unused kmod_module_get_builtin Date: Tue, 21 Feb 2023 13:19:26 +0000 Message-Id: <20230221131929.106951-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230221131929.106951-1-emil.l.velikov@gmail.com> References: <20230221131929.106951-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: From: Emil Velikov The last and only user was removed with commit 0246e06 ("depmod: Stop opening modules.modinfo once per module") Signed-off-by: Emil Velikov --- libkmod/libkmod-internal.h | 1 - libkmod/libkmod-module.c | 43 -------------------------------------- 2 files changed, 44 deletions(-) diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h index c22644a..95c0377 100644 --- a/libkmod/libkmod-internal.h +++ b/libkmod/libkmod-internal.h @@ -148,7 +148,6 @@ void kmod_module_set_visited(struct kmod_module *mod, bool visited) __attribute_ void kmod_module_set_builtin(struct kmod_module *mod, bool builtin) __attribute__((nonnull((1)))); void kmod_module_set_required(struct kmod_module *mod, bool required) __attribute__((nonnull(1))); bool kmod_module_is_builtin(struct kmod_module *mod) __attribute__((nonnull(1))); -int kmod_module_get_builtin(struct kmod_ctx *ctx, struct kmod_list **list) __attribute__((nonnull(1, 2))); /* libkmod-file.c */ struct kmod_file *kmod_file_open(const struct kmod_ctx *ctx, const char *filename) _must_check_ __attribute__((nonnull(1,2))); diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index c7232e0..1da64b3 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -2943,46 +2943,3 @@ KMOD_EXPORT void kmod_module_dependency_symbols_free_list(struct kmod_list *list list = kmod_list_remove(list); } } - -/** - * kmod_module_get_builtin: - * @ctx: kmod library context - * @list: where to save the builtin module list - * - * Returns: 0 on success or < 0 otherwise. - */ -int kmod_module_get_builtin(struct kmod_ctx *ctx, struct kmod_list **list) -{ - struct kmod_builtin_iter *iter; - int err = 0; - - iter = kmod_builtin_iter_new(ctx); - if (!iter) - return -errno; - - while (kmod_builtin_iter_next(iter)) { - struct kmod_module *mod = NULL; - char modname[PATH_MAX]; - - if (!kmod_builtin_iter_get_modname(iter, modname)) { - err = -errno; - goto fail; - } - - err = kmod_module_new_from_name(ctx, modname, &mod); - if (err < 0) - goto fail; - - kmod_module_set_builtin(mod, true); - - *list = kmod_list_append(*list, mod); - } - - kmod_builtin_iter_free(iter); - return err; -fail: - kmod_builtin_iter_free(iter); - kmod_module_unref_list(*list); - *list = NULL; - return err; -} From patchwork Tue Feb 21 13:19:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 13147945 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA3EFC64EC4 for ; Tue, 21 Feb 2023 13:19:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233721AbjBUNTh (ORCPT ); Tue, 21 Feb 2023 08:19:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233430AbjBUNTg (ORCPT ); Tue, 21 Feb 2023 08:19:36 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A43314690 for ; Tue, 21 Feb 2023 05:19:35 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id l2-20020a05600c1d0200b003e1f6dff952so3511772wms.1 for ; Tue, 21 Feb 2023 05:19:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ckoGnYi/g9fzY1+nZePCJNaLc7j6vS+121w8xKnkYZ0=; b=Sv2IZm1JwLnk4PJT5FB5nBThj++2o37H5ZqAeRYtQcRmyzONQqm/nPQrPr26lgbedp B3o/YTmebfH7Gy9tQH2e8N2Ex1pCu/jvrzuFCN1ZzON49Y/YKYL18JWPxqB65Ky9wc9B 2xkE+lk5ea4dU0MfRUgWFxRNW0Go54g/wgpocCoWEj/djUf4dbG0llgOawgNiSQUAPiN h6lRkMqjeThPgSxui0XVzTq+O2B2a2eIhGyG1kRytuS6JlglyKLxTWpBPwxDdUT0ofbx zsAMpWiPANhcmYIQvaXLeTywoeYkBna1QTPDvnRQ21QSvgpfPMdl+zIuAoFOaQZXaniS DSyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ckoGnYi/g9fzY1+nZePCJNaLc7j6vS+121w8xKnkYZ0=; b=gb3hs2Bl7jaQDWXQYd+oofpjDv9t9VD/xBD7M7d58zDrXiRhGiWnJt8SDiqvhPFVZV qkeZPuRg/1Afmmgq/GC4PP4UqsIBz4XuT96/ibZ9HSl5yoG7tLMmX74v56XBherfSSu1 uzj4A/jxmFBU3ZEed9ANWAVUwZZftle7vMnFR4oP1iPDdoLPlzDg7x/kBuzVuEgYKRTa ouwS4DPsD4wdCgnraY8hRiCt32bfEuVxN6RDemKiewwDjrib8UNH0npLlNUCYPTEoWFx 4lK3abZZBcMLx49f6LPVbKmkyyDZ9S2cvOnaciAXEtujI4dO86cEsP/GS+yc7l13K6SD L84A== X-Gm-Message-State: AO0yUKU4oIfQZ+jxZodC0VT4eMrvCdQTHuWjbwslwCHtXi7qoo2pVpN2 XGPJDoMe6q+Bv2XbBTlmAEEJm7ftiDY= X-Google-Smtp-Source: AK7set/vVTl7IrdVVNyd9no9gUytwxUMVo4fIc7Us1lxxa1iR79FldzXF6Ih1F8IWKXTa16aeiaN9g== X-Received: by 2002:a05:600c:331b:b0:3dc:4318:d00d with SMTP id q27-20020a05600c331b00b003dc4318d00dmr3086528wmp.11.1676985573834; Tue, 21 Feb 2023 05:19:33 -0800 (PST) Received: from localhost (cpc92308-cmbg19-2-0-cust99.5-4.cable.virginm.net. [82.24.248.100]) by smtp.gmail.com with UTF8SMTPSA id o17-20020a05600c379100b003e70a7c1b73sm3015097wmr.16.2023.02.21.05.19.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Feb 2023 05:19:33 -0800 (PST) From: Emil Velikov To: linux-modules@vger.kernel.org Cc: emil.l.velikov@gmail.com Subject: [PATCH 2/4] libkmod: annotate kmod_builtin_iter API as static Date: Tue, 21 Feb 2023 13:19:27 +0000 Message-Id: <20230221131929.106951-3-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230221131929.106951-1-emil.l.velikov@gmail.com> References: <20230221131929.106951-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: From: Emil Velikov It's no longer used outside the compilation unit, as of last commit. Signed-off-by: Emil Velikov --- libkmod/libkmod-builtin.c | 8 ++++---- libkmod/libkmod-internal.h | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libkmod/libkmod-builtin.c b/libkmod/libkmod-builtin.c index a002cb5..65334a8 100644 --- a/libkmod/libkmod-builtin.c +++ b/libkmod/libkmod-builtin.c @@ -54,7 +54,7 @@ struct kmod_builtin_iter { char *buf; }; -struct kmod_builtin_iter *kmod_builtin_iter_new(struct kmod_ctx *ctx) +static struct kmod_builtin_iter *kmod_builtin_iter_new(struct kmod_ctx *ctx) { char path[PATH_MAX]; int file, sv_errno; @@ -108,7 +108,7 @@ fail: return iter; } -void kmod_builtin_iter_free(struct kmod_builtin_iter *iter) +static void kmod_builtin_iter_free(struct kmod_builtin_iter *iter) { close(iter->file); free(iter->buf); @@ -165,7 +165,7 @@ fail: return -1; } -bool kmod_builtin_iter_next(struct kmod_builtin_iter *iter) +static bool kmod_builtin_iter_next(struct kmod_builtin_iter *iter) { char *line, *modname; size_t linesz; @@ -216,7 +216,7 @@ bool kmod_builtin_iter_next(struct kmod_builtin_iter *iter) return (iter->pos < iter->size); } -bool kmod_builtin_iter_get_modname(struct kmod_builtin_iter *iter, +static bool kmod_builtin_iter_get_modname(struct kmod_builtin_iter *iter, char modname[static PATH_MAX]) { int sv_errno; diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h index 95c0377..4a4af58 100644 --- a/libkmod/libkmod-internal.h +++ b/libkmod/libkmod-internal.h @@ -198,9 +198,4 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat void kmod_module_signature_info_free(struct kmod_signature_info *sig_info) __attribute__((nonnull)); /* libkmod-builtin.c */ -struct kmod_builtin_iter; -struct kmod_builtin_iter *kmod_builtin_iter_new(struct kmod_ctx *ctx) __attribute__((nonnull(1))); -void kmod_builtin_iter_free(struct kmod_builtin_iter *iter) __attribute__((nonnull(1))); -bool kmod_builtin_iter_next(struct kmod_builtin_iter *iter) __attribute__((nonnull(1))); -bool kmod_builtin_iter_get_modname(struct kmod_builtin_iter *iter, char modname[static PATH_MAX]) __attribute__((nonnull(1, 2))); ssize_t kmod_builtin_get_modinfo(struct kmod_ctx *ctx, const char *modname, char ***modinfo) __attribute__((nonnull(1, 2, 3))); From patchwork Tue Feb 21 13:19:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 13147946 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AEC0C6379F for ; Tue, 21 Feb 2023 13:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233732AbjBUNTj (ORCPT ); Tue, 21 Feb 2023 08:19:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233430AbjBUNTi (ORCPT ); Tue, 21 Feb 2023 08:19:38 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 217C54690 for ; Tue, 21 Feb 2023 05:19:37 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id l7-20020a05600c4f0700b003e79fa98ce1so1177063wmq.2 for ; Tue, 21 Feb 2023 05:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=71h8EqTR38D1vU1Ns7pR/Fzm/P/c2WawQeO6hO0xei8=; b=iVilA8RTW6Ro/2mdnTeQ39UFTavVkNB6L0KcJuo7dO5RAVUYIeRNItIy8UP4ewRxSF lRNUnyt3LTGBBpIhIIGSF9+dovxWjD6NDN3c9KKXpXav7r5T7dTEGzoz9yDXeq5cAChe 75/oJP7DJUuwfq+s6et+JO+Hgv2gdKWHUMxM7Rt2FGzpD9WuCpRSRLIhYeV391sZsyPh FoFAB+QYH8XcY3KZDod1QVHl8oEu9Q2SbR4ZFcnnaIamr+7xcpVECttTlqEMLpy3AAYS 08ZZgM3sNnmDb3whWe4qEC3m66gxiMXreNF+bUjnov1VQvfmap7XWMpkoyz7ewv3Jar/ xiew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=71h8EqTR38D1vU1Ns7pR/Fzm/P/c2WawQeO6hO0xei8=; b=DcS7P3xfoienC6a7H5fvfKM0SAi2qyQa3QgfttK7XuFrzBHs3wyxV1Aq2+8vbi0mEf 6a7fyj+MFlIqIgkE8FrHliDN8kx8zRochPD+6vMSUTYmzCAhmv/5Gannu/odz3/CPVYc CiN/sDfpHQsLkVlbswPUX2KDGhYTIeuVpTEa7xA7a/g5U1Nd/WeHMGoH+Jep7WSvdKpl nbfwNSWRCEN853OH06PwxK/6YxTNwfj5vLS4HAHjAeZBjjFjIHSt3LI9MLuAHH28mtx1 Etm5MS7U7GIFcsE9QJ7epqvVW/rHdtU+MXMRbuE0YTTYmpzy3LCsyta2QM+s+kG99ZPo IaoQ== X-Gm-Message-State: AO0yUKW3GzM9+r+KSwMD7aGSEhqLnO9RDrKdqocINvXWKl9l683b7ZdX GiwwC1qP5Eq4dOG8RXaByVD14aH+0YI= X-Google-Smtp-Source: AK7set+UF9G1qiAaEj546724MKGrU6rH6gbv2SmWLJ1c1z2N0fxGjRmGmdePUIErse/EeWZxoQsdfQ== X-Received: by 2002:a05:600c:2ac8:b0:3e0:114:62ee with SMTP id t8-20020a05600c2ac800b003e0011462eemr3277645wme.8.1676985575197; Tue, 21 Feb 2023 05:19:35 -0800 (PST) Received: from localhost (cpc92308-cmbg19-2-0-cust99.5-4.cable.virginm.net. [82.24.248.100]) by smtp.gmail.com with UTF8SMTPSA id k17-20020a7bc411000000b003dfee43863fsm3963613wmi.26.2023.02.21.05.19.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Feb 2023 05:19:34 -0800 (PST) From: Emil Velikov To: linux-modules@vger.kernel.org Cc: emil.l.velikov@gmail.com Subject: [PATCH 3/4] shared: annotate local API as static Date: Tue, 21 Feb 2023 13:19:28 +0000 Message-Id: <20230221131929.106951-4-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230221131929.106951-1-emil.l.velikov@gmail.com> References: <20230221131929.106951-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: From: Emil Velikov None of the API is used outside of the compilation unit. Signed-off-by: Emil Velikov --- shared/util.c | 6 +++--- shared/util.h | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/shared/util.c b/shared/util.c index 4b547ff..e2bab83 100644 --- a/shared/util.c +++ b/shared/util.c @@ -354,7 +354,7 @@ char *freadline_wrapped(FILE *fp, unsigned int *linenum) /* path handling functions */ /* ************************************************************************ */ -bool path_is_absolute(const char *p) +static bool path_is_absolute(const char *p) { assert(p != NULL); @@ -460,13 +460,13 @@ int mkdir_parents(const char *path, mode_t mode) return mkdir_p(path, end - path, mode); } -unsigned long long ts_usec(const struct timespec *ts) +static unsigned long long ts_usec(const struct timespec *ts) { return (unsigned long long) ts->tv_sec * USEC_PER_SEC + (unsigned long long) ts->tv_nsec / NSEC_PER_USEC; } -unsigned long long ts_msec(const struct timespec *ts) +static unsigned long long ts_msec(const struct timespec *ts) { return (unsigned long long) ts->tv_sec * MSEC_PER_SEC + (unsigned long long) ts->tv_nsec / NSEC_PER_MSEC; diff --git a/shared/util.h b/shared/util.h index 7030653..c4a3916 100644 --- a/shared/util.h +++ b/shared/util.h @@ -38,7 +38,6 @@ char *freadline_wrapped(FILE *fp, unsigned int *linenum) __attribute__((nonnull( /* path handling functions */ /* ************************************************************************ */ -bool path_is_absolute(const char *p) _must_check_ __attribute__((nonnull(1))); char *path_make_absolute_cwd(const char *p) _must_check_ __attribute__((nonnull(1))); int mkdir_p(const char *path, int len, mode_t mode); int mkdir_parents(const char *path, mode_t mode); @@ -51,8 +50,6 @@ unsigned long long stat_mstamp(const struct stat *st); #define MSEC_PER_SEC 1000ULL #define NSEC_PER_MSEC 1000000ULL -unsigned long long ts_usec(const struct timespec *ts); -unsigned long long ts_msec(const struct timespec *ts); unsigned long long now_usec(void); unsigned long long now_msec(void); int sleep_until_msec(unsigned long long msec); From patchwork Tue Feb 21 13:19:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 13147947 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AC67C61DA3 for ; Tue, 21 Feb 2023 13:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233880AbjBUNTk (ORCPT ); Tue, 21 Feb 2023 08:19:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbjBUNTj (ORCPT ); Tue, 21 Feb 2023 08:19:39 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D70D1C313 for ; Tue, 21 Feb 2023 05:19:38 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id l6so3194655wms.3 for ; Tue, 21 Feb 2023 05:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U+p/Ow+d6DG7aJa2PdxbCzb6KsbOEOmJVCwwyvTASPU=; b=feSvGV0LKdd3WoGhoiZwynCuxNpEw1qllhJjKsFw3hkb/x5U5tRC8DN4HhoBbve85u 0vpkp/6hOOFrME/wZKR824dQdrc9lxT5ncBuWc9LDDgd1vMVpggoJMokNLuvgg/BpNHe Sij3kWsuy9gBrPAxyirZGV4izHOV/vzJAMzOwHEXC/a5XNF+mccIDFwZHsfauhdgLRQi gANpPz/+Y6W5+dowBnsBQcu49pGvsxbCU/mbXZroFZvkTmQexSGhLCetq6C5SWEoqQ9c QOWvsfrVtG7TyJg1te4n0177YUWTj2p0qJ8oKIhXRIMU40uCj+mBQgpD4HKH3QZTow6o 5oLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U+p/Ow+d6DG7aJa2PdxbCzb6KsbOEOmJVCwwyvTASPU=; b=K0XJMstECjCVQjZQCB66L8nT6CafnfjE8XIo0hwtZqwoHC/h5mxZcAVtmNLvr1vlAJ 3/hwpPqgnNNhXlinCdCZmNDxKsD4QcjWAlYZ0WVayhFWFdVKYsEPKid1M30tu2BbrXUq 6mMWVVEQTGnmWjN6yXKrSUx19DOCj34/HhkoE/jBa3w12EDIG9QmqQJpTQJSuwGIH8ey 25pqbi+pjclY/YswgzKA5ak+aKju3dCr06/5O2zcElPZSsCsJBBhKMoogIypyL+GihUE J5VJif6cce+b4jPJeU3u32zPcMgMyDiFAx7busMXCG054yY3eglf/asdAOtq8qqnt7K9 idnw== X-Gm-Message-State: AO0yUKXHSLf/MUvrv/8cGJtojITomM2jNBz8J5NcaKuQHrI4QVp4/ut7 YdbnLfsMgK1aEABOfsKiD6dCxUTcge0= X-Google-Smtp-Source: AK7set96VYpsxsN2KbuRLFpQ80sp/EdiJ68356W6yn0mHwu1/oHtAgJuw2+P2lK1poZkYcxlBex/UA== X-Received: by 2002:a05:600c:1887:b0:3e2:918:ecd4 with SMTP id x7-20020a05600c188700b003e20918ecd4mr3367366wmp.37.1676985576605; Tue, 21 Feb 2023 05:19:36 -0800 (PST) Received: from localhost (cpc92308-cmbg19-2-0-cust99.5-4.cable.virginm.net. [82.24.248.100]) by smtp.gmail.com with UTF8SMTPSA id y14-20020a7bcd8e000000b003e118684d56sm3610422wmj.45.2023.02.21.05.19.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Feb 2023 05:19:36 -0800 (PST) From: Emil Velikov To: linux-modules@vger.kernel.org Cc: emil.l.velikov@gmail.com Subject: [PATCH 4/4] configure: manage libkmod.pc.in and version.py.in via AC_CONFIG_FILES Date: Tue, 21 Feb 2023 13:19:29 +0000 Message-Id: <20230221131929.106951-5-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230221131929.106951-1-emil.l.velikov@gmail.com> References: <20230221131929.106951-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: From: Emil Velikov Replace the manual sed command, build rules and dist/clean for using AC_CONFIG_FILES. It does the exact same thing, with an added bonus... Currently we're missing version.py.in in the EXTRA_DIST. Thus a simple "touch Makefile" should retrigger the regeneration of version.py. Which would presumably fail, since the input file isn't in the distribution tarball. Signed-off-by: Emil Velikov --- Feel free to compare the diff between the old/new "make distcheck". Cannot realistically add that here as it seemingly confuses the hell out of git am. --- Makefile.am | 25 ------------------------- configure.ac | 2 ++ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/Makefile.am b/Makefile.am index 61dbdf0..8ba85c9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,26 +24,6 @@ AM_CPPFLAGS = \ AM_CFLAGS = $(OUR_CFLAGS) AM_LDFLAGS = $(OUR_LDFLAGS) -SED_PROCESS = \ - $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ - -e 's,@VERSION\@,$(VERSION),g' \ - -e 's,@prefix\@,$(prefix),g' \ - -e 's,@exec_prefix\@,$(exec_prefix),g' \ - -e 's,@libdir\@,$(libdir),g' \ - -e 's,@includedir\@,$(includedir),g' \ - -e 's,@libzstd_CFLAGS\@,${libzstd_CFLAGS},g' \ - -e 's,@libzstd_LIBS\@,${libzstd_LIBS},g' \ - -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \ - -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \ - -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \ - -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \ - -e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \ - -e 's,@libcrypto_LIBS\@,${libcrypto_LIBS},g' \ - < $< > $@ || rm $@ - -%.pc: %.pc.in Makefile - $(SED_PROCESS) - # Rules for libtool versioning (from https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html) # 1. Start with version information of ‘0:0:0’ for each libtool library. # 2. Update the version information only immediately before a public release of @@ -116,8 +96,6 @@ libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libkmod/libkmod.pc -EXTRA_DIST += libkmod/libkmod.pc.in -CLEANFILES += libkmod/libkmod.pc bashcompletiondir=@bashcompletiondir@ dist_bashcompletion_DATA = \ @@ -179,9 +157,6 @@ am__v_CYTHON_0 = @echo " CYTHON " $@; .pyx.c: $(AM_V_CYTHON)$(CYTHON) -o $@ $< -%.py: %.py.in Makefile - $(SED_PROCESS) - # Remove some warnings for generated code PYTHON_NOWARN = -Wno-redundant-decls -Wno-shadow -Wno-strict-aliasing diff --git a/configure.ac b/configure.ac index 892f5d9..65902d1 100644 --- a/configure.ac +++ b/configure.ac @@ -292,6 +292,8 @@ AC_CONFIG_FILES([ man/Makefile libkmod/docs/Makefile libkmod/docs/version.xml + libkmod/libkmod.pc + libkmod/python/kmod/version.py ])