From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754188AbcGVNqV (ORCPT ); Fri, 22 Jul 2016 09:46:21 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:35687 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803AbcGVNqU (ORCPT ); Fri, 22 Jul 2016 09:46:20 -0400 From: Namhyung Kim To: Kees Cook Cc: LKML , Anton Vorontsov , Colin Cross , Tony Luck Subject: [PATCH v3.1 2/2] pstore/ram: Set pstore flags dynamically Date: Fri, 22 Jul 2016 22:45:18 +0900 Message-Id: <1469195118-22441-1-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1469062758-1190-1-git-send-email-namhyung@kernel.org> References: <1469062758-1190-1-git-send-email-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ramoops can be configured to enable each pstore type by setting their size. In that case, it'd be better not to register disabled types in the first place. Signed-off-by: Namhyung Kim --- fs/pstore/ram.c | 8 +++++++- include/linux/pstore.h | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index d08bfd611b11..c5316c0ac756 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -539,7 +539,13 @@ static int ramoops_probe(struct platform_device *pdev) goto fail_clear; } - cxt->pstore.flags = PSTORE_FLAGS_ALL; + cxt->pstore.flags = PSTORE_FLAGS_DMESG; + if (cxt->console_size) + cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE; + if (cxt->ftrace_size) + cxt->pstore.flags |= PSTORE_FLAGS_FTRACE; + if (cxt->pmsg_size) + cxt->pstore.flags |= PSTORE_FLAGS_PMSG; err = pstore_register(&cxt->pstore); if (err) { diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 3ba0c1af40e5..a6d80bd960cb 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -78,8 +78,6 @@ struct pstore_info { #define PSTORE_FLAGS_FTRACE (1 << 2) #define PSTORE_FLAGS_PMSG (1 << 3) -#define PSTORE_FLAGS_ALL ((1 << 4) - 1) - extern int pstore_register(struct pstore_info *); extern void pstore_unregister(struct pstore_info *); extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); -- 2.8.0