From: Bastian Germann <bastiangermann@fishpost.de>
To: linux-mtd@lists.infradead.org
Cc: Bastian Germann <bastiangermann@fishpost.de>
Subject: [PATCH] libubi: remove private kernel header from includes
Date: Wed, 29 Jan 2020 19:50:13 +0100 [thread overview]
Message-ID: <20200129185013.21752-2-bastiangermann@fishpost.de> (raw)
In-Reply-To: <20200129185013.21752-1-bastiangermann@fishpost.de>
libubi.h includes ubi-media.h which was made private in the kernel a
long time ago. There are users of libubi.h, e.g. swupdate, which have to
have ubi-media.h available at build time with this inclusion.
However, libubi.h uses only one symbol from ubi-media.h. Define that symbol
in the header to enable using libubi.h without installing ubi-media.h.
Make up for the transitive symbol use in ubiformat.c by including ubi-media.h.
Signed-off-by: Bastian Germann <bastiangermann@fishpost.de>
---
include/libubi.h | 4 +++-
ubi-utils/ubiformat.c | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/libubi.h b/include/libubi.h
index 46596a3..46c732a 100644
--- a/include/libubi.h
+++ b/include/libubi.h
@@ -26,7 +26,6 @@
#include <ctype.h>
#include <stdint.h>
#include <mtd/ubi-user.h>
-#include <mtd/ubi-media.h>
#ifdef __cplusplus
extern "C" {
@@ -38,6 +37,9 @@ extern "C" {
/* Maximum physical eraseblock size in bytes */
#define UBI_MAX_PEB_SZ (2*1024*1024)
+/* The maximum volume name length (from Linux's ubi-media.h) */
+#define UBI_VOL_NAME_MAX 127
+
/* UBI library descriptor */
typedef void * libubi_t;
diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c
index be40e52..d1b12e4 100644
--- a/ubi-utils/ubiformat.c
+++ b/ubi-utils/ubiformat.c
@@ -38,6 +38,7 @@
#include <getopt.h>
#include <fcntl.h>
+#include <mtd/ubi-media.h>
#include <libubi.h>
#include <libmtd.h>
#include <libscan.h>
--
2.25.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-01-29 18:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 18:50 [PATCH] libubigen: remove unnecessary include Bastian Germann
2020-01-29 18:50 ` Bastian Germann [this message]
2020-02-09 21:42 ` [PATCH] libubi: remove private kernel header from includes David Oberhollenzer
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=20200129185013.21752-2-bastiangermann@fishpost.de \
--to=bastiangermann@fishpost.de \
--cc=linux-mtd@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;
as well as URLs for NNTP newsgroup(s).