All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mmc-utils 0/6] mmc-utils: various cleanups
@ 2017-12-21 13:33 Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 1/6] mmc-utils: drop macro CHECK Uwe Kleine-König
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2017-12-21 13:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, kernel

Hello,

while trying to teach barebox to do what can be achived in Linux with

	mmc enh_area set ...

(not only by reading but also by stealing code from mmc-utils) I noticed
a few things that when fixed make it easier for me to copy code. These
(and a few more) are fixed in this series.

I hope I sent this series to the right people and list. If not, please
excuse me not knowing it better. I'm thankful for hints where to send
patches like this instead in the future.

Best regards
Uwe

Uwe Kleine-König (6):
  mmc-utils: drop macro CHECK
  mmc-utils: drop unused header
  mmc-utils: make use of dependency information generated by gcc
  mmc-utils: expand .gitignore
  mmc-utils: move offsetof from mmc.h to only user
  mmc-utils: remove unused #includes

 .gitignore |   8 ++--
 Makefile   |   2 +
 lsmmc.c    |  18 ++++++---
 mmc.h      |   8 ----
 mmc_cmds.c | 134 +++++++++++++++++++++++++++++++++++++++----------------------
 5 files changed, 103 insertions(+), 67 deletions(-)

-- 
2.15.1


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

* [PATCH mmc-utils 1/6] mmc-utils: drop macro CHECK
  2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
