Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2385086imm; Mon, 24 Sep 2018 03:32:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaqS8LcLTTj2IilfrBUMxA/8pWvle0c0ZSXGyTuQQ4ybtoytVSHnD9YKPxrCujHH6JFjtTm X-Received: by 2002:a62:c9:: with SMTP id 192-v6mr9612362pfa.99.1537785158703; Mon, 24 Sep 2018 03:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537785158; cv=none; d=google.com; s=arc-20160816; b=f9fkS57glpi5hz7BbNPfEVVZKvHi99kF0YDq37Zh3mjdsBrVAF/9DI8zoXec0FA/i6 F2BodZx1Vtfsmf9ayuD0eZM3WeE44S4C9gavaponsV/6rEsNMX0ticfLwlm2JU+7//Fy ao0X/gTv/Fj57qvQCWyos8ffJGIbmX7K4aA69o6CJBMFAFjMSHBtYsPy/b9VN4wWnAtG vUYHQxKeXbwHW+cqUEVWED2TNoutNpEhmwl07z9KGCowtluIDL/01hPPIs/EC6gh8jyW kwS7nZo6+mBUb6xsgN9olmEX707/g3wASilwl2hNgsm6wSA1048Z5/nttRMW1iaglCm4 /djw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=P0rj8f3Lk+GKlSlY9XAYDfNbVw0xUrumSyY5Bay002Y=; b=g5MmVAL8DeQ1CbnyUGafCBQhn89z3Kjdbf5PJ60R1hYVudjcLY0D8VHBcI/NYpM89V D8NrO8lFh0YjXW0/LjZWpmZ9K47e+F0aHhE7VxkY8slsN0/cP91UgUWv1yTdK/0CwpgF Yi3eujXAiSeqZ/bLBOtLfBgSHNTNdmmJshBzZzGdP31+f+mEP5+hPu/tJmWKZGtBNdd0 FY+djhOP/g1P+WxCbhLCEHL7MR8YUEhWqOewCaaPY6Pps6KsrT5aLTfdUXNXlI1JJ4g/ 119JD4qoaYePMf0uH4rB/3bmeRxRqkpIirhphCQ1kY8MPeBMjygEswXses66j2TjYAzo bNmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x192-v6si1211882pgx.686.2018.09.24.03.32.22; Mon, 24 Sep 2018 03:32:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728219AbeIXQd2 (ORCPT + 99 others); Mon, 24 Sep 2018 12:33:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43014 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728107AbeIXQd2 (ORCPT ); Mon, 24 Sep 2018 12:33:28 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8OAU3bO145490 for ; Mon, 24 Sep 2018 06:32:03 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mpu70qa0g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Sep 2018 06:32:03 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Sep 2018 11:32:00 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 24 Sep 2018 11:31:53 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8OAVqiI53739770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 24 Sep 2018 10:31:52 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBD2811C058; Mon, 24 Sep 2018 13:31:34 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 70CBB11C04C; Mon, 24 Sep 2018 13:31:32 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.206.170]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 24 Sep 2018 13:31:32 +0100 (BST) Date: Mon, 24 Sep 2018 13:31:45 +0300 From: Mike Rapoport To: Bartosz Golaszewski Cc: Michael Turquette , Stephen Boyd , Greg Kroah-Hartman , "Rafael J . Wysocki" , Arend van Spriel , Ulf Hansson , Bjorn Helgaas , Vivek Gautam , Robin Murphy , Joe Perches , Heikki Krogerus , Andrew Morton , Michal Hocko , Al Viro , Jonathan Corbet , Roman Gushchin , Huang Ying , Kees Cook , Bjorn Andersson , Arnd Bergmann , Andy Shevchenko , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 2/4] mm: move is_kernel_rodata() to asm-generic/sections.h References: <20180924101150.23349-1-brgl@bgdev.pl> <20180924101150.23349-3-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180924101150.23349-3-brgl@bgdev.pl> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18092410-0028-0000-0000-000002FDC894 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18092410-0029-0000-0000-000023B7D754 Message-Id: <20180924103144.GB6264@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-24_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809240110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 24, 2018 at 12:11:48PM +0200, Bartosz Golaszewski wrote: > Export this routine so that we can use it later in devm_kstrdup_const() > and devm_kfree_const(). > > Signed-off-by: Bartosz Golaszewski > Reviewed-by: Bjorn Andersson Acked-by: Mike Rapoport > --- > 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; > +} > + > #endif /* _ASM_GENERIC_SECTIONS_H_ */ > diff --git a/mm/util.c b/mm/util.c > index 9e3ebd2ef65f..470f5cd80b64 100644 > --- a/mm/util.c > +++ b/mm/util.c > @@ -15,17 +15,10 @@ > #include > #include > > -#include > #include > > #include "internal.h" > > -static inline int is_kernel_rodata(unsigned long addr) > -{ > - return addr >= (unsigned long)__start_rodata && > - addr < (unsigned long)__end_rodata; > -} > - > /** > * kfree_const - conditionally free memory > * @x: pointer to the memory > -- > 2.18.0 > -- Sincerely yours, Mike.