Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2100206ioo; Mon, 23 May 2022 10:04:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiOezABooDgn78tcKabT2TtN9fMa7+3jXkOjcZgjmK+uujmOqPjYf+6iyXezT9IFXrl+hr X-Received: by 2002:a05:6a00:1893:b0:518:9945:b288 with SMTP id x19-20020a056a00189300b005189945b288mr7356121pfh.75.1653325466238; Mon, 23 May 2022 10:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653325466; cv=none; d=google.com; s=arc-20160816; b=RlYye4DuSFu9pBYqw8XAooDRMgMIKEbWdiS8aayVUabK7ywgX+L/MyNji+FspDAmeB 1+IMngxBlEL+PWASYl1Khf3ZjwoGQo1isU90G72N+DQJmWUDE25xoQzv47UklLFpTExz b1TJdYdbt/N1DB94+o59VeLg4MJtjsgWA0vqSMxypahz9iDUlMq0dMnrTHsbhx/R7XLi jkQsC+Zj5ZsXI3+aTYXQTjLZ84gYNq7DboGWoayvVVLgF6nFbldq/Bbmmp4o4MrD3OpA B2v28caCsFb8+lRlyMjEI0em/+qS623o/FcOIP1JOQzb/iJ4euKmmshDuGUqrTMwwm72 Ofyg== 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=RzZRxOsFLXkQV545EZX4SLkHLbdw1HJAcgc/8+zrmvkVBCAgdbNAziDwd8BUgLltd/ yCNwLE0MY4O2eznHjPKqERW92sTfInXypBpd6aRKVZ1ymVtUz9ZiiW3RLUTpcqlFDViL 1kXvSVJS0G3TO94u00XSyoTc03zsU2K7qOrrsNNRtCXJnXI8W80b7LeqjEFzrI+f+p9n PjNn0Rp/ckk9ZQHnOtLaKPaZjtsjM1csWolIuZWVpEOmHr/j3+s9zYzWILsSUMbnV/dY CHZfSduw+Kyw5AdvIpSBXnRRG+ofATt4MtSTCSdFIia4xXqh1dSXbtYTEHD5tPVp5GVh WU2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lQshdhbM; 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 lr1-20020a17090b4b8100b001d78a805abcsi16015269pjb.106.2022.05.23.10.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:04:26 -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=lQshdhbM; 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 58031606C5; Mon, 23 May 2022 10:04:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239186AbiEWREG (ORCPT + 99 others); Mon, 23 May 2022 13:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239129AbiEWRD6 (ORCPT ); Mon, 23 May 2022 13:03:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FC355253F; Mon, 23 May 2022 10:03:57 -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 1A72FB811E9; Mon, 23 May 2022 17:03:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 555E5C385AA; Mon, 23 May 2022 17:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325434; bh=xhmdDEoKotcUO/7eHbPi3dL9BFugG1l1EDjl/avpqzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lQshdhbMzS+bzOeKolBu1yo1ol0px+ResS9cwCQ6aV8+KIwUFIDyf79TqpQOhhSdv /p9bJsQeP3+JB/UkA8RRgpq1vgIXPhHvtgaxeSMR/GZAOp5eRVsqLJGQMCY7s0jLm5 ufvdWsbax5/c5tjn9OY2qWVyLkZGIFxJiLdNHP24= 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.9 02/25] um: Cleanup syscall_handler_t definition/cast, fix warning Date: Mon, 23 May 2022 19:03:20 +0200 Message-Id: <20220523165745.101254298@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165743.398280407@linuxfoundation.org> References: <20220523165743.398280407@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