Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] libubigen: remove unnecessary include
@ 2020-01-29 18:50 Bastian Germann
  2020-01-29 18:50 ` [PATCH] libubi: remove private kernel header from includes Bastian Germann
  0 siblings, 1 reply; 3+ messages in thread
From: Bastian Germann @ 2020-01-29 18:50 UTC (permalink / raw)
  To: linux-mtd; +Cc: Bastian Germann

libubigen.h does not use any symbol from mtd/ubi-media.h,
so remove it from includes.

Signed-off-by: Bastian Germann <bastiangermann@fishpost.de>
---
 include/libubigen.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/libubigen.h b/include/libubigen.h
index c25ac20..48d2fad 100644
--- a/include/libubigen.h
+++ b/include/libubigen.h
@@ -26,7 +26,6 @@
 #define __LIBUBIGEN_H__
 
 #include <stdint.h>
-#include <mtd/ubi-media.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] libubi: remove private kernel header from includes
  2020-01-29 18:50 [PATCH] libubigen: remove unnecessary include Bastian Germann
@ 2020-01-29 18:50 ` Bastian Germann
  2020-02-09 21:42   ` David Oberhollenzer
  0 siblings, 1 reply; 3+ messages in thread
From: Bastian Germann @ 2020-01-29 18:50 UTC (permalink / raw)
  To: linux-mtd; +Cc: Bastian Germann

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libubi: remove private kernel header from includes
  2020-01-29 18:50 ` [PATCH] libubi: remove private kernel header from includes Bastian Germann
@ 2020-02-09 21:42   ` David Oberhollenzer
  0 siblings, 0 replies; 3+ messages in thread
From: David Oberhollenzer @ 2020-02-09 21:42 UTC (permalink / raw)
  To: Bastian Germann, linux-mtd

Applied to mtd-utils.git master.

Thanks,

David


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 18:50 [PATCH] libubigen: remove unnecessary include Bastian Germann
2020-01-29 18:50 ` [PATCH] libubi: remove private kernel header from includes Bastian Germann
2020-02-09 21:42   ` David Oberhollenzer

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git