From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by kanga.kvack.org (Postfix) with ESMTP id 339FD8E0001 for ; Fri, 28 Sep 2018 03:14:25 -0400 (EDT) Received: by mail-wr1-f72.google.com with SMTP id a77-v6so3734920wrc.16 for ; Fri, 28 Sep 2018 00:14:25 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p8-v6sor819967wmh.23.2018.09.28.00.14.23 for (Google Transport Security); Fri, 28 Sep 2018 00:14:23 -0700 (PDT) From: Bartosz Golaszewski Subject: [PATCH v5 0/4] devres: provide and use devm_kstrdup_const() Date: Fri, 28 Sep 2018 09:14:10 +0200 Message-Id: <20180928071414.30703-1-brgl@bgdev.pl> Sender: owner-linux-mm@kvack.org List-ID: To: Greg Kroah-Hartman , "Rafael J . Wysocki" , Jassi Brar , Thierry Reding , Jonathan Hunter , Arnd Bergmann , Andy Shevchenko , Geert Uytterhoeven , Rasmus Villemoes Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Bartosz Golaszewski This series implements devm_kstrdup_const() together with some prerequisite changes and uses it in pmc-atom driver. v1 -> v2: - fixed the changelog in the patch implementing devm_kstrdup_const() - fixed the kernel doc - moved is_kernel_rodata() to asm-generic/sections.h - fixed constness v2 -> v3: - rebased on top of 4.19-rc5 as there were some conflicts in the pmc-atom driver - collected Reviewed-by tags v3 -> v4: - Andy NAK'ed patch 4/4 so I added a different example - collected more tags v4 -> v5: - instead of providing devm_kfree_const(), make devm_kfree() check if given pointer is not in .rodata and act accordingly Bartosz Golaszewski (4): devres: constify p in devm_kfree() mm: move is_kernel_rodata() to asm-generic/sections.h devres: provide devm_kstrdup_const() mailbox: tegra-hsp: use devm_kstrdup_const() drivers/base/devres.c | 36 +++++++++++++++++++++++++++-- drivers/mailbox/tegra-hsp.c | 41 ++++++++-------------------------- include/asm-generic/sections.h | 14 ++++++++++++ include/linux/device.h | 4 +++- mm/util.c | 7 ------ 5 files changed, 60 insertions(+), 42 deletions(-) -- 2.18.0