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 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E30ACC83000 for ; Wed, 29 Apr 2020 15:25:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE74820731 for ; Wed, 29 Apr 2020 15:25:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="D7cK+1uG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbgD2PZb (ORCPT ); Wed, 29 Apr 2020 11:25:31 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:35076 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727887AbgD2PZ1 (ORCPT ); Wed, 29 Apr 2020 11:25:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588173926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n7MNVntR2hzdBos1b1qY3omx/9gteBl17M6iJffUlGU=; b=D7cK+1uGKo5qhslaVTWyjklYgFV1+HNM5k+VmCpycYBJl6W1oqqV0z7YhAUoRf1+dQHmtG 9hXJ8udYMQXX6d91+d/Dl4OB+Vizfo4VTcGAk+sCeeyNiZpp4IRMz7TJDcfsXiPcIC9kIB wavzFl6psAHw8XzWfAWz0ZdFpCR1nZc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-4uGGnM5wOgOOSpEELuMYZw-1; Wed, 29 Apr 2020 11:25:22 -0400 X-MC-Unique: 4uGGnM5wOgOOSpEELuMYZw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EF2B80BC52; Wed, 29 Apr 2020 15:25:14 +0000 (UTC) Received: from treble.redhat.com (ovpn-113-19.rdu2.redhat.com [10.10.113.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 516C163BBE; Wed, 29 Apr 2020 15:25:13 +0000 (UTC) From: Josh Poimboeuf To: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Jessica Yu , Joe Lawrence , Miroslav Benes Subject: [PATCH v4 11/11] module: Make module_enable_ro() static again Date: Wed, 29 Apr 2020 10:24:53 -0500 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that module_enable_ro() has no more external users, make it static again. Suggested-by: Jessica Yu Signed-off-by: Josh Poimboeuf --- include/linux/module.h | 6 ------ kernel/module.c | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index e4ef7b36feda..2c2e988bcf10 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -858,12 +858,6 @@ extern int module_sysfs_initialized; =20 #define __MODULE_STRING(x) __stringify(x) =20 -#ifdef CONFIG_STRICT_MODULE_RWX -extern void module_enable_ro(const struct module *mod, bool after_init); -#else -static inline void module_enable_ro(const struct module *mod, bool after= _init) { } -#endif - #ifdef CONFIG_GENERIC_BUG void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, struct module *); diff --git a/kernel/module.c b/kernel/module.c index f0e414a01d91..572d626508d2 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2016,7 +2016,7 @@ static void frob_writable_data(const struct module_= layout *layout, (layout->size - layout->ro_after_init_size) >> PAGE_SHIFT); } =20 -void module_enable_ro(const struct module *mod, bool after_init) +static void module_enable_ro(const struct module *mod, bool after_init) { if (!rodata_enabled) return; @@ -2057,7 +2057,7 @@ static int module_enforce_rwx_sections(Elf_Ehdr *hd= r, Elf_Shdr *sechdrs, } =20 #else /* !CONFIG_STRICT_MODULE_RWX */ -/* module_{enable,disable}_ro() stubs are in module.h */ +static void module_enable_ro(const struct module *mod, bool after_init) = {} static void module_enable_nx(const struct module *mod) { } static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) --=20 2.21.1