From patchwork Tue Mar 29 09:05:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 12794589 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 E14B8C433F5 for ; Tue, 29 Mar 2022 09:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234404AbiC2JH6 (ORCPT ); Tue, 29 Mar 2022 05:07:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234435AbiC2JHl (ORCPT ); Tue, 29 Mar 2022 05:07:41 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ED9D241B7A for ; Tue, 29 Mar 2022 02:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648544758; x=1680080758; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a7ZF5XjqShb5VZnzS09pEe8sn4Z0kAmNbRW3SbLYsak=; b=WO1+WqdQ8tQHUWqX+K2ytUL5sWnHHE4yaWERQzv40DuMIIO0kc33iilh yCVnGOLHx9HcIGkgU+qzVq6GspdlFWUqJzbrgHOqWzbwPGI9x/noqbtip wTVbtNaf5RaKvsvfnyuGLqssi40SjZ26/w5UM5eNU6itM1JqLymeT/ohq DNR8PNLiHeUH172bo4/2pfZ/UUiv1Ekd3Ox3sjL1Ap+E8nzW/If7CUgRm qMOy0UJtpYURJ0lGilUcLiFHZEutMI3N3PJtpeUILTAjEfgWXrFkQtze8 yeNO2zGpnk+FRpkBDWnbyJzoHhKEMndNgpvwaw7P22NpgSo8vIktEydsp A==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="239134287" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="239134287" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 02:05:57 -0700 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="585502840" Received: from mlopezja-mobl.amr.corp.intel.com (HELO ldmartin-desk2.intel.com) ([10.255.231.179]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 02:05:55 -0700 From: Lucas De Marchi To: linux-modules@vger.kernel.org Cc: Luis Chamberlain , Lucas De Marchi Subject: [PATCH 1/4] modprobe: rename rmmod_do_deps_list Date: Tue, 29 Mar 2022 02:05:36 -0700 Message-Id: <20220329090540.38255-3-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220329090540.38255-1-lucas.demarchi@intel.com> References: <20220329090540.38255-1-lucas.demarchi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: It's used not only for dependencies, but also for pre and post softdep. Signed-off-by: Lucas De Marchi --- tools/modprobe.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/modprobe.c b/tools/modprobe.c index 9387537..eed951f 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -357,7 +357,8 @@ static int rmmod_do_remove_module(struct kmod_module *mod) #define RMMOD_FLAG_IGNORE_BUILTIN 0x2 static int rmmod_do_module(struct kmod_module *mod, int flags); -static int rmmod_do_deps_list(struct kmod_list *list, bool stop_on_errors) +/* Remove modules in reverse order */ +static int rmmod_do_modlist(struct kmod_list *list, bool stop_on_errors) { struct kmod_list *l; @@ -413,12 +414,12 @@ static int rmmod_do_module(struct kmod_module *mod, int flags) } } - rmmod_do_deps_list(post, false); + rmmod_do_modlist(post, false); if ((flags & RMMOD_FLAG_DO_DEPENDENCIES) && remove_dependencies) { struct kmod_list *deps = kmod_module_get_dependencies(mod); - err = rmmod_do_deps_list(deps, true); + err = rmmod_do_modlist(deps, true); if (err < 0) goto error; } @@ -443,7 +444,7 @@ static int rmmod_do_module(struct kmod_module *mod, int flags) if (err < 0) goto error; - rmmod_do_deps_list(pre, false); + rmmod_do_modlist(pre, false); error: kmod_module_unref_list(pre);