public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Behan Webster <behanw@converseincode.com>
To: Milan Broz <gmazyland@gmail.com>,
	agk@redhat.com, dm-devel@redhat.com, snitzer@redhat.com
Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
	neilb@suse.de, torvalds@linux-foundation.org,
	"Jan-Simon Möller" <dl9pf@gmx.de>,
	pageexec@freemail.hu
Subject: Re: [PATCH v2] crypto, dm: LLVMLinux: Remove VLAIS usage from dm-crypt
Date: Sat, 06 Sep 2014 19:10:06 -0700	[thread overview]
Message-ID: <540BBE7E.2060108@converseincode.com> (raw)
In-Reply-To: <540AC9F7.9000202@gmail.com>

On 09/06/14 01:46, Milan Broz wrote:
> On 09/06/2014 01:02 AM, behanw@converseincode.com wrote:
>> From: Jan-Simon Möller <dl9pf@gmx.de>
>>
>> The use of variable length arrays in structs (VLAIS) in the Linux Kernel code
>> precludes the use of compilers which don't implement VLAIS (for instance the
>> Clang compiler). This patch instead allocates the appropriate amount of memory
>> using an char array.
> Well, if clang (or C99 code) is now preferred for kernel, why not.
>
> Just please commit the patch series en bloc (together with the patches
> removing VLAIS from crypto code you posted to cryptoapi list).
They seemed more separate than that. However, happy to post them as a 
patch set.

>> -	struct {
>> -		struct shash_desc desc;
>> -		char ctx[crypto_shash_descsize(lmk->hash_tfm)];
>> -	} sdesc;
>> +	char sdesc[sizeof(struct shash_desc) +
>> +		crypto_shash_descsize(lmk->hash_tfm)] CRYPTO_MINALIGN_ATTR;
>> +	struct shash_desc *desc = (struct shash_desc *)sdesc;
> TBH, this looks even more uglier that the previous code :-)
I'm not claiming it's prettier. Merely C99. :)

> (But tglx already complained on different patch and I fully agree that crypto code
> should not use this kind of construction in the first place...
> It would be very nice to introduce at least some macro hiding these crazy
> stack allocations later.)
I actually agree with you and tglx. Will fix.

As I said to tglx, we were asked not to hide things with macro magic in 
some of our non-crypto VLAIS removal patches. Happy to use macros in 
this case.

Thanks,

Behan

-- 
Behan Webster
behanw@converseincode.com


      reply	other threads:[~2014-09-07  2:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 23:02 [PATCH v2] crypto, dm: LLVMLinux: Remove VLAIS usage from dm-crypt behanw
2014-09-06  8:46 ` Milan Broz
2014-09-07  2:10   ` Behan Webster [this message]

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=540BBE7E.2060108@converseincode.com \
    --to=behanw@converseincode.com \
    --cc=agk@redhat.com \
    --cc=dl9pf@gmx.de \
    --cc=dm-devel@redhat.com \
    --cc=gmazyland@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=pageexec@freemail.hu \
    --cc=snitzer@redhat.com \
    --cc=torvalds@linux-foundation.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