|
|
6f381c |
From 7e4b7cc35af0e3b3afbf32fa0fd9961cd01ad9a9 Mon Sep 17 00:00:00 2001
|
|
|
6f381c |
From: Yu Watanabe <watanabe.yu+github@gmail.com>
|
|
|
6f381c |
Date: Mon, 22 Jul 2019 10:52:12 +0900
|
|
|
6f381c |
Subject: [PATCH] pstore: drop unnecessary initializations
|
|
|
6f381c |
|
|
|
6f381c |
(cherry picked from commit 2e4effd129343d22bfed34e94810d3f87c8f0e85)
|
|
|
6f381c |
|
|
|
6f381c |
Related: #2158832
|
|
|
6f381c |
---
|
|
|
6f381c |
src/pstore/pstore.c | 15 ++++++---------
|
|
|
6f381c |
1 file changed, 6 insertions(+), 9 deletions(-)
|
|
|
6f381c |
|
|
|
6f381c |
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c
|
|
|
6f381c |
index f95e016eb6..e6a342fc50 100644
|
|
|
6f381c |
--- a/src/pstore/pstore.c
|
|
|
6f381c |
+++ b/src/pstore/pstore.c
|
|
|
6f381c |
@@ -113,14 +113,12 @@ static int compare_pstore_entries(const void *_a, const void *_b) {
|
|
|
6f381c |
}
|
|
|
6f381c |
|
|
|
6f381c |
static int move_file(PStoreEntry *pe, const char *subdir) {
|
|
|
6f381c |
- _cleanup_free_ char *ifd_path = NULL;
|
|
|
6f381c |
- _cleanup_free_ char *ofd_path = NULL;
|
|
|
6f381c |
- int r = 0;
|
|
|
6f381c |
- struct iovec iovec[2] = {};
|
|
|
6f381c |
- int n_iovec = 0;
|
|
|
6f381c |
+ _cleanup_free_ char *ifd_path = NULL, *ofd_path = NULL;
|
|
|
6f381c |
_cleanup_free_ void *field = NULL;
|
|
|
6f381c |
- const char *suffix = NULL;
|
|
|
6f381c |
+ struct iovec iovec[2];
|
|
|
6f381c |
+ const char *suffix;
|
|
|
6f381c |
size_t field_size;
|
|
|
6f381c |
+ int n_iovec = 0, r;
|
|
|
6f381c |
|
|
|
6f381c |
if (pe->handled)
|
|
|
6f381c |
return 0;
|
|
|
6f381c |
@@ -202,10 +200,9 @@ static int write_dmesg(const char *dmesg, size_t size, const char *id) {
|
|
|
6f381c |
|
|
|
6f381c |
static void process_dmesg_files(PStoreList *list) {
|
|
|
6f381c |
/* Move files, reconstruct dmesg.txt */
|
|
|
6f381c |
- PStoreEntry *pe;
|
|
|
6f381c |
- _cleanup_free_ char *dmesg = NULL;
|
|
|
6f381c |
+ _cleanup_free_ char *dmesg = NULL, *dmesg_id = NULL;
|
|
|
6f381c |
size_t dmesg_size = 0;
|
|
|
6f381c |
- _cleanup_free_ char *dmesg_id = NULL;
|
|
|
6f381c |
+ PStoreEntry *pe;
|
|
|
6f381c |
|
|
|
6f381c |
/* Handle each dmesg file: files processed in reverse
|
|
|
6f381c |
* order so as to properly reconstruct original dmesg */
|