diff mbox series

[PULL,2/6] linux-user: Use unique error messages for cmsg parsing

Message ID 20241218195247.5459-3-deller@kernel.org (mailing list archive)
State New
Headers show
Series [PULL,1/6] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr() | expand

Commit Message

Helge Deller Dec. 18, 2024, 7:52 p.m. UTC
From: Helge Deller <deller@gmx.de>

Avoid using the same error message for two different code paths
as it complicates determining the one which actually triggered.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 linux-user/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé Dec. 19, 2024, 9:57 a.m. UTC | #1
On 18/12/24 20:52, deller@kernel.org wrote:
> From: Helge Deller <deller@gmx.de>
> 
> Avoid using the same error message for two different code paths
> as it complicates determining the one which actually triggered.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/syscall.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Laurent Vivier Dec. 24, 2024, 11:58 a.m. UTC | #2
Le 18/12/2024 à 20:52, deller@kernel.org a écrit :
> From: Helge Deller <deller@gmx.de>
> 
> Avoid using the same error message for two different code paths
> as it complicates determining the one which actually triggered.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/syscall.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 1ce4c79784..494323efba 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -1825,7 +1825,7 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
>                   *dst = tswap32(*dst);
>               }
>           } else {
> -            qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n",
> +            qemu_log_mask(LOG_UNIMP, "Unsupported target ancillary data: %d/%d\n",
>                             cmsg->cmsg_level, cmsg->cmsg_type);
>               memcpy(data, target_data, len);
>           }
> @@ -2047,7 +2047,7 @@ static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh,
>   
>           default:
>           unimplemented:
> -            qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n",
> +            qemu_log_mask(LOG_UNIMP, "Unsupported host ancillary data: %d/%d\n",
>                             cmsg->cmsg_level, cmsg->cmsg_type);
>               memcpy(target_data, data, MIN(len, tgt_len));
>               if (tgt_len > len) {

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1ce4c79784..494323efba 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1825,7 +1825,7 @@  static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
                 *dst = tswap32(*dst);
             }
         } else {
-            qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n",
+            qemu_log_mask(LOG_UNIMP, "Unsupported target ancillary data: %d/%d\n",
                           cmsg->cmsg_level, cmsg->cmsg_type);
             memcpy(data, target_data, len);
         }
@@ -2047,7 +2047,7 @@  static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh,
 
         default:
         unimplemented:
-            qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n",
+            qemu_log_mask(LOG_UNIMP, "Unsupported host ancillary data: %d/%d\n",
                           cmsg->cmsg_level, cmsg->cmsg_type);
             memcpy(target_data, data, MIN(len, tgt_len));
             if (tgt_len > len) {