Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1492659 > unrolled thread

[PATCH 00/10] md/dm-crypt: Fine-tuning for five function implementations

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-09-28 17:40 +0200
Last post2016-09-28 17:50 +0200
Articles 20 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 00/10] md/dm-crypt: Fine-tuning for five function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:40 +0200
    [PATCH 06/10] md/dm-crypt: Delete an unnecessary variable  initialisation in crypt_set_key() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200
    [PATCH 04/10] md/dm-crypt: Delete an unnecessary variable  initialisation in crypt_message() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200
    [PATCH 08/10] md/dm-crypt: Return directly after a failed  crypto_alloc_ahash() in crypt_iv_essiv_ctr() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200
    [PATCH 05/10] md/dm-crypt: Rename a jump label in crypt_set_key() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200
      Re: [dm-devel] [PATCH 05/10] md/dm-crypt: Rename a jump label in  crypt_set_key() Theodore Ts'o <tytso@mit.edu> - 2016-09-29 15:00 +0200
    [PATCH 09/10] md/dm-crypt: Two checks and one function call less in  crypt_iv_essiv_ctr() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200
    [PATCH 10/10] md/dm-crypt: Delete unnecessary variable  initialisations in crypt_iv_essiv_ctr() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200
    [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200
      Re: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in  crypt_message() Theodore Ts'o <tytso@mit.edu> - 2016-09-29 15:00 +0200
        Re: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in  crypt_message() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-29 17:50 +0200
          Re: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in  crypt_message() Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-30 12:10 +0200
            Re: md/dm-crypt: Rename a jump label in crypt_message() ? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-30 13:40 +0200
              Re: md/dm-crypt: Rename a jump label in crypt_message() ? Bjørn Mork <bjorn@mork.no> - 2016-09-30 13:50 +0200
                Re: md/dm-crypt: Rename a jump label in crypt_message() ? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-30 14:00 +0200
                  Re: md/dm-crypt: Rename a jump label in crypt_message() ? Bjørn Mork <bjorn@mork.no> - 2016-09-30 14:10 +0200
                    Re: md/dm-crypt: Rename a jump label in crypt_message() ? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-30 15:00 +0200
              Re: md/dm-crypt: Rename a jump label in crypt_message() ? Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-30 14:10 +0200
                Re: md/dm-crypt: Rename a jump label in crypt_message() ? SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-30 14:30 +0200
    [PATCH 07/10] md/dm-crypt: Rename a jump label in  crypt_iv_tcw_whitening() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 17:50 +0200

#1492659 — [PATCH 00/10] md/dm-crypt: Fine-tuning for five function implementations

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:40 +0200
Subject[PATCH 00/10] md/dm-crypt: Fine-tuning for five function implementations
Message-ID<smp7H-7L-7@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 17:25:17 +0200

Some update suggestions were taken into account
from static source code analysis.

Markus Elfring (10):
  Use kcalloc() in crypt_alloc_tfms()
  Reduce the scope for a variable in crypt_alloc_tfms()
  Rename a jump label in crypt_message()
  Delete an unnecessary variable initialisation in crypt_message()
  Rename a jump label in crypt_set_key()
  Delete an unnecessary variable initialisation in crypt_set_key()
  Rename a jump label in crypt_iv_tcw_whitening()
  Return directly after a failed crypto_alloc_ahash() in crypt_iv_essiv_ctr()
  Two checks and one function call less in crypt_iv_essiv_ctr() after error detection
  Delete unnecessary variable initialisations in crypt_iv_essiv_ctr()

 drivers/md/dm-crypt.c | 51 ++++++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 29 deletions(-)

-- 
2.10.0

[toc] | [next] | [standalone]


#1492661 — [PATCH 06/10] md/dm-crypt: Delete an unnecessary variable initialisation in crypt_set_key()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 06/10] md/dm-crypt: Delete an unnecessary variable initialisation in crypt_set_key()
Message-ID<smpho-by-17@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 15:24:13 +0200

The local variable "r" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 7e0fd82..3bc54c1 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1491,7 +1491,7 @@ static int crypt_setkey_allcpus(struct crypt_config *cc)
 
 static int crypt_set_key(struct crypt_config *cc, char *key)
 {
-	int r = -EINVAL;
+	int r;
 	int key_string_len = strlen(key);
 
 	/* The key size may not be changed. */
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1492663 — [PATCH 04/10] md/dm-crypt: Delete an unnecessary variable initialisation in crypt_message()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 04/10] md/dm-crypt: Delete an unnecessary variable initialisation in crypt_message()
Message-ID<smpho-by-11@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 15:06:05 +0200

The local variable "ret" will be set to an appropriate value in if branches.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 08e3de2..7778e9b 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -2013,7 +2013,7 @@ static void crypt_resume(struct dm_target *ti)
 static int crypt_message(struct dm_target *ti, unsigned argc, char **argv)
 {
 	struct crypt_config *cc = ti->private;
-	int ret = -EINVAL;
+	int ret;
 
 	if (argc < 2)
 		goto show_warning;
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1492664 — [PATCH 08/10] md/dm-crypt: Return directly after a failed crypto_alloc_ahash() in crypt_iv_essiv_ctr()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 08/10] md/dm-crypt: Return directly after a failed crypto_alloc_ahash() in crypt_iv_essiv_ctr()
Message-ID<smpho-by-25@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 15:55:47 +0200

Return directly after a call of the function "crypto_alloc_ahash"
failed here.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index c457b5e..47f6265 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -375,8 +375,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
 	hash_tfm = crypto_alloc_ahash(opts, 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(hash_tfm)) {
 		ti->error = "Error initializing ESSIV hash";
-		err = PTR_ERR(hash_tfm);
-		goto bad;
+		return PTR_ERR(hash_tfm);
 	}
 
 	salt = kzalloc(crypto_ahash_digestsize(hash_tfm), GFP_KERNEL);
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1492665 — [PATCH 05/10] md/dm-crypt: Rename a jump label in crypt_set_key()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 05/10] md/dm-crypt: Rename a jump label in crypt_set_key()
Message-ID<smpho-by-27@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 15:21:18 +0200

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 7778e9b..7e0fd82 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1496,20 +1496,19 @@ static int crypt_set_key(struct crypt_config *cc, char *key)
 
 	/* The key size may not be changed. */
 	if (cc->key_size != (key_string_len >> 1))
-		goto out;
+		goto set_memory;
 
 	/* Hyphen (which gives a key_size of zero) means there is no key. */
 	if (!cc->key_size && strcmp(key, "-"))
-		goto out;
+		goto set_memory;
 
 	if (cc->key_size && crypt_decode_key(cc->key, key, cc->key_size) < 0)
-		goto out;
+		goto set_memory;
 
 	set_bit(DM_CRYPT_KEY_VALID, &cc->flags);
 
 	r = crypt_setkey_allcpus(cc);
-
-out:
+set_memory:
 	/* Hex key string not needed after here, so wipe it. */
 	memset(key, '0', key_string_len);
 
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1493444 — Re: [dm-devel] [PATCH 05/10] md/dm-crypt: Rename a jump label in crypt_set_key()

FromTheodore Ts'o <tytso@mit.edu>
Date2016-09-29 15:00 +0200
SubjectRe: [dm-devel] [PATCH 05/10] md/dm-crypt: Rename a jump label in crypt_set_key()
Message-ID<smJ6p-4eJ-1@gated-at.bofh.it>
In reply to#1492665
On Wed, Sep 28, 2016 at 05:42:28PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 28 Sep 2016 15:21:18 +0200
> 
> Adjust jump labels according to the current Linux coding style convention.
> 
> -
> -out:
> +set_memory:
>  	/* Hex key string not needed after here, so wipe it. */
>  	memset(key, '0', key_string_len);

Also not "current Linux coding style convetion".

							- Ted

[toc] | [prev] | [next] | [standalone]


#1492667 — [PATCH 09/10] md/dm-crypt: Two checks and one function call less in crypt_iv_essiv_ctr() after error detection

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 09/10] md/dm-crypt: Two checks and one function call less in crypt_iv_essiv_ctr() after error detection
Message-ID<smpho-by-13@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 16:38:37 +0200

The kfree() function was called in one case by the crypt_iv_essiv_ctr()
function during error handling even if the passed variable "salt"
contained a null pointer.

* Adjust a jump target according to the Linux coding style convention.

* Delete this function call and a condition check which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 47f6265..53a9155 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -382,7 +382,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
 	if (!salt) {
 		ti->error = "Error kmallocing salt storage in ESSIV";
 		err = -ENOMEM;
-		goto bad;
+		goto free_hash;
 	}
 
 	cc->iv_gen_private.essiv.salt = salt;
