* [PATCH 0/3] Three trivial patchs
@ 2020-03-25 9:21 Chen Qun
2020-03-25 9:21 ` [PATCH 1/3] gdbstub: prevent uninitialized warning Chen Qun
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Chen Qun @ 2020-03-25 9:21 UTC (permalink / raw)
To: qemu-devel, qemu-trivial; +Cc: Chen Qun, zhang.zhanghailiang, laurent
Patch1: For g_autofree type initialized.
Patch2: Juest 80-char limit for virtio-crypto.
Patch3: Redundant type conversion for crypto.
Chen Qun (3):
gdbstub: prevent uninitialized warning
virtio-crypto: fix 80-char limit violations in
virtio_crypto_device_realize()
crypto: Redundant type conversion for AES_KEY pointer
crypto/cipher-builtin.c | 6 ++----
gdbstub.c | 4 ++--
hw/virtio/virtio-crypto.c | 3 ++-
3 files changed, 6 insertions(+), 7 deletions(-)
--
2.23.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/3] gdbstub: prevent uninitialized warning
2020-03-25 9:21 [PATCH 0/3] Three trivial patchs Chen Qun
@ 2020-03-25 9:21 ` Chen Qun
2020-03-25 12:56 ` Miroslav Rezanina
2020-03-27 9:12 ` Alex Bennée
2020-03-25 9:21 ` [PATCH 2/3] virtio-crypto: fix 80-char limit violations in virtio_crypto_device_realize() Chen Qun
2020-03-25 9:21 ` [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer Chen Qun
2 siblings, 2 replies; 13+ messages in thread
From: Chen Qun @ 2020-03-25 9:21 UTC (permalink / raw)
To: qemu-devel, qemu-trivial
Cc: zhang.zhanghailiang, Alex Bennée, laurent, Euler Robot,
Chen Qun, Philippe Mathieu-Daudé
According to the glib function requirements, we need initialise
the variable. Otherwise there will be compilation warnings:
qemu/gdbstub.c: In function ‘handle_query_thread_extra’:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning:
‘cpu_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]
g_free (*pp);
^~~~~~~~~~~~
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
---
gdbstub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 013fb1ac0f..171e150950 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2060,8 +2060,8 @@ static void handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx)
/* Print the CPU model and name in multiprocess mode */
ObjectClass *oc = object_get_class(OBJECT(cpu));
const char *cpu_model = object_class_get_name(oc);
- g_autofree char *cpu_name;
- cpu_name = object_get_canonical_path_component(OBJECT(cpu));
+ g_autofree char *cpu_name =
+ object_get_canonical_path_component(OBJECT(cpu));
g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name,
cpu->halted ? "halted " : "running");
} else {
--
2.23.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/3] virtio-crypto: fix 80-char limit violations in virtio_crypto_device_realize()
2020-03-25 9:21 [PATCH 0/3] Three trivial patchs Chen Qun
2020-03-25 9:21 ` [PATCH 1/3] gdbstub: prevent uninitialized warning Chen Qun
@ 2020-03-25 9:21 ` Chen Qun
2020-03-25 9:21 ` [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer Chen Qun
2 siblings, 0 replies; 13+ messages in thread
From: Chen Qun @ 2020-03-25 9:21 UTC (permalink / raw)
To: qemu-devel, qemu-trivial
Cc: Chen Qun, Euler Robot, zhang.zhanghailiang, laurent
Fix: aa8f057e74ae
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
hw/virtio/virtio-crypto.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index 4c65114de5..eb4a9e4e85 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -786,7 +786,8 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp)
error_setg(errp, "'cryptodev' parameter expects a valid object");
return;
} else if (cryptodev_backend_is_used(vcrypto->cryptodev)) {
- char *path = object_get_canonical_path_component(OBJECT(vcrypto->conf.cryptodev));
+ char *path = object_get_canonical_path_component(
+ OBJECT(vcrypto->conf.cryptodev));
error_setg(errp, "can't use already used cryptodev backend: %s", path);
g_free(path);
return;
--
2.23.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
2020-03-25 9:21 [PATCH 0/3] Three trivial patchs Chen Qun
2020-03-25 9:21 ` [PATCH 1/3] gdbstub: prevent uninitialized warning Chen Qun
2020-03-25 9:21 ` [PATCH 2/3] virtio-crypto: fix 80-char limit violations in virtio_crypto_device_realize() Chen Qun
@ 2020-03-25 9:21 ` Chen Qun
2020-03-25 9:45 ` Laurent Vivier
` (2 more replies)
2 siblings, 3 replies; 13+ messages in thread
From: Chen Qun @ 2020-03-25 9:21 UTC (permalink / raw)
To: qemu-devel, qemu-trivial
Cc: Chen Qun, Euler Robot, Daniel P. Berrangé,
zhang.zhanghailiang, laurent
Fix: eaec903c5b8
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
---
crypto/cipher-builtin.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
index bf8413e71a..99d6280a16 100644
--- a/crypto/cipher-builtin.c
+++ b/crypto/cipher-builtin.c
@@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const void *ctx,
{
const QCryptoCipherBuiltinAESContext *aesctx = ctx;
- qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
- src, dst, length);
+ qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
}
@@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const void *ctx,
{
const QCryptoCipherBuiltinAESContext *aesctx = ctx;
- qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
- src, dst, length);
+ qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
}
--
2.23.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
2020-03-25 9:21 ` [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer Chen Qun
@ 2020-03-25 9:45 ` Laurent Vivier
2020-03-25 10:06 ` Chenqun (kuhn)
2020-03-25 9:45 ` Daniel P. Berrangé
2020-04-03 8:47 ` Laurent Vivier
2 siblings, 1 reply; 13+ messages in thread
From: Laurent Vivier @ 2020-03-25 9:45 UTC (permalink / raw)
To: Chen Qun, qemu-devel, qemu-trivial
Cc: Daniel P. Berrangé, zhang.zhanghailiang, Euler Robot
Le 25/03/2020 à 10:21, Chen Qun a écrit :
> Fix: eaec903c5b8
>
Did you run the coccinelle script scripts/coccinelle/typecast.cocci ?
Thanks,
Laurent
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> ---
> crypto/cipher-builtin.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
> index bf8413e71a..99d6280a16 100644
> --- a/crypto/cipher-builtin.c
> +++ b/crypto/cipher-builtin.c
> @@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const void *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
> }
>
>
> @@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const void *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
> }
>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
2020-03-25 9:21 ` [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer Chen Qun
2020-03-25 9:45 ` Laurent Vivier
@ 2020-03-25 9:45 ` Daniel P. Berrangé
2020-04-03 8:47 ` Laurent Vivier
2 siblings, 0 replies; 13+ messages in thread
From: Daniel P. Berrangé @ 2020-03-25 9:45 UTC (permalink / raw)
To: Chen Qun
Cc: qemu-trivial, laurent, Euler Robot, qemu-devel, zhang.zhanghailiang
On Wed, Mar 25, 2020 at 05:21:37PM +0800, Chen Qun wrote:
> Fix: eaec903c5b8
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> ---
> crypto/cipher-builtin.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
>
> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
> index bf8413e71a..99d6280a16 100644
> --- a/crypto/cipher-builtin.c
> +++ b/crypto/cipher-builtin.c
> @@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const void *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
> }
>
>
> @@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const void *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
> }
>
>
> --
> 2.23.0
>
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
2020-03-25 9:45 ` Laurent Vivier
@ 2020-03-25 10:06 ` Chenqun (kuhn)
2020-03-25 10:14 ` Laurent Vivier
0 siblings, 1 reply; 13+ messages in thread
From: Chenqun (kuhn) @ 2020-03-25 10:06 UTC (permalink / raw)
To: Laurent Vivier, qemu-devel, qemu-trivial
Cc: Daniel P. Berrangé, Zhanghailiang, Euler Robot
>-----Original Message-----
>From: Laurent Vivier [mailto:laurent@vivier.eu]
>Sent: Wednesday, March 25, 2020 5:45 PM
>To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>; qemu-devel@nongnu.org;
>qemu-trivial@nongnu.org
>Cc: Zhanghailiang <zhang.zhanghailiang@huawei.com>; Euler Robot
><euler.robot@huawei.com>; Daniel P. Berrangé <berrange@redhat.com>
>Subject: Re: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
>
>Le 25/03/2020 à 10:21, Chen Qun a écrit :
>> Fix: eaec903c5b8
>>
>
>Did you run the coccinelle script scripts/coccinelle/typecast.cocci ?
>
Yes, I run it and plan to integrate it into EulerRobot so that similar issues can be discovered sooner.
Thanks.
>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>> ---
>> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
>> ---
>> crypto/cipher-builtin.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c index
>> bf8413e71a..99d6280a16 100644
>> --- a/crypto/cipher-builtin.c
>> +++ b/crypto/cipher-builtin.c
>> @@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const
>> void *ctx, {
>> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>>
>> - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
>> - src, dst, length);
>> + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
>> }
>>
>>
>> @@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const
>> void *ctx, {
>> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>>
>> - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
>> - src, dst, length);
>> + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
>> }
>>
>>
>>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
2020-03-25 10:06 ` Chenqun (kuhn)
@ 2020-03-25 10:14 ` Laurent Vivier
0 siblings, 0 replies; 13+ messages in thread
From: Laurent Vivier @ 2020-03-25 10:14 UTC (permalink / raw)
To: Chenqun (kuhn), qemu-devel, qemu-trivial
Cc: Daniel P. Berrangé, Zhanghailiang, Euler Robot
Le 25/03/2020 à 11:06, Chenqun (kuhn) a écrit :
>> -----Original Message-----
>> From: Laurent Vivier [mailto:laurent@vivier.eu]
>> Sent: Wednesday, March 25, 2020 5:45 PM
>> To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>; qemu-devel@nongnu.org;
>> qemu-trivial@nongnu.org
>> Cc: Zhanghailiang <zhang.zhanghailiang@huawei.com>; Euler Robot
>> <euler.robot@huawei.com>; Daniel P. Berrangé <berrange@redhat.com>
>> Subject: Re: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
>>
>> Le 25/03/2020 à 10:21, Chen Qun a écrit :
>>> Fix: eaec903c5b8
>>>
>>
>> Did you run the coccinelle script scripts/coccinelle/typecast.cocci ?
>>
> Yes, I run it and plan to integrate it into EulerRobot so that similar issues can be discovered sooner.
>
> Thanks.
>>
>>> Reported-by: Euler Robot <euler.robot@huawei.com>
>>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>>> ---
>>> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
>>> ---
>>> crypto/cipher-builtin.c | 6 ++----
>>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c index
>>> bf8413e71a..99d6280a16 100644
>>> --- a/crypto/cipher-builtin.c
>>> +++ b/crypto/cipher-builtin.c
>>> @@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const
>>> void *ctx, {
>>> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>>>
>>> - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
>>> - src, dst, length);
>>> + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
>>> }
>>>
>>>
>>> @@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const
>>> void *ctx, {
>>> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>>>
>>> - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
>>> - src, dst, length);
>>> + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
>>> }
>>>
>>>
>>>
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] gdbstub: prevent uninitialized warning
2020-03-25 9:21 ` [PATCH 1/3] gdbstub: prevent uninitialized warning Chen Qun
@ 2020-03-25 12:56 ` Miroslav Rezanina
2020-03-27 9:12 ` Alex Bennée
1 sibling, 0 replies; 13+ messages in thread
From: Miroslav Rezanina @ 2020-03-25 12:56 UTC (permalink / raw)
To: Chen Qun
Cc: zhang.zhanghailiang, qemu-trivial, Philippe Mathieu-Daudé,
laurent, qemu-devel, Euler Robot, Alex Bennée
On Wed, Mar 25, 2020 at 05:21:35PM +0800, Chen Qun wrote:
> According to the glib function requirements, we need initialise
> the variable. Otherwise there will be compilation warnings:
>
> qemu/gdbstub.c: In function ‘handle_query_thread_extra’:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning:
> ‘cpu_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> g_free (*pp);
> ^~~~~~~~~~~~
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: "Alex Bennée" <alex.bennee@linaro.org>
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> ---
> gdbstub.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index 013fb1ac0f..171e150950 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -2060,8 +2060,8 @@ static void handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx)
> /* Print the CPU model and name in multiprocess mode */
> ObjectClass *oc = object_get_class(OBJECT(cpu));
> const char *cpu_model = object_class_get_name(oc);
> - g_autofree char *cpu_name;
> - cpu_name = object_get_canonical_path_component(OBJECT(cpu));
> + g_autofree char *cpu_name =
> + object_get_canonical_path_component(OBJECT(cpu));
> g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name,
> cpu->halted ? "halted " : "running");
> } else {
> --
> 2.23.0
>
>
>
Fixing broken build with -Wall.
Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] gdbstub: prevent uninitialized warning
2020-03-25 9:21 ` [PATCH 1/3] gdbstub: prevent uninitialized warning Chen Qun
2020-03-25 12:56 ` Miroslav Rezanina
@ 2020-03-27 9:12 ` Alex Bennée
2020-03-27 9:43 ` Chenqun (kuhn)
1 sibling, 1 reply; 13+ messages in thread
From: Alex Bennée @ 2020-03-27 9:12 UTC (permalink / raw)
To: Chen Qun
Cc: zhang.zhanghailiang, qemu-trivial, laurent, qemu-devel,
Euler Robot, Philippe Mathieu-Daudé
Chen Qun <kuhn.chenqun@huawei.com> writes:
> According to the glib function requirements, we need initialise
> the variable. Otherwise there will be compilation warnings:
>
> qemu/gdbstub.c: In function ‘handle_query_thread_extra’:
> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning:
> ‘cpu_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> g_free (*pp);
> ^~~~~~~~~~~~
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Thanks,
I've pulled in a duplicate fix from:
Message-Id: <20200326151407.25046-1-dplotnikov@virtuozzo.com>
and added your Reported-by's
> ---
> Cc: "Alex Bennée" <alex.bennee@linaro.org>
> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
> ---
> gdbstub.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index 013fb1ac0f..171e150950 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -2060,8 +2060,8 @@ static void handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx)
> /* Print the CPU model and name in multiprocess mode */
> ObjectClass *oc = object_get_class(OBJECT(cpu));
> const char *cpu_model = object_class_get_name(oc);
> - g_autofree char *cpu_name;
> - cpu_name = object_get_canonical_path_component(OBJECT(cpu));
> + g_autofree char *cpu_name =
> + object_get_canonical_path_component(OBJECT(cpu));
> g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name,
> cpu->halted ? "halted " : "running");
> } else {
--
Alex Bennée
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 1/3] gdbstub: prevent uninitialized warning
2020-03-27 9:12 ` Alex Bennée
@ 2020-03-27 9:43 ` Chenqun (kuhn)
0 siblings, 0 replies; 13+ messages in thread
From: Chenqun (kuhn) @ 2020-03-27 9:43 UTC (permalink / raw)
To: Alex Bennée
Cc: Zhanghailiang, qemu-trivial, laurent, qemu-devel, Euler Robot,
mrezanin, Philippe Mathieu-Daudé
>-----Original Message-----
>From: Alex Bennée [mailto:alex.bennee@linaro.org]
>Sent: Friday, March 27, 2020 5:13 PM
>To: Chenqun (kuhn) <kuhn.chenqun@huawei.com>
>Cc: qemu-devel@nongnu.org; qemu-trivial@nongnu.org; Zhanghailiang
><zhang.zhanghailiang@huawei.com>; laurent@vivier.eu; Euler Robot
><euler.robot@huawei.com>; Philippe Mathieu-Daudé <philmd@redhat.com>
>Subject: Re: [PATCH 1/3] gdbstub: prevent uninitialized warning
>
>
>Chen Qun <kuhn.chenqun@huawei.com> writes:
>
>> According to the glib function requirements, we need initialise
>> the variable. Otherwise there will be compilation warnings:
>>
>> qemu/gdbstub.c: In function ‘handle_query_thread_extra’:
>> /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning:
>> ‘cpu_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>> g_free (*pp);
>> ^~~~~~~~~~~~
>>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>
>Thanks,
>
>I've pulled in a duplicate fix from:
>
> Message-Id: <20200326151407.25046-1-dplotnikov@virtuozzo.com>
>
>and added your Reported-by's
OK, If possible, bring Miroslav Rezanina's "Reviewed-by" tag.
https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg07651.html
Thanks.
>
>> ---
>> Cc: "Alex Bennée" <alex.bennee@linaro.org>
>> Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
>> ---
>> gdbstub.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/gdbstub.c b/gdbstub.c
>> index 013fb1ac0f..171e150950 100644
>> --- a/gdbstub.c
>> +++ b/gdbstub.c
>> @@ -2060,8 +2060,8 @@ static void
>handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx)
>> /* Print the CPU model and name in multiprocess mode */
>> ObjectClass *oc = object_get_class(OBJECT(cpu));
>> const char *cpu_model = object_class_get_name(oc);
>> - g_autofree char *cpu_name;
>> - cpu_name = object_get_canonical_path_component(OBJECT(cpu));
>> + g_autofree char *cpu_name =
>> + object_get_canonical_path_component(OBJECT(cpu));
>> g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name,
>> cpu->halted ? "halted " : "running");
>> } else {
>
>
>--
>Alex Bennée
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
2020-03-25 9:21 ` [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer Chen Qun
2020-03-25 9:45 ` Laurent Vivier
2020-03-25 9:45 ` Daniel P. Berrangé
@ 2020-04-03 8:47 ` Laurent Vivier
2020-05-04 12:36 ` Laurent Vivier
2 siblings, 1 reply; 13+ messages in thread
From: Laurent Vivier @ 2020-04-03 8:47 UTC (permalink / raw)
To: Chen Qun, qemu-devel, qemu-trivial
Cc: Daniel P. Berrangé, zhang.zhanghailiang, Euler Robot
Le 25/03/2020 à 10:21, Chen Qun a écrit :
> Fix: eaec903c5b8
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> ---
> crypto/cipher-builtin.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
> index bf8413e71a..99d6280a16 100644
> --- a/crypto/cipher-builtin.c
> +++ b/crypto/cipher-builtin.c
> @@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const void *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
> }
>
>
> @@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const void *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
> }
>
>
>
Applied to my trivial-patches-for-5.1 branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer
2020-04-03 8:47 ` Laurent Vivier
@ 2020-05-04 12:36 ` Laurent Vivier
0 siblings, 0 replies; 13+ messages in thread
From: Laurent Vivier @ 2020-05-04 12:36 UTC (permalink / raw)
To: Chen Qun, qemu-devel, qemu-trivial
Cc: Daniel P. Berrangé, zhang.zhanghailiang, Euler Robot
Le 03/04/2020 à 10:47, Laurent Vivier a écrit :
> Le 25/03/2020 à 10:21, Chen Qun a écrit :
>> Fix: eaec903c5b8
>>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
>> ---
>> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
>> ---
>> crypto/cipher-builtin.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
>> index bf8413e71a..99d6280a16 100644
>> --- a/crypto/cipher-builtin.c
>> +++ b/crypto/cipher-builtin.c
>> @@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const void *ctx,
>> {
>> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>>
>> - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
>> - src, dst, length);
>> + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
>> }
>>
>>
>> @@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const void *ctx,
>> {
>> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>>
>> - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
>> - src, dst, length);
>> + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
>> }
>>
>>
>>
>
> Applied to my trivial-patches-for-5.1 branch.
Removed from the queue because of build errors:
https://travis-ci.com/github/vivier/qemu/jobs/327261040
In file included from /home/travis/build/vivier/qemu/crypto/cipher.c:157:0:
1251/home/travis/build/vivier/qemu/crypto/cipher-builtin.c: In function
‘qcrypto_cipher_aes_xts_encrypt’:
1252/home/travis/build/vivier/qemu/crypto/cipher-builtin.c:136:36:
error: passing argument 1 of ‘qcrypto_cipher_aes_ecb_encrypt’ discards
‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
1253 qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
1254 ^
1255/home/travis/build/vivier/qemu/crypto/cipher-builtin.c:77:13: note:
expected ‘AES_KEY * {aka struct aes_key_st *}’ but argument is of type
‘const AES_KEY * {aka const struct aes_key_st *}’
1256 static void qcrypto_cipher_aes_ecb_encrypt(AES_KEY *key,
1257 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1258/home/travis/build/vivier/qemu/crypto/cipher-builtin.c: In function
‘qcrypto_cipher_aes_xts_decrypt’:
1259/home/travis/build/vivier/qemu/crypto/cipher-builtin.c:147:36:
error: passing argument 1 of ‘qcrypto_cipher_aes_ecb_decrypt’ discards
‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
1260 qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
1261 ^
1262/home/travis/build/vivier/qemu/crypto/cipher-builtin.c:103:13: note:
expected ‘AES_KEY * {aka struct aes_key_st *}’ but argument is of type
‘const AES_KEY * {aka const struct aes_key_st *}’
1263 static void qcrypto_cipher_aes_ecb_decrypt(AES_KEY *key,
1264 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1265cc1: all warnings being treated as errors
1266/home/travis/build/vivier/qemu/rules.mak:69: recipe for target
'crypto/cipher.o' failed
1267make: *** [crypto/cipher.o] Error 1
1268make: *** Waiting for unfinished jobs....
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-05-04 12:49 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 9:21 [PATCH 0/3] Three trivial patchs Chen Qun
2020-03-25 9:21 ` [PATCH 1/3] gdbstub: prevent uninitialized warning Chen Qun
2020-03-25 12:56 ` Miroslav Rezanina
2020-03-27 9:12 ` Alex Bennée
2020-03-27 9:43 ` Chenqun (kuhn)
2020-03-25 9:21 ` [PATCH 2/3] virtio-crypto: fix 80-char limit violations in virtio_crypto_device_realize() Chen Qun
2020-03-25 9:21 ` [PATCH 3/3] crypto: Redundant type conversion for AES_KEY pointer Chen Qun
2020-03-25 9:45 ` Laurent Vivier
2020-03-25 10:06 ` Chenqun (kuhn)
2020-03-25 10:14 ` Laurent Vivier
2020-03-25 9:45 ` Daniel P. Berrangé
2020-04-03 8:47 ` Laurent Vivier
2020-05-04 12:36 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).