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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT 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 1F4A9C04EBD for ; Tue, 16 Oct 2018 10:53:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D877721480 for ; Tue, 16 Oct 2018 10:53:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="h3T7xgdt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D877721480 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727163AbeJPSnE (ORCPT ); Tue, 16 Oct 2018 14:43:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:51172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726978AbeJPSnD (ORCPT ); Tue, 16 Oct 2018 14:43:03 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC93A2086E; Tue, 16 Oct 2018 10:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539687192; bh=gdbeTOW49xTzSz04w9LpjWx0mH0KIXS6p4zljFUbFsI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h3T7xgdth9j0iHH2hSxsV4XunpYAEToQ02yGSn37Y/Ys126N9j+lfDSdxwUt/K+Xj YxgGzu3khmDcznD8WCOB5Y8TAiH0UivS2XHys6HcOdyUiEqbiNsL+Ysv/k8O5/Kf6/ jdyRJ7QfuylB+T+HZ/IqPlksYLNk2EbkCMElWU5M= Date: Tue, 16 Oct 2018 12:53:10 +0200 From: Greg Kroah-Hartman To: Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH v6 2/4] mm: move is_kernel_rodata() to asm-generic/sections.h Message-ID: <20181016105310.GD4768@kroah.com> References: <20181014152010.2021-1-brgl@bgdev.pl> <20181014152010.2021-3-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181014152010.2021-3-brgl@bgdev.pl> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 14, 2018 at 05:20:08PM +0200, Bartosz Golaszewski wrote: > Export this routine so that we can use it later in devm_kstrdup_const() > and devm_kfree(). > > Signed-off-by: Bartosz Golaszewski > Reviewed-by: Bjorn Andersson > Acked-by: Mike Rapoport > Acked-by: Rasmus Villemoes > Reviewed-by: Geert Uytterhoeven > Reviewed-by: Andy Shevchenko > --- > include/asm-generic/sections.h | 14 ++++++++++++++ > mm/util.c | 7 ------- > 2 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h > index 849cd8eb5ca0..d79abca81a52 100644 > --- a/include/asm-generic/sections.h > +++ b/include/asm-generic/sections.h > @@ -141,4 +141,18 @@ static inline bool init_section_intersects(void *virt, size_t size) > return memory_intersects(__init_begin, __init_end, virt, size); > } > > +/** > + * is_kernel_rodata - checks if the pointer address is located in the > + * .rodata section > + * > + * @addr: address to check > + * > + * Returns: true if the address is located in .rodata, false otherwise. > + */ > +static inline bool is_kernel_rodata(unsigned long addr) > +{ > + return addr >= (unsigned long)__start_rodata && > + addr < (unsigned long)__end_rodata; Those symbols are not exported, are you sure this is going to work for a kernel module that ends up using this function? I'll take it, but be aware of the future complications that might happen here... thanks, greg k-h