Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3668470lfo; Mon, 23 May 2022 10:52:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZQFixHSGWfqX0bjfrKvCKMOKW5kzUuKG22w1BfftMZT1FPPpwrKPKBEyzQ/xavluNS/+E X-Received: by 2002:a63:8a49:0:b0:3f7:a43:21de with SMTP id y70-20020a638a49000000b003f70a4321demr15543449pgd.274.1653328339057; Mon, 23 May 2022 10:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653328339; cv=none; d=google.com; s=arc-20160816; b=aWAPebx//suU3EY5L9R0ykESO86N58o7zFux6g2KZyv1UTDDGvfUIvElyKWGJbnwbZ bQx0LtVU4cGe+qZEM/Hs4jHCwhu6SEVQUj2aIxy2O8hKltC3/cez47GsP2TVGmtxNWgq EaGHPJ31SnB+70RiTxQXgHw4uBathdJPYJ2n++CfOVojKSzazRhPmiL3XZ4ax7g+URZz z4FJfD56Zc8s5nhifiFwAoDMkwRpM01wYAjIFzeqrXbRAwViiF6e0JdEieHkJR/bs1sk evmquOXPsLWyy9kneEGw15ab0z1Xuoojp08zWguwONPu7pEb/o0Kb5ELj0viIAr6wa0z 62HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KnhTPguI4xDxLskvM2S9z980feYYkCbQFuT/MlIst9g=; b=t/0LC+JXmbI5iVEuMTIRoGUslzcfytnwjEan6F9haEIdpN917BSOkj4aGFA2fNP7ZC f78VoQE3A784hiiyOTywiIs5KImDmxePXDyoAOkWww8L1f6+HkKGRATtIR0gWqlfe1Kf jDHJyWHHEtdEAAbehwxEOdP0fNZYUkRjqiiBoMd/RJhAXc0oLjhiaiyWK++vpVNNNYup Ndu34qrSH5yKSXT9mkLf0ni7Zzoz9UAWBLczsA8MQEn04z8OWza4I+EYPLfjFlX7EjJv FBEibUEA78hErK1MI4eZhtS16nwV46nZRayBwmj7CIgKOdV0mRAVmmPvUeeioNHZ4hbO gEMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cfEiB0qj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z36-20020a630a64000000b003f64566e163si11193990pgk.164.2022.05.23.10.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cfEiB0qj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D69C107885; Mon, 23 May 2022 10:50:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244490AbiEWRsG (ORCPT + 99 others); Mon, 23 May 2022 13:48:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243047AbiEWR2R (ORCPT ); Mon, 23 May 2022 13:28:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9ABA8E18C; Mon, 23 May 2022 10:25:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF347B811CE; Mon, 23 May 2022 17:24:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BFF2C385AA; Mon, 23 May 2022 17:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326666; bh=q7EG8RQlTf/vrDYWRZ9DE57aKLz4WapfiR01tD+MV5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cfEiB0qjT90DcC2Dq33iNRE9buPtW8397AW3DeudItcor72bGVv3OY3jbSD4PQCmJ JJXJpbxSGQEwydgg3uBEhFhX+WSz7FdASs/YWUbPGbhbWPtECvMHs2rDBDrnb0q79u scXjsIzA4i6su5RLXD5Jy6gW667H2CJfIM89ebcU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Gow , Richard Weinberger , Sasha Levin Subject: [PATCH 5.17 022/158] um: Cleanup syscall_handler_t definition/cast, fix warning Date: Mon, 23 May 2022 19:02:59 +0200 Message-Id: <20220523165834.271033720@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Gow [ Upstream commit f4f03f299a56ce4d73c5431e0327b3b6cb55ebb9 ] The syscall_handler_t type for x86_64 was defined as 'long (*)(void)', but always cast to 'long (*)(long, long, long, long, long, long)' before use. This now triggers a warning (see below). Define syscall_handler_t as the latter instead, and remove the cast. This simplifies the code, and fixes the warning. Warning: In file included from ../arch/um/include/asm/processor-generic.h:13 from ../arch/x86/um/asm/processor.h:41 from ../include/linux/rcupdate.h:30 from ../include/linux/rculist.h:11 from ../include/linux/pid.h:5 from ../include/linux/sched.h:14 from ../include/linux/ptrace.h:6 from ../arch/um/kernel/skas/syscall.c:7: ../arch/um/kernel/skas/syscall.c: In function ‘handle_syscall’: ../arch/x86/um/shared/sysdep/syscalls_64.h:18:11: warning: cast between incompatible function types from ‘long int (*)(void)’ to ‘long int (*)(long int, long int, long int, long int, long int, long int)’ [ -Wcast-function-type] 18 | (((long (*)(long, long, long, long, long, long)) \ | ^ ../arch/x86/um/asm/ptrace.h:36:62: note: in definition of macro ‘PT_REGS_SET_SYSCALL_RETURN’ 36 | #define PT_REGS_SET_SYSCALL_RETURN(r, res) (PT_REGS_AX(r) = (res)) | ^~~ ../arch/um/kernel/skas/syscall.c:46:33: note: in expansion of macro ‘EXECUTE_SYSCALL’ 46 | EXECUTE_SYSCALL(syscall, regs)); | ^~~~~~~~~~~~~~~ Signed-off-by: David Gow Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/x86/um/shared/sysdep/syscalls_64.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/um/shared/sysdep/syscalls_64.h b/arch/x86/um/shared/sysdep/syscalls_64.h index 48d6cd12f8a5..b6b997225841 100644 --- a/arch/x86/um/shared/sysdep/syscalls_64.h +++ b/arch/x86/um/shared/sysdep/syscalls_64.h @@ -10,13 +10,12 @@ #include #include -typedef long syscall_handler_t(void); +typedef long syscall_handler_t(long, long, long, long, long, long); extern syscall_handler_t *sys_call_table[]; #define EXECUTE_SYSCALL(syscall, regs) \ - (((long (*)(long, long, long, long, long, long)) \ - (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \ + (((*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \ UPT_SYSCALL_ARG2(®s->regs), \ UPT_SYSCALL_ARG3(®s->regs), \ UPT_SYSCALL_ARG4(®s->regs), \ -- 2.35.1