From patchwork Thu Oct 20 09:25:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 6090 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp155501wrs; Thu, 20 Oct 2022 02:34:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42YpH6Kv2YKh3rbFsKrVKz9UKxPqfu3okcc+2leOZ9A20sYIe5ZDOp+7/WDzCjHpDYQbEE X-Received: by 2002:a17:907:1c01:b0:78d:eb6e:3807 with SMTP id nc1-20020a1709071c0100b0078deb6e3807mr10200205ejc.481.1666258451657; Thu, 20 Oct 2022 02:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666258451; cv=none; d=google.com; s=arc-20160816; b=w9o4w1PxSnqBcCnpMlkvbSt/jPeRS2WYbqARTKkojFcTfdt5Dx/Tus4XQg3w/jmj25 wVsgEqwbran/jDnVBDL5UKoXeS0rOcdm6mZ11boXQFV51TsuLVVkufl4nJaI+KjsFxap uiYayK4WBt79tQ8XV1xzfi9xOosXHXt9Q588bBmYItImOhi1zKmFUgtl0lrgoC+YvUEb M1M4km1xlMwAuwQ2PjHSYzVWgf5CawkweXn9mxgO7+Fldf4SfngGjl6B/jsj9Y/PRWVZ uflTTIc+v5ZalOTnTbEp1aXLOm1uA7BvL2yWRJ8AN19bqC2VZ+sVLfKAImXHPNCE1EJh Sf+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from: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:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=QsbrL9A+SUyE9Rcp5aYjsuYXuZZTldovXVUOVZRfb/k=; b=O17oD51optAxedCVHcCcJ1uYkyRrPYZVU/TaXrgHhpPhsyfWaqs4uoTtswrjks606q BrSYzLTIKNDSFkIFzOVesntvTKeLQasMvJeq0SX5+ohKdci/ldtO21MoX0f6H8AvY4XC 1sOXtEehZC44jvpTevwhSybPWIvMEKwBxdWwKoLtNgNWOIb3SrHvohaL6SQGIGixJOBE mhhilcWhYBZqTe5sS/FGCvv0b0DEshFjo7Ei7rDak1sEcRcZhj+3u8REEf49MIJvmwuY vUKlLQopy+nTYtiCy9k5GS9DF6x5g9EklKIHBSrOLOhK29FIjPhgNItthILGxhE1Y55S T9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ke0Fyy0y; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hr1-20020a1709073f8100b0078d71a6bd56si19287249ejc.757.2022.10.20.02.34.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 02:34:11 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ke0Fyy0y; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BFEB3954C72 for ; Thu, 20 Oct 2022 09:30:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BFEB3954C72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258210; bh=QsbrL9A+SUyE9Rcp5aYjsuYXuZZTldovXVUOVZRfb/k=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ke0Fyy0yP7k8JIXzSjl4VcFApE+6EOvwJH7S9mVCQLeEvQNa5922tOK9CaLeQxglT SxE1+ej2AnwEVSVeLXq7mROcOWxDqV61s1lzay2FDglVRO8ki/ogRai13GTJf2i2nF PUqIUbmO0CV4Q4/WxahjaSlcnvuW2U6Y3Kjr2gEg= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id DFEB638207D4 for ; Thu, 20 Oct 2022 09:28:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFEB638207D4 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 3ADD4300089; Thu, 20 Oct 2022 09:28:22 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Subject: [PATCH 10/40] sim/erc32: Use int32_t as IRQ callback argument Date: Thu, 20 Oct 2022 09:25:56 +0000 Message-Id: <8c05aec20557191434485be347d37177a2ec5ff2.1666257885.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tsukasa OI via Binutils From: Tsukasa OI Reply-To: Tsukasa OI Cc: binutils@sourceware.org Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747198622450018032?= X-GMAIL-MSGID: =?utf-8?q?1747198622450018032?= Clang generates a warning if an argument is passed to a function without prototype (zero arguments, even without (void)). Such calls are deprecated forms of indefinite arguments passing ("-Wdeprecated-non-prototype"). On the default configuration, it (somehow) doesn't cause a build failure but a warning is generated. But because the cause is the same as the issue the author fixed in "sim/erc32: Use int32_t as event callback argument", it would be better to fix it now to prevent problems in the future. To fix the issue, this commit makes struct irqcall to use int32_t as a callback (callback) argument of an IRQ. --- sim/erc32/func.c | 2 +- sim/erc32/sis.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sim/erc32/func.c b/sim/erc32/func.c index 6971ae0129d..527df172660 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -874,7 +874,7 @@ init_event(void) } void -set_int(int32_t level, void (*callback) (), int32_t arg) +set_int(int32_t level, void (*callback) (int32_t), int32_t arg) { irqarr[level & 0x0f].callback = callback; irqarr[level & 0x0f].arg = arg; diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h index 36346cae641..df6b22c47b0 100644 --- a/sim/erc32/sis.h +++ b/sim/erc32/sis.h @@ -137,7 +137,7 @@ struct estate { }; struct irqcell { - void (*callback) (); + void (*callback) (int32_t); int32_t arg; }; @@ -184,7 +184,7 @@ struct disassemble_info; extern void dis_mem (uint32_t addr, uint32_t len, struct disassemble_info *info); extern void event (void (*cfunc) (int32_t), int32_t arg, uint64_t delta); -extern void set_int (int32_t level, void (*callback) (), int32_t arg); +extern void set_int (int32_t level, void (*callback) (int32_t), int32_t arg); extern void advance_time (struct pstate *sregs); extern uint32_t now (void); extern int wait_for_irq (void);