@ 2017-12-21 13:33 ` Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 2/6] mmc-utils: drop unused header Uwe Kleine-König
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2017-12-21 13:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, kernel

This macro saves a few lines of code but is harder to read than the
equivalent code spelled out. IMHO the latter is more important, so
expand the macro everywhere and drop it.

While touching this also unbreak the strings used there for better
grepability.
---
 lsmmc.c    |  18 ++++++---
 mmc.h      |   3 --
 mmc_cmds.c | 124 ++++++++++++++++++++++++++++++++++++++++---------------------
 3 files changed, 93 insertions(+), 52 deletions(-)

diff --git a/lsmmc.c b/lsmmc.c
index 71e6a58d26fc..c4faa002e780 100644
--- a/lsmmc.c
+++ b/lsmmc.c
@@ -2348,8 +2348,10 @@ int do_read_csd(int argc, char **argv)
 	struct config config;
 	int ret;
 
-	CHECK(argc != 2 && argc != 3, "Usage: Print CSD data from <device path>.\n",
-	      exit(1));
+	if (argc != 2 && argc != 3) {
+		fprintf(stderr, "Usage: Print CSD data from <device path>.\n");
+		exit(1);
+	}
 
 	ret = lsmmc_main(&config, argc, argv);
 	if (ret)
@@ -2369,8 +2371,10 @@ int do_read_cid(int argc, char **argv)
 	struct config config;
 	int ret;
 
-	CHECK(argc != 2 && argc != 3, "Usage: Print CID data from <device path>.\n",
-	      exit(1));
+	if (argc != 2 && argc != 3) {
+		fprintf(stderr, "Usage: Print CID data from <device path>.\n");
+		exit(1);
+	}
 
 	ret = lsmmc_main(&config, argc, argv);
 	if (ret)
@@ -2390,8 +2394,10 @@ int do_read_scr(int argc, char **argv)
 	struct config config;
 	int ret;
 
-	CHECK(argc != 2 && argc != 3, "Usage: Print SCR data from <device path>.\n",
-	      exit(1));
+	if (argc != 2 && argc != 3) {
+		fprintf(stderr, "Usage: Print SCR data from <device path>.\n");
+		exit(1);
+	}
 
 	ret = lsmmc_main(&config, argc, argv);
 	if (ret)
diff --git a/mmc.h b/mmc.h
index fa49df6f79f8..4beb4fd1a819 100644
--- a/mmc.h
+++ b/mmc.h
@@ -19,9 +19,6 @@
 
 #include <asm-generic/int-ll64.h>
 #include <linux/mmc/ioctl.h>
-#include <stdio.h>
-
-#define CHECK(expr, msg, err_stmt) { if (expr) { fprintf(stderr, msg); err_stmt; } }
 
 #ifndef offsetof
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
diff --git a/mmc_cmds.c b/mmc_cmds.c
index d7215bb8921f..f1c70fb5fe55 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -231,9 +231,10 @@ int do_writeprotect_boot_get(int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2,
-		"Usage: mmc writeprotect boot get </path/to/mmcblkX>\n",
-		exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc writeprotect boot get </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	device = argv[1];
 
@@ -260,9 +261,10 @@ int do_writeprotect_boot_set(int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2,
-		"Usage: mmc writeprotect boot set </path/to/mmcblkX>\n",
-		exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc writeprotect boot set </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	device = argv[1];
 
@@ -325,9 +327,10 @@ int do_writeprotect_user_get(int nargs, char **argv)
 	__u32 last_prot = -1;
 	int remain;
 
-	CHECK(nargs != 2,
-		"Usage: mmc writeprotect user get </path/to/mmcblkX>\n",
-		exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc writeprotect user get </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	device = argv[1];
 
@@ -482,7 +485,11 @@ int do_disable_512B_emulation(int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2, "Usage: mmc disable 512B emulation </path/to/mmcblkX>\n", exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc disable 512B emulation </path/to/mmcblkX>\n");
+		exit(1);
+	}
+
 	device = argv[1];
 
 	fd = open(device, O_RDWR);
@@ -528,8 +535,10 @@ int do_write_boot_en(int nargs, char **argv)
 	char *device;
 	int boot_area, send_ack;
 
-	CHECK(nargs != 4, "Usage: mmc bootpart enable <partition_number> "
-			  "<send_ack> </path/to/mmcblkX>\n", exit(1));
+	if (nargs != 4) {
+		fprintf(stderr, "Usage: mmc bootpart enable <partition_number> <send_ack> </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	/*
 	 * If <send_ack> is 1, the device will send acknowledgment
@@ -596,9 +605,10 @@ int do_boot_bus_conditions_set(int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 5, "Usage: mmc: bootbus set <boot_mode> "
-	      "<reset_boot_bus_conditions> <boot_bus_width> <device>\n",
-		exit(1));
+	if (nargs != 5) {
+		fprintf(stderr, "Usage: mmc: bootbus set <boot_mode> <reset_boot_bus_conditions> <boot_bus_width> <device>\n");
+		exit(1);
+	}
 
 	if (strcmp(argv[1], "single_backward") == 0)
 		value |= 0;
@@ -664,8 +674,10 @@ int do_hwreset(int value, int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2, "Usage: mmc hwreset enable </path/to/mmcblkX>\n",
-			  exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc hwreset enable </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	device = argv[1];
 
@@ -723,8 +735,10 @@ int do_write_bkops_en(int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2, "Usage: mmc bkops enable </path/to/mmcblkX>\n",
-			exit(1));
+	if (nargs != 2) {
+	       fprintf(stderr, "Usage: mmc bkops enable </path/to/mmcblkX>\n");
+	       exit(1);
+	}
 
 	device = argv[1];
 
@@ -761,8 +775,10 @@ int do_status_get(int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2, "Usage: mmc status get </path/to/mmcblkX>\n",
-		exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc status get </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	device = argv[1];
 
@@ -963,8 +979,10 @@ int do_create_gp_partition(int nargs, char **argv)
 	unsigned int length_kib, gp_size_mult;
 	unsigned long align;
 
-	CHECK(nargs != 7, "Usage: mmc gp create <-y|-n|-c> <length KiB> "
-		"<partition> <enh_attr> <ext_attr> </path/to/mmcblkX>\n", exit(1));
+	if (nargs != 7) {
+		fprintf(stderr, "Usage: mmc gp create <-y|-n|-c> <length KiB> <partition> <enh_attr> <ext_attr> </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	if (!strcmp("-y", argv[1])) {
 		dry_run = 0;
@@ -1089,8 +1107,10 @@ int do_enh_area_set(int nargs, char **argv)
 	unsigned int start_kib, length_kib, enh_start_addr, enh_size_mult;
 	unsigned long align;
 
-	CHECK(nargs != 5, "Usage: mmc enh_area set <-y|-n|-c> <start KiB> <length KiB> "
-			  "</path/to/mmcblkX>\n", exit(1));
+	if (nargs != 5) {
+		fprintf(stderr, "Usage: mmc enh_area set <-y|-n|-c> <start KiB> <length KiB> </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	if (!strcmp("-y", argv[1])) {
 		dry_run = 0;
@@ -1234,8 +1254,10 @@ int do_write_reliability_set(int nargs, char **argv)
 	int partition;
 	char *device;
 
-	CHECK(nargs != 4, "Usage: mmc write_reliability set <-y|-n|-c> "
-			"<partition> </path/to/mmcblkX>\n", exit(1));
+	if (nargs != 4) {
+		fprintf(stderr,"Usage: mmc write_reliability set <-y|-n|-c> <partition> </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	if (!strcmp("-y", argv[1])) {
 		dry_run = 0;
@@ -1297,8 +1319,10 @@ int do_read_extcsd(int nargs, char **argv)
 	char *device;
 	const char *str;
 
-	CHECK(nargs != 2, "Usage: mmc extcsd read </path/to/mmcblkX>\n",
-			  exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc extcsd read </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	device = argv[1];
 
@@ -1761,8 +1785,10 @@ int do_sanitize(int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2, "Usage: mmc sanitize </path/to/mmcblkX>\n",
-			exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc sanitize </path/to/mmcblkX>\n");
+		exit(1);
+	}
 
 	device = argv[1];
 
@@ -1933,8 +1959,10 @@ int do_rpmb_write_key(int nargs, char **argv)
 		.req_resp = htobe16(MMC_RPMB_WRITE_KEY)
 	}, frame_out;
 
-	CHECK(nargs != 3, "Usage: mmc rpmb write-key </path/to/mmcblkXrpmb> </path/to/key>\n",
-			exit(1));
+	if (nargs != 3) {
+		fprintf(stderr, "Usage: mmc rpmb write-key </path/to/mmcblkXrpmb> </path/to/key>\n");
+		exit(1);
+	}
 
 	dev_fd = open(argv[1], O_RDWR);
 	if (dev_fd < 0) {
@@ -2013,8 +2041,10 @@ int do_rpmb_read_counter(int nargs, char **argv)
 	int ret, dev_fd;
 	unsigned int cnt;
 
-	CHECK(nargs != 2, "Usage: mmc rpmb read-counter </path/to/mmcblkXrpmb>\n",
-			exit(1));
+	if (nargs != 2) {
+		fprintf(stderr, "Usage: mmc rpmb read-counter </path/to/mmcblkXrpmb>\n");
+		exit(1);
+	}
 
 	dev_fd = open(argv[1], O_RDWR);
 	if (dev_fd < 0) {
@@ -2046,8 +2076,10 @@ int do_rpmb_read_block(int nargs, char **argv)
 		.req_resp    = htobe16(MMC_RPMB_READ),
 	}, *frame_out_p;
 
-	CHECK(nargs != 5 && nargs != 6, "Usage: mmc rpmb read-block </path/to/mmcblkXrpmb> <address> <blocks count> </path/to/output_file> [/path/to/key]\n",
-			exit(1));
+	if (nargs != 5 && nargs != 6) {
+		fprintf(stderr, "Usage: mmc rpmb read-block </path/to/mmcblkXrpmb> <address> <blocks count> </path/to/output_file> [/path/to/key]\n");
+		exit(1);
+	}
 
 	dev_fd = open(argv[1], O_RDWR);
 	if (dev_fd < 0) {
@@ -2195,8 +2227,10 @@ int do_rpmb_write_block(int nargs, char **argv)
 		.block_count = htobe16(1)
 	}, frame_out;
 
-	CHECK(nargs != 5, "Usage: mmc rpmb write-block </path/to/mmcblkXrpmb> <address> </path/to/input_file> </path/to/key>\n",
-			exit(1));
+	if (nargs != 5) {
+		fprintf(stderr, "Usage: mmc rpmb write-block </path/to/mmcblkXrpmb> <address> </path/to/input_file> </path/to/key>\n");
+		exit(1);
+	}
 
 	dev_fd = open(argv[1], O_RDWR);
 	if (dev_fd < 0) {
@@ -2300,8 +2334,10 @@ int do_cache_ctrl(int value, int nargs, char **argv)
 	int fd, ret;
 	char *device;
 
-	CHECK(nargs != 2, "Usage: mmc cache enable </path/to/mmcblkX>\n",
-			  exit(1));
+	if (nargs != 2) {
+	       fprintf(stderr, "Usage: mmc cache enable </path/to/mmcblkX>\n");
+	       exit(1);
+	}
 
 	device = argv[1];
 
@@ -2373,8 +2409,10 @@ int do_ffu(int nargs, char **argv)
 	char *device;
 	struct mmc_ioc_multi_cmd *multi_cmd;
 
-	CHECK(nargs != 3, "Usage: ffu <image name> </path/to/mmcblkX> \n",
-			exit(1));
+	if (nargs != 3) {
+		fprintf(stderr, "Usage: ffu <image name> </path/to/mmcblkX> \n");
+		exit(1);
+	}
 
 	device = argv[2];
 	dev_fd = open(device, O_RDWR);
-- 
2.15.1


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

* [PATCH mmc-utils 2/6] mmc-utils: drop unused header
  2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 1/6] mmc-utils: drop macro CHECK Uwe Kleine-König
@ 2017-12-21 13:33 ` Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 3/6] mmc-utils: make use of dependency information generated by gcc Uwe Kleine-König
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2017-12-21 13:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, kernel

---
 mmc.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mmc.h b/mmc.h
index 4beb4fd1a819..d01a55f18805 100644
--- a/mmc.h
+++ b/mmc.h
@@ -17,7 +17,6 @@
  * those modifications are Copyright (c) 2016 SanDisk Corp.
  */
 
-#include <asm-generic/int-ll64.h>
 #include <linux/mmc/ioctl.h>
 
 #ifndef offsetof
-- 
2.15.1


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

* [PATCH mmc-utils 3/6] mmc-utils: make use of dependency information generated by gcc
  2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 1/6] mmc-utils: drop macro CHECK Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 2/6] mmc-utils: drop unused header Uwe Kleine-König
@ 2017-12-21 13:33 ` Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 4/6] mmc-utils: expand .gitignore Uwe Kleine-König
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2017-12-21 13:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, kernel

While these dependency information was generated from the start of mmc-utils
it was never used.

Using these informations results in mmc being rebuild when e.g. mmc.h
was touched.
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index 5e4eb1cb0153..aa27ff2b7707 100644
--- a/Makefile
+++ b/Makefile
@@ -52,4 +52,6 @@ install: $(progs) install-man
 	$(INSTALL) -m755 -d $(DESTDIR)$(bindir)
 	$(INSTALL) $(progs) $(DESTDIR)$(bindir)
 
+-include $(foreach obj,$(objects), $(dir $(obj))/.$(notdir $(obj)).d)
+
 .PHONY: all clean install manpages install-man
-- 
2.15.1


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

* [PATCH mmc-utils 4/6] mmc-utils: expand .gitignore
  2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2017-12-21 13:33 ` [PATCH mmc-utils 3/6] mmc-utils: make use of dependency information generated by gcc Uwe Kleine-König
@ 2017-12-21 13:33 ` Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 5/6] mmc-utils: move offsetof from mmc.h to only user Uwe Kleine-König
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2017-12-21 13:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, kernel

Instead of adding .o and .o.d files for the files that are not
explicitly mentioned, add a pattern matching also all future files of
these types. This makes git status stop to mention

	3rdparty/hmac_sha/.hmac_sha2.o.d
	3rdparty/hmac_sha/.sha2.o.d
	3rdparty/hmac_sha/hmac_sha2.o
	3rdparty/hmac_sha/sha2.o
	.lsmmc.o.d
	lsmmc.o
---
 .gitignore | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5a94d4731f72..2a0cb3034cdb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-.mmc.o.d
-.mmc_cmds.o.d
-mmc
-mmc.o
-mmc_cmds.o
+.*.o.d
+*.o
+/mmc
-- 
2.15.1


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

* [PATCH mmc-utils 5/6] mmc-utils: move offsetof from mmc.h to only user
  2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2017-12-21 13:33 ` [PATCH mmc-utils 4/6] mmc-utils: expand .gitignore Uwe Kleine-König
@ 2017-12-21 13:33 ` Uwe Kleine-König
  2017-12-21 13:33 ` [PATCH mmc-utils 6/6] mmc-utils: remove unused #includes Uwe Kleine-König
  2017-12-21 14:21 ` [PATCH mmc-utils 0/6] mmc-utils: various cleanups Ulf Hansson
  6 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2017-12-21 13:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, kernel

offsetof isn't mmc specific, so remove it from mmc.h. As there is only a single user
define it there.
---
 mmc.h      | 4 ----
 mmc_cmds.c | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mmc.h b/mmc.h
index d01a55f18805..285c1f1c9423 100644
--- a/mmc.h
+++ b/mmc.h
@@ -19,10 +19,6 @@
 
 #include <linux/mmc/ioctl.h>
 
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
 /* From kernel linux/major.h */
 #define MMC_BLOCK_MAJOR			179
 
diff --git a/mmc_cmds.c b/mmc_cmds.c
index f1c70fb5fe55..cec947da1d4a 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -38,6 +38,10 @@
 #include "mmc_cmds.h"
 #include "3rdparty/hmac_sha/hmac_sha2.h"
 
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
 #define WP_BLKS_PER_QUERY 32
 
 #define USER_WP_PERM_PSWD_DIS	0x80
-- 
2.15.1


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

* [PATCH mmc-utils 6/6] mmc-utils: remove unused #includes
  2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2017-12-21 13:33 ` [PATCH mmc-utils 5/6] mmc-utils: move offsetof from mmc.h to only user Uwe Kleine-König
@ 2017-12-21 13:33 ` Uwe Kleine-König
  2017-12-21 14:21 ` [PATCH mmc-utils 0/6] mmc-utils: various cleanups Ulf Hansson
  6 siblings, 0 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2017-12-21 13:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, kernel

I didn't find any functions used for which the documentation specifies to
use (at least) one of the dropped headers.

The only Linux specific header <linux/fs.h> is needed for BLKGETSIZE,
document that.
---
 mmc_cmds.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mmc_cmds.c b/mmc_cmds.c
index cec947da1d4a..038dbd42e6bf 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -22,17 +22,13 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
-#include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <libgen.h>
-#include <limits.h>
-#include <ctype.h>
 #include <errno.h>
 #include <stdint.h>
 #include <assert.h>
-#include <linux/fs.h>
+#include <linux/fs.h> /* for BLKGETSIZE */
 
 #include "mmc.h"
 #include "mmc_cmds.h"
-- 
2.15.1


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

* Re: [PATCH mmc-utils 0/6] mmc-utils: various cleanups
  2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2017-12-21 13:33 ` [PATCH mmc-utils 6/6] mmc-utils: remove unused #includes Uwe Kleine-König
@ 2017-12-21 14:21 ` Ulf Hansson
  2018-01-11 20:57   ` Uwe Kleine-König
  6 siblings, 1 reply; 11+ messages in thread
From: Ulf Hansson @ 2017-12-21 14:21 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Chris Ball, linux-mmc, Sascha Hauer

On 21 December 2017 at 14:33, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> Hello,
>
> while trying to teach barebox to do what can be achived in Linux with
>
>         mmc enh_area set ...
>
> (not only by reading but also by stealing code from mmc-utils) I noticed
> a few things that when fixed make it easier for me to copy code. These
> (and a few more) are fixed in this series.
>
> I hope I sent this series to the right people and list. If not, please
> excuse me not knowing it better. I'm thankful for hints where to send
> patches like this instead in the future.

This is the right place!

Chris maintains mmc-utils, however, I haven't heard from him for quite
a while, let's hope that he sees this!

Kind regards
Uffe

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

* Re: [PATCH mmc-utils 0/6] mmc-utils: various cleanups
  2017-12-21 14:21 ` [PATCH mmc-utils 0/6] mmc-utils: various cleanups Ulf Hansson
@ 2018-01-11 20:57   ` Uwe Kleine-König
  2018-01-15 13:00     ` Ulf Hansson
  2018-02-17  1:43     ` Chris Ball
  0 siblings, 2 replies; 11+ messages in thread
From: Uwe Kleine-König @ 2018-01-11 20:57 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Chris Ball, Sascha Hauer

On Thu, Dec 21, 2017 at 03:21:33PM +0100, Ulf Hansson wrote:
> On 21 December 2017 at 14:33, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > while trying to teach barebox to do what can be achived in Linux with
> >
> >         mmc enh_area set ...
> >
> > (not only by reading but also by stealing code from mmc-utils) I noticed
> > a few things that when fixed make it easier for me to copy code. These
> > (and a few more) are fixed in this series.
> >
> > I hope I sent this series to the right people and list. If not, please
> > excuse me not knowing it better. I'm thankful for hints where to send
> > patches like this instead in the future.
> 
> This is the right place!
> 
> Chris maintains mmc-utils, however, I haven't heard from him for quite
> a while, let's hope that he sees this!

I heard nothing yet from Chris. So to ease not loosing my work I cloned
Chris' repository to https://github.com/ukleinek/mmc-utils and pushed my
patches there.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH mmc-utils 0/6] mmc-utils: various cleanups
  2018-01-11 20:57   ` Uwe Kleine-König
@ 2018-01-15 13:00     ` Ulf Hansson
  2018-02-17  1:43     ` Chris Ball
  1 sibling, 0 replies; 11+ messages in thread
From: Ulf Hansson @ 2018-01-15 13:00 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-mmc, Chris Ball, Sascha Hauer

On 11 January 2018 at 21:57, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> On Thu, Dec 21, 2017 at 03:21:33PM +0100, Ulf Hansson wrote:
>> On 21 December 2017 at 14:33, Uwe Kleine-König
>> <u.kleine-koenig@pengutronix.de> wrote:
>> > while trying to teach barebox to do what can be achived in Linux with
>> >
>> >         mmc enh_area set ...
>> >
>> > (not only by reading but also by stealing code from mmc-utils) I noticed
>> > a few things that when fixed make it easier for me to copy code. These
>> > (and a few more) are fixed in this series.
>> >
>> > I hope I sent this series to the right people and list. If not, please
>> > excuse me not knowing it better. I'm thankful for hints where to send
>> > patches like this instead in the future.
>>
>> This is the right place!
>>
>> Chris maintains mmc-utils, however, I haven't heard from him for quite
>> a while, let's hope that he sees this!
>
> I heard nothing yet from Chris. So to ease not loosing my work I cloned
> Chris' repository to https://github.com/ukleinek/mmc-utils and pushed my
> patches there.

That's great!

Let's hope Chris gets back to this in a while.

Kind regards
Uffe

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

* Re: [PATCH mmc-utils 0/6] mmc-utils: various cleanups
  2018-01-11 20:57   ` Uwe Kleine-König
  2018-01-15 13:00     ` Ulf Hansson
@ 2018-02-17  1:43     ` Chris Ball
  1 sibling, 0 replies; 11+ messages in thread
From: Chris Ball @ 2018-02-17  1:43 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Ulf Hansson, linux-mmc, Sascha Hauer

Hi Uwe,

On Thu, Jan 11, 2018 at 09:57:43PM +0100, Uwe Kleine-König wrote:
> > Chris maintains mmc-utils, however, I haven't heard from him for quite
> > a while, let's hope that he sees this!
> 
> I heard nothing yet from Chris. So to ease not loosing my work I cloned
> Chris' repository to https://github.com/ukleinek/mmc-utils and pushed my
> patches there.

I'm sorry for the massive delay!  I've reviewed and merged your GitHub
branch into mmc-utils master now.

- Chris.
-- 
Chris Ball   <http://printf.net/>

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

end of thread, other threads:[~2018-02-17  2:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21 13:33 [PATCH mmc-utils 0/6] mmc-utils: various cleanups Uwe Kleine-König
2017-12-21 13:33 ` [PATCH mmc-utils 1/6] mmc-utils: drop macro CHECK Uwe Kleine-König
2017-12-21 13:33 ` [PATCH mmc-utils 2/6] mmc-utils: drop unused header Uwe Kleine-König
2017-12-21 13:33 ` [PATCH mmc-utils 3/6] mmc-utils: make use of dependency information generated by gcc Uwe Kleine-König
2017-12-21 13:33 ` [PATCH mmc-utils 4/6] mmc-utils: expand .gitignore Uwe Kleine-König
2017-12-21 13:33 ` [PATCH mmc-utils 5/6] mmc-utils: move offsetof from mmc.h to only user Uwe Kleine-König
2017-12-21 13:33 ` [PATCH mmc-utils 6/6] mmc-utils: remove unused #includes Uwe Kleine-König
2017-12-21 14:21 ` [PATCH mmc-utils 0/6] mmc-utils: various cleanups Ulf Hansson
2018-01-11 20:57   ` Uwe Kleine-König
2018-01-15 13:00     ` Ulf Hansson
2018-02-17  1:43     ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.