public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* linux-next: build warning after merge of the crypto tree
@ 2025-10-20  3:07 Stephen Rothwell
  2025-10-21  4:07 ` [PATCH] KEYS: trusted: Pass argument by pointer in dump_options Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2025-10-20  3:07 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Meenakshi Aggarwal, Pankaj Gupta, Linux Crypto List,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

Hi all,

After merging the crypto tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

security/keys/trusted-keys/trusted_caam.c: In function 'dump_options':
security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4
   37 | static inline void dump_options(struct caam_pkey_info pkey_info)
      |                    ^~~~~~~~~~~~

Introduced by commit

  9eb25ca6c973 ("KEYS: trusted: caam based protected key")

I am not sure what to do about this.  It would be nice if we could
suppress the note as we do not support gcc 4.4 any more.  Otherwise,
I suspect that converting the pkey_info argument to a pointer will get
rid of the note.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* [PATCH] KEYS: trusted: Pass argument by pointer in dump_options
  2025-10-20  3:07 linux-next: build warning after merge of the crypto tree Stephen Rothwell
@ 2025-10-21  4:07 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2025-10-21  4:07 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Meenakshi Aggarwal, Pankaj Gupta, Linux Crypto List,
	Linux Kernel Mailing List, Linux Next Mailing List

On Mon, Oct 20, 2025 at 02:07:35PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the crypto tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
> 
> security/keys/trusted-keys/trusted_caam.c: In function 'dump_options':
> security/keys/trusted-keys/trusted_caam.c:37:20: note: the ABI of passing struct with a flexible array member has changed in GCC 4.4
>    37 | static inline void dump_options(struct caam_pkey_info pkey_info)
>       |                    ^~~~~~~~~~~~
> 
> Introduced by commit
> 
>   9eb25ca6c973 ("KEYS: trusted: caam based protected key")
> 
> I am not sure what to do about this.  It would be nice if we could
> suppress the note as we do not support gcc 4.4 any more.  Otherwise,
> I suspect that converting the pkey_info argument to a pointer will get
> rid of the note.

Yes let's change that into a pointer:

---8<---
Instead of passing pkey_info into dump_options by value, using a
pointer instead.

Reported-by: Stephen Rothwell <sfr@canb•auug.org.au>
Signed-off-by: Herbert Xu <herbert@gondor•apana.org.au>

diff --git a/security/keys/trusted-keys/trusted_caam.c b/security/keys/trusted-keys/trusted_caam.c
index 090099d1b04d..601943ce0d60 100644
--- a/security/keys/trusted-keys/trusted_caam.c
+++ b/security/keys/trusted-keys/trusted_caam.c
@@ -29,12 +29,12 @@ static const match_table_t key_tokens = {
 };
 
 #ifdef CAAM_DEBUG
-static inline void dump_options(struct caam_pkey_info pkey_info)
+static inline void dump_options(const struct caam_pkey_info *pkey_info)
 {
-	pr_info("key encryption algo %d\n", pkey_info.key_enc_algo);
+	pr_info("key encryption algo %d\n", pkey_info->key_enc_algo);
 }
 #else
-static inline void dump_options(struct caam_pkey_info pkey_info)
+static inline void dump_options(const struct caam_pkey_info *pkey_info)
 {
 }
 #endif
@@ -108,7 +108,7 @@ static int trusted_caam_seal(struct trusted_key_payload *p, char *datablob)
 		ret = get_pkey_options(datablob, &info.pkey_info);
 		if (ret < 0)
 			return 0;
-		dump_options(info.pkey_info);
+		dump_options(&info.pkey_info);
 	}
 
 	ret = caam_encap_blob(blobifier, &info);
@@ -140,7 +140,7 @@ static int trusted_caam_unseal(struct trusted_key_payload *p, char *datablob)
 		ret = get_pkey_options(datablob, &info.pkey_info);
 		if (ret < 0)
 			return 0;
-		dump_options(info.pkey_info);
+		dump_options(&info.pkey_info);
 
 		p->key_len = p->blob_len + sizeof(struct caam_pkey_info);
 		memcpy(p->key, &info.pkey_info, sizeof(struct caam_pkey_info));
-- 
Email: Herbert Xu <herbert@gondor•apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2025-10-21  4:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20  3:07 linux-next: build warning after merge of the crypto tree Stephen Rothwell
2025-10-21  4:07 ` [PATCH] KEYS: trusted: Pass argument by pointer in dump_options Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox