mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/2] pstore: remove unused code
Date: Tue,  9 Jul 2019 11:11:31 +0200	[thread overview]
Message-ID: <20190709091131.12298-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20190709091131.12298-1-s.hauer@pengutronix.de>

pstore_info->write() is unused, remove the code implementing it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/pstore/platform.c   | 10 ----------
 fs/pstore/ram.c        | 17 -----------------
 include/linux/pstore.h |  2 --
 3 files changed, 29 deletions(-)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index aafa5559dc..0a6fa38edc 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -79,14 +79,6 @@ static void pstore_console_capture_log(void)
 	}
 }
 
-static int pstore_write_compat(struct pstore_record *record)
-{
-	return record->psi->write_buf(record->type, record->reason,
-				      &record->id, record->part,
-				      psinfo->buf, record->compressed,
-				      record->size, record->psi);
-}
-
 /*
  * platform specific persistent storage driver registers with
  * us here. If pstore is already mounted, call the platform
@@ -107,8 +99,6 @@ int pstore_register(struct pstore_info *psi)
 		return -EBUSY;
 	}
 
-	if (!psi->write)
-		psi->write = pstore_write_compat;
 	psinfo = psi;
 	mutex_init(&psinfo->read_mutex);
 	spin_unlock(&pstore_lock);
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 734d0c3c1d..86049f989e 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -609,22 +609,7 @@ static int ramoops_probe(struct device_d *dev)
 		goto fail_init_mprz;
 
 	cxt->pstore.data = cxt;
-	/*
-	 * Console can handle any buffer size, so prefer LOG_LINE_MAX. If we
-	 * have to handle dumps, we must have at least record_size buffer. And
-	 * for ftrace, bufsize is irrelevant (if bufsize is 0, buf will be
-	 * ZERO_SIZE_PTR).
-	 */
-	if (cxt->console_size)
-		cxt->pstore.bufsize = 1024; /* LOG_LINE_MAX */
-	cxt->pstore.bufsize = max(cxt->record_size, cxt->pstore.bufsize);
-	cxt->pstore.buf = kmalloc(cxt->pstore.bufsize, GFP_KERNEL);
 	spin_lock_init(&cxt->pstore.buf_lock);
-	if (!cxt->pstore.buf) {
-		pr_err("cannot allocate pstore buffer\n");
-		err = -ENOMEM;
-		goto fail_clear;
-	}
 
 	err = pstore_register(&cxt->pstore);
 	if (err) {
@@ -661,9 +646,7 @@ static int ramoops_probe(struct device_d *dev)
 	return 0;
 
 fail_buf:
-	kfree(cxt->pstore.buf);
 fail_clear:
-	cxt->pstore.bufsize = 0;
 	kfree(cxt->mprz);
 fail_init_mprz:
 	kfree(cxt->fprz);
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index dabb639111..f598f31a54 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -64,8 +64,6 @@ struct pstore_record {
 struct pstore_info {
 	struct module	*owner;
 	char		*name;
-	char		*buf;
-	size_t		bufsize;
 	int		flags;
 	int		(*open)(struct pstore_info *psi);
 	int		(*close)(struct pstore_info *psi);
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2019-07-09  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09  9:11 [PATCH 1/2] pstore: Only capture log messages Sascha Hauer
2019-07-09  9:11 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190709091131.12298-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox