[U-Boot] [PATCH v0 1/4] Groundwork for generalization of env interface

Gerlando Falauto gerlando.falauto at keymile.com
Mon Nov 7 22:06:33 CET 2011


On 11/05/2011 05:09 PM, Wolfgang Denk wrote:

[NOTE: I removed the quoting from the hunks as it would not make any sense]

-int _do_env_set (int flag, int argc, char * const argv[])
+int env_check_apply(const char *name, const char *oldval,
+		    const char *newval, int flag)

> Please use only TAB for indentation.  Please fix globally.

 From fs/ubibfs/ubifs.h:

int ubifs_decompress(const void *buf, int len, void *out, int *out_len,
		     int compr_type);

Here there are 2 tabs + 5 spaces to align arguments from the first line 
with those on the second line. I did the same (except that in a patch 
hunk the plus sign before the first tab shifts it to the right).

Could you please provide some examples as to what would be the correct 
coding style for function declarations and/or function calls that spawn 
on multiple lines? I could not find anything on the topic.

As for:

-	if (ep) {		/* variable exists */
+	if ((oldval != NULL) /* variable exists */
+	 && ((flag & H_FORCE) == 0)) { /* and we are not forced */

Ditto. Here I was trying to align parentheses. Could you please provide 
an example? In my opinion, using only tabs would definitely make the two 
lines not aligned and make the code much harder to read.

As for:

+	if (himport_ex(&env_htab, (char *)default_environment,
+		    sizeof(default_environment), '\0', 0,
+		      0, NULL, apply_function) == 0) {

What should be the right indentation?

Perhaps for function calls you would want something like:

+	if (himport_ex(&env_htab, (char *)default_environment,
+		sizeof(default_environment), '\0', 0,
+		0, NULL, apply_function) == 0) {

As soon as I have these questions answered, I will apply all the other 
changes you requested, and submit a new patchset.
I would very much appreciate some feedback about the idea though.

Thank you,
Gerlando Falauto


More information about the U-Boot mailing list