From patchwork Tue Jan 18 12:28:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 532870 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3682049imp; Tue, 18 Jan 2022 05:54:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFmlP9/UZr4iFRrm9NMx46RYTlP/FvLHJ8RWmy3LHw0suv+BL9ghCkRZGB8aWPOerqkQIO X-Received: by 2002:a25:b852:: with SMTP id b18mr37014002ybm.651.1642514056177; Tue, 18 Jan 2022 05:54:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642514056; cv=none; d=google.com; s=arc-20160816; b=QFaKoVYLHyCxLv+evt1FMxTprJuJLlUtdZJW3JWBlIEAKBJ16l4/RvVQcpInzppqir smbqt/IDZoAGaRknxnD+SdP1hTdwXdj4BJBGTjSHW2XYgerGet2TMK1QLjhJRznJWY6L prJqKeMtRZDbgiZUc+fYhnl4AqGxEHLhPr9pbeIqWfNxtyL7sWs3ZwG35pKO0xEKx3Pj AWEd1XmzWf/3Ks0Gq9kAH3xKR3ranAmeP0cJWUQ4t+h11o/VFVLfFKFO4BqvfNt+3dJM OjNSAAqje77gzBB+k4vEGoIDQcJVgAwAeuAjdMaU07i95EGb2PiAwDS7fJ5B1QVe9pnj u4vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=m7FHZU2dkiV6bO1nYF9MerG7XC+377pQQbLubno9v5c=; b=gwR6krHe1BcVU7n19Dv1egwsndIDpAK2ysfAM3kNgwSKTm2ImtGgra6+p587zg8BoQ eAS7vZh+GH8Hq1Ph2BAP/EDgg17Dzdy1qJCnBJWL4hTOsUIZ1GwcgbOa4gXoQQwoqYqD 5xFZvxZG3M7o4VKO+ydboAzaSKa9jO5oToMycfhbHuFvo/IRZBYRr7RmRk5SwNY9jllL I9RaV/3+eolcP0Ee9lQSq4DZP1pB0crBuUs2yAZ8FUNaaVcF9a9KFVc0UEzW9VJKeNpe aec/kwFY3vEzfEUFaKWOaTeGk2Flv5LYmpeQFLYgSttzyjGtcSXsuyVSinM5WqVOWeto kYhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q19si5499984ybg.179.2022.01.18.05.54.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jan 2022 05:54:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:46210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9ow5-0003n9-ET for patch@linaro.org; Tue, 18 Jan 2022 08:54:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9nby-0004oo-6u; Tue, 18 Jan 2022 07:29:18 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:41033) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9nbm-0001wV-Ml; Tue, 18 Jan 2022 07:29:17 -0500 Received: from quad ([82.142.13.186]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mcpz0-1mZuYX0CQ6-00a107; Tue, 18 Jan 2022 13:28:55 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 8/9] linux-user: Return void from queue_signal() Date: Tue, 18 Jan 2022 13:28:46 +0100 Message-Id: <20220118122847.636461-9-laurent@vivier.eu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118122847.636461-1-laurent@vivier.eu> References: <20220118122847.636461-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:QeG1eFTRE/Urk2aR/twAVOiLDrXveYNtkX83aKc3lzNNpiVafgg vGTzMGI9AacC43fObbFJ4wtX5zBTFgF3sfALPvye9CRBB1ohZocvr1/a/xdDreApwMWEJbx zb3kP11EF/tzb8iaSmernm7qfD7lGX/YNjs8JWdSli/DB3tHR05Wkoq3XgwHTQV8afRECSk biTHv/IuBM8VDDKZi6cSA== X-UI-Out-Filterresults: notjunk:1;V03:K0:3LWQsXjGBMs=:eH32QqGWHM/h+loKzlHWmj BnqsRjyvIX3xHiEQObpSPI0uAcaOaqo7hHQR3GshWJlnbU9oVe4qbwU5Po8qzBKJAbucoD4rR VCm/KM1xr7xrNRNWKK/UYiQewTrZgsUB6YscM0/m2b+UNaEgKp7OEqa2/bj7sa8rYWGPvNAlI GnWBTFamP0DB2waLJVJIP+Xwimy/yZ3LIZZTgaPVMbn5ylPf0JJ2bheXqO0gNTCFJYoFzU2AA dCtxnMiYk8wVLTOKRNUcFCLAqflAh9EAYszN6ifJQnih0lPgxHCYtd2xyuFQDs6o7XTBFGm7Y m2T7K8XIHJMR3fUayWpoUZoZdMecdsyGIeAEOPT0KL3zKiD1GNvJ7358hzd1ks71xD9vsxd7z EkfLFlVKQ58zjdyguzIDmpdD0fo9VEpeSblVZne3qdq45JmGa2/5LdQG8ZGzHaYub4Rt6ywph 1ZJSbhQp7i0T55cIMbCUXOO8Nlf2L0Qye5/shiJn75bjlhwsuXp+3SsG7SwH69eJVAdoyWu2W vlx9E8n4ww4Z5oUsIx4zbW4NhSxezYTgD5B+GLdmFw1Tjz3xpKIiswsfZQlNjU8P40VJASxs1 Gd2ZbBnZ1sNM90Wz5j53dzNNWhDlsYBgwCLte+zwJtMVSvEObFcGM/Tw3WsHf9URYD/DDtOza t4GsL5r9TwT1FlkS15I6MrZU2xolR/d6Gy61fFamxyKtwWsVEv4TxZFwkZ2j/mc0tWF4= Received-SPF: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The linux-user queue_signal() function always returns 1, and none of its callers check the return value. Give it a void return type instead. The return value is a leftover from the old pre-2016 linux-user signal handling code, which really did have a queue of signals and so might return a failure indication if too many signals were queued at once. The current design avoids having to ever have more than one signal queued via queue_signal() at once, so it can never fail. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220114153732.3767229-4-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/signal-common.h | 4 ++-- linux-user/signal.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/linux-user/signal-common.h b/linux-user/signal-common.h index 42aa479080b8..2113165a7583 100644 --- a/linux-user/signal-common.h +++ b/linux-user/signal-common.h @@ -59,8 +59,8 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, void process_pending_signals(CPUArchState *cpu_env); void signal_init(void); -int queue_signal(CPUArchState *env, int sig, int si_type, - target_siginfo_t *info); +void queue_signal(CPUArchState *env, int sig, int si_type, + target_siginfo_t *info); void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info); void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tinfo); int target_to_host_signal(int sig); diff --git a/linux-user/signal.c b/linux-user/signal.c index bfbbeab9ad2e..32854bb3752d 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -780,8 +780,8 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig) /* queue a signal so that it will be send to the virtual CPU as soon as possible */ -int queue_signal(CPUArchState *env, int sig, int si_type, - target_siginfo_t *info) +void queue_signal(CPUArchState *env, int sig, int si_type, + target_siginfo_t *info) { CPUState *cpu = env_cpu(env); TaskState *ts = cpu->opaque; @@ -794,7 +794,6 @@ int queue_signal(CPUArchState *env, int sig, int si_type, ts->sync_signal.pending = sig; /* signal that a new signal is pending */ qatomic_set(&ts->signal_pending, 1); - return 1; /* indicates that the signal was queued */ }