@@ -397,11 +397,8 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
 	cc->iv_private = essiv_tfm;
 
 	return 0;
-
-bad:
-	if (hash_tfm && !IS_ERR(hash_tfm))
-		crypto_free_ahash(hash_tfm);
-	kfree(salt);
+free_hash:
+	crypto_free_ahash(hash_tfm);
 	return err;
 }
 
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1492669 — [PATCH 10/10] md/dm-crypt: Delete unnecessary variable initialisations in crypt_iv_essiv_ctr()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 10/10] md/dm-crypt: Delete unnecessary variable initialisations in crypt_iv_essiv_ctr()
Message-ID<smpho-by-23@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 16:44:32 +0200

Three local variables will be set to an appropriate pointer a bit later.
Thus omit the explicit initialisation which became unnecessary with
a previous update step.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 53a9155..d27716e 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -361,9 +361,9 @@ static void crypt_iv_essiv_dtr(struct crypt_config *cc)
 static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
 			      const char *opts)
 {
-	struct crypto_cipher *essiv_tfm = NULL;
-	struct crypto_ahash *hash_tfm = NULL;
-	u8 *salt = NULL;
+	struct crypto_cipher *essiv_tfm;
+	struct crypto_ahash *hash_tfm;
+	u8 *salt;
 	int err;
 
 	if (!opts) {
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1492670 — [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()
Message-ID<smpho-by-21@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 14:54:39 +0200

Adjust a jump label according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 88a3b62..08e3de2 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -2016,7 +2016,7 @@ static int crypt_message(struct dm_target *ti, unsigned argc, char **argv)
 	int ret = -EINVAL;
 
 	if (argc < 2)
-		goto error;
+		goto show_warning;
 
 	if (!strcasecmp(argv[0], "key")) {
 		if (!test_bit(DM_CRYPT_SUSPENDED, &cc->flags)) {
@@ -2040,8 +2040,7 @@ static int crypt_message(struct dm_target *ti, unsigned argc, char **argv)
 			return crypt_wipe_key(cc);
 		}
 	}
-
-error:
+show_warning:
 	DMWARN("unrecognised message received.");
 	return -EINVAL;
 }
-- 
2.10.0

[toc] | [prev] | [next] | [standalone]


#1493446 — Re: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()

FromTheodore Ts'o <tytso@mit.edu>
Date2016-09-29 15:00 +0200
SubjectRe: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()
Message-ID<smJ6q-4eJ-9@gated-at.bofh.it>
In reply to#1492670
On Wed, Sep 28, 2016 at 05:40:14PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 28 Sep 2016 14:54:39 +0200
> 
> Adjust a jump label according to the current Linux coding style convention.

In what bizzaro world is the "current Linux coding style convention"

> -
> -error:
> +show_warning:
>  	DMWARN("unrecognised message received.");
>  	return -EINVAL;
>  }

"show_warning" is better than "error" when the net result of the goto
is that the function returns -EINVAL?!?

Please give it up with these drive-by shooting of auto-generated
patches.  You're just embarassing yourself.

							- Ted

[toc] | [prev] | [next] | [standalone]


#1493538 — Re: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-29 17:50 +0200
SubjectRe: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()
Message-ID<smLKV-5Vi-7@gated-at.bofh.it>
In reply to#1493446
> In what bizzaro world is the "current Linux coding style convention"

Do you look at the evolution for a document like "CodingStyle"?


>> -
>> -error:
>> +show_warning:
>>  	DMWARN("unrecognised message received.");
>>  	return -EINVAL;
>>  }
> 
> "show_warning" is better than "error"

I got such an impression.


> when the net result of the goto is that the function returns -EINVAL?!?

Do other identifiers fit better for the desired description of "what" and "why"
by jump labels?


> Please give it up with these drive-by shooting of auto-generated patches.

This update step was not auto-generated.

There are further change possibilities where special analysis tools
can help in the corresponding software development.


> You're just embarassing yourself.

Do you find any of my update suggestions worth for further considerations?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1494012 — Re: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-09-30 12:10 +0200
SubjectRe: [dm-devel] [PATCH 03/10] md/dm-crypt: Rename a jump label in crypt_message()
Message-ID<sn2Vr-om-17@gated-at.bofh.it>
In reply to#1493538
On Thu, Sep 29, 2016 at 05:43:57PM +0200, SF Markus Elfring wrote:
> > In what bizzaro world is the "current Linux coding style convention"
> 
> Do you look at the evolution for a document like "CodingStyle"?
> 

Again, I wrote the paragraph in CodingStyle.  I just said that it's a
good idea to think about label names instead of using GW-BASIC style
numbered labels, I didn't say go around bothering everyone with waste
of time cleanup patches.

I specifically did not say that "out:" or "error:" labels are bad names.
Those are common style in the kernel.

Please stop sending these patches.

regards,
dan carpenter

[toc] | [prev] | [next] | [standalone]


#1494034 — Re: md/dm-crypt: Rename a jump label in crypt_message() ?

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-30 13:40 +0200
SubjectRe: md/dm-crypt: Rename a jump label in crypt_message() ?
Message-ID<sn4ky-1bg-15@gated-at.bofh.it>
In reply to#1494012
> Again, I wrote the paragraph in CodingStyle.

This is obvious from the corresponding commit "add some more error
handling guidelines" (ea04036032edda6f771c1381d03832d2ed0f6c31
on 2014-12-02).


> I just said that it's a good idea to think about label names

I agree also to such a desire.


> instead of using GW-BASIC style numbered labels,

Is this kind of wording another weakness in the discussed document?
How many guidance do programmers get from such a software specification?

I came a few source code places along where I proposed corresponding changes.


> I didn't say

You did not say anything about some details as it is often easier to express
several aspects in vague and general terms.


> go around bothering everyone with waste of time cleanup patches.

I find it still debatable if the shown software development efforts
are really "wasted".

It seems that also the Linux development community is mixed about
related interpretations.


> I specifically did not say that "out:" or "error:" labels are bad names.

Did you inform me once that you had also a special opinion about an identifier
like "out"?

The C compiler will accept them as usual. But do we occasionally prefer
to express implementation details a bit better there?


> Those are common style in the kernel.

* Which impressions can you get from a statement like "goto fail;"
  or "goto error;"?

* Do any exception handling implementations should be reconsidered
  at such places?


> Please stop sending these patches.

Could it happen that the change acceptance will increase also for
the suggested renaming of jump labels if maintainers from other subsystems
would dare to respond once more in a positive way for such a software refactoring?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1494038 — Re: md/dm-crypt: Rename a jump label in crypt_message() ?

FromBjørn Mork <bjorn@mork.no>
Date2016-09-30 13:50 +0200
SubjectRe: md/dm-crypt: Rename a jump label in crypt_message() ?
Message-ID<sn4ud-1eM-7@gated-at.bofh.it>
In reply to#1494034
SF Markus Elfring <elfring@users.sourceforge.net> writes:

>> go around bothering everyone with waste of time cleanup patches.
>
> I find it still debatable if the shown software development efforts
> are really "wasted".

When someone tells you that you are wasting their time, then that is not
a subject for further discussion.


Bjørn

[toc] | [prev] | [next] | [standalone]


#1494041 — Re: md/dm-crypt: Rename a jump label in crypt_message() ?

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-30 14:00 +0200
SubjectRe: md/dm-crypt: Rename a jump label in crypt_message() ?
Message-ID<sn4DT-1im-5@gated-at.bofh.it>
In reply to#1494038
> When someone tells you that you are wasting their time,

This information can be useful to some degree


> then that is not a subject for further discussion.

I got an other impression. I guess that there are constraints for such a response
which can become interesting for further considerations.

Is it just usual that other software changes are more welcome?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1494061 — Re: md/dm-crypt: Rename a jump label in crypt_message() ?

FromBjørn Mork <bjorn@mork.no>
Date2016-09-30 14:10 +0200
SubjectRe: md/dm-crypt: Rename a jump label in crypt_message() ?
Message-ID<sn4NA-1Be-39@gated-at.bofh.it>
In reply to#1494041
SF Markus Elfring <elfring@users.sourceforge.net> writes:

>> When someone tells you that you are wasting their time,
>
> This information can be useful to some degree

Yes.  If you continue discussing after that point, then you make a clear
statement that it isn't an accident.  You are deliberately wasting their
time.

A lot of people already know this.  But you're right that it would be
useful to make it even clearer.  Maybe you could add a note about it to
each patch?  Something along "I will not listen.  I will not change.
Nothing you tell me will ever make it worth your time to do so"?

Just an idea...



Bjørn

[toc] | [prev] | [next] | [standalone]


#1494087 — Re: md/dm-crypt: Rename a jump label in crypt_message() ?

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-30 15:00 +0200
SubjectRe: md/dm-crypt: Rename a jump label in crypt_message() ?
Message-ID<sn5zX-1U8-5@gated-at.bofh.it>
In reply to#1494061
> If you continue discussing after that point,

I guess that such a condition is not needed.


> then you make a clear statement that it isn't an accident.

I hope that most of my software development activities are not "an accident".
Is the intent for any update suggestion (like the renaming of a jump label
in this case) reasonable to some degree?


> You are deliberately wasting their time.

I imagine that I do not really try to "waste" others time. But I am trying
also to change some "things".
There are circumstances when these contributions are interpreted as "wasted efforts".
Is the change acceptance usually higher for other update patterns?


> Something along "I will not listen.

I am listening while my responses might not fit to your current expectations.


> I will not change.

I have got also some personal change opportunities.


> Nothing you tell me will ever make it worth your time to do so"?

While you can be so clear about a rejection for this software module at the moment,
other contributors showed occasionally more positive information.

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1494049 — Re: md/dm-crypt: Rename a jump label in crypt_message() ?

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-09-30 14:10 +0200
SubjectRe: md/dm-crypt: Rename a jump label in crypt_message() ?
Message-ID<sn4Nz-1Be-3@gated-at.bofh.it>
In reply to#1494034
On Fri, Sep 30, 2016 at 01:32:23PM +0200, SF Markus Elfring wrote:
> > I specifically did not say that "out:" or "error:" labels are bad names.
> 
> Did you inform me once that you had also a special opinion about an identifier
> like "out"?

I don't like out labels, but that's my opinion.  There is nothing in
CodingStyle which says you can't do it.

regards,
dan carpenter

[toc] | [prev] | [next] | [standalone]


#1494070 — Re: md/dm-crypt: Rename a jump label in crypt_message() ?

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-30 14:30 +0200
SubjectRe: md/dm-crypt: Rename a jump label in crypt_message() ?
Message-ID<sn56V-1JG-7@gated-at.bofh.it>
In reply to#1494049
> I don't like out labels, but that's my opinion.

Thanks for this acknowledgement that you have still got a special opinion
about such an identifier.

 
> There is nothing in CodingStyle which says you can't do it.

Does the terse description there try to suggest also to choose
better identifiers for source code places?

Does the meaning of such a coding style specification include also
the selection of a more pleasing identifier than "error"
for this software module?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1492671 — [PATCH 07/10] md/dm-crypt: Rename a jump label in crypt_iv_tcw_whitening()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-09-28 17:50 +0200
Subject[PATCH 07/10] md/dm-crypt: Rename a jump label in crypt_iv_tcw_whitening()
Message-ID<smpho-by-29@gated-at.bofh.it>
In reply to#1492659
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 28 Sep 2016 15:32:15 +0200

Adjust jump labels according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-crypt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 3bc54c1..c457b5e 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -698,13 +698,13 @@ static int crypt_iv_tcw_whitening(struct crypt_config *cc,
 	for (i = 0; i < 4; i++) {
 		r = crypto_shash_init(desc);
 		if (r)
-			goto out;
+			goto zero_memory;
 		r = crypto_shash_update(desc, &buf[i * 4], 4);
 		if (r)
-			goto out;
+			goto zero_memory;
 		r = crypto_shash_final(desc, &buf[i * 4]);
 		if (r)
-			goto out;
+			goto zero_memory;
 	}
 	crypto_xor(&buf[0], &buf[12], 4);
 	crypto_xor(&buf[4], &buf[8], 4);
@@ -712,7 +712,7 @@ static int crypt_iv_tcw_whitening(struct crypt_config *cc,
 	/* apply whitening (8 bytes) to whole sector */
 	for (i = 0; i < ((1 << SECTOR_SHIFT) / 8); i++)
 		crypto_xor(data + i * 8, buf, 8);
-out:
+zero_memory:
 	memzero_explicit(buf, sizeof(buf));
 	return r;
 }
-- 
2.10.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web