Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2109066ioo; Mon, 23 May 2022 10:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw76lDfj/5chnPu5CUsYr1Ej6ejOB1TD+uMU6k/OStWXTr36v62pJdXf9dctJ+838qf84IS X-Received: by 2002:a63:343:0:b0:3f6:52e5:edbe with SMTP id 64-20020a630343000000b003f652e5edbemr18260584pgd.272.1653326066865; Mon, 23 May 2022 10:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326066; cv=none; d=google.com; s=arc-20160816; b=MwyKzU6zpEOG7I846O8cRPdEVdTdRF+BL3l6JFal3Q8K+ArTNu+wOst8MCCXxqYtad BRPPDdrR0SJlBvSC0X709Eswa/BHKMNzyoNssqejk/uD8oXI56+Ozv6pVf7AOIbu2Hfx GH4l2M6V6vEfDniwrKoqu1VuhBWO5TjUfQYYch3gRDIq4TJ0nvtKDui+v1KTl0EyKrVL PIj88zpRatKPdV38FspqWYoCztLaw0vVBXWLujQPLq5BnTn1WRHPPSh5V1dkIya0wVvR JhIqyi4GJTa0w2l+CGCInkZT3gzZfy4JIuCweU+tFlB2/n7b0a6jLMc1UoP7erPLBzIH n8Mg== 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=HVn1B+4TLRTSXN+B83EMhCyY6l88QUikLOdjAPJBepU=; b=ZcW4f0Si/e5qa4L2WWDN15OjC6WLU6R4iW5UFnkmyEt0/87lsOrVV6TsvjlaVVLWPP DxukprhRB88v5Dwl/0JxvbYbQPZjOMfij3Zh7oJVAcIFFIhfvd5H+ZAqNAbb9X/klV5b uVytTVbF/ld4MdNPiSmdEogir4MIIqtlxD36njr4kvBRoaZFtCoqMuegkeF4+Jtuc8JG T2QW4pKf9/oS1Kd+9uTGLSXer66CsQqZOzwgQptlmQBlxe/o9/OvrFyAF9mQLyE0smD4 N6tMeiHgkm/IjmVF02ZnDkOH8eBTEV7ZBnGy+Xog9jx+MaBxAosHuW3Y/ajgogBDsG1w Aidg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h6GVaBdN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id b22-20020a63d316000000b003c642641ba8si12141878pgg.709.2022.05.23.10.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:14:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h6GVaBdN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 BE6C76FA0A; Mon, 23 May 2022 10:14:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239782AbiEWRMy (ORCPT + 99 others); Mon, 23 May 2022 13:12:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239624AbiEWRKh (ORCPT ); Mon, 23 May 2022 13:10:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDBE16D1B6; Mon, 23 May 2022 10:10:17 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B7BA1614F5; Mon, 23 May 2022 17:10:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC5D3C385A9; Mon, 23 May 2022 17:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325803; bh=xhmdDEoKotcUO/7eHbPi3dL9BFugG1l1EDjl/avpqzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h6GVaBdNz1kA574X1LLnePWB53r6P8K2UjmJMbvsFsKhyoTG7Gry9zmgsxYiLhy5M mLvvuxQxLAbgiPWysYTNNWMrYUCTqUt2POFfNUeOv0BAGpZyOiyHPZO5cU8MiwNm+V RPVBy5piLCib9VcsFyFGrBiS9+uS8SShT9yVBCfo= 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 4.19 02/44] um: Cleanup syscall_handler_t definition/cast, fix warning Date: Mon, 23 May 2022 19:04:46 +0200 Message-Id: <20220523165753.908913811@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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 8a7d5e1da98e..1e6875b4ffd8 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