Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1549663imn; Sun, 31 Jul 2022 11:29:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4S0xZEDquuSJLcb9HU6Ektvxe/Og1i7Cvp04P2ilIbS522mVdlHMAQxkb/77ywRxtqNQVl X-Received: by 2002:a63:ba49:0:b0:41c:2713:3984 with SMTP id l9-20020a63ba49000000b0041c27133984mr502855pgu.468.1659292145363; Sun, 31 Jul 2022 11:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659292145; cv=none; d=google.com; s=arc-20160816; b=COx4oYZ1BbZf8LRS17Y6wYBaSo6LOGxMQEHQl4AXZfB8bdd9MAyCacj4TcAzqguGqD lDajQMWdwRRFBzl0LTjDWACSSSlOtnK96T3146bCYwGRuYQHysWUrw9a7HB2RQU6e7Y1 y4LCA0Kd+prSBH0wtIVmok3uDm2okorOhxAB2sRXlR4c1XgtCLtVbthqygLelr90HvyJ H2X/8P9XWB7tCuwyu+D/aD0MSWOqxFgNDKdFOPTbqy3CmXCx+2X3M5sgZ6JPsjuOWPt2 nH2qxq17QWbigxmqlS9noBgwM3PPtUHMey6bXRVqtbBD07+TB68i3Ak2z88B3Jc8Yf3X iLFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=dS/Z4x1hxkzvw2PXjyTCxS8B+KmxuxOGpGlnbjr4bXA=; b=mNpqcqF3I/GRFsV5ScStxi+GHuiRlR+Urw2bbFE8bnKsIXxp/d80YofwNm4cp9uaRV uYtlxPjletqBt0hs/ef5IuYw2AT+5UER5SZigiiuERbO7QGn7Xcx9n0/P9lU+u3N0ceG TrCXc4Dn0oZi0AB31boEwBSaMMysg2cC6hArabKdeB86rv/9/DvMebKkQWsjuc4rAQnu 4W65KM9KkIdXYZKLOiWMil1RJNOVoSbH15mn/QZtEmf7L5ePIJtam8Q+CRD9spE6PX3P NonPnrW5jxGkk5jkD4aDpwW/t3s/8wRtKrR7lssiG2N8FjkjtLtcDj0M3z9qem41lzrS PGTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wFSUsthZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a631201000000b0041a29a161cbsi10473273pgl.68.2022.07.31.11.28.49; Sun, 31 Jul 2022 11:29:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wFSUsthZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235278AbiGaSSH (ORCPT + 99 others); Sun, 31 Jul 2022 14:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiGaSSF (ORCPT ); Sun, 31 Jul 2022 14:18:05 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F671AE64; Sun, 31 Jul 2022 11:18:04 -0700 (PDT) Date: Mon, 1 Aug 2022 02:17:49 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1659291482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dS/Z4x1hxkzvw2PXjyTCxS8B+KmxuxOGpGlnbjr4bXA=; b=wFSUsthZSQ43DaZwYIq/EFmgQrldgTQoPJNCK/WFQ7qGEtYfksg5LeF6/lL/GAFIv1Fid1 q9RWW+NE4HjE+1mZhflgJ4QcJgs0YIIDpEACC2f5xcNa/ix4GrskDWpW0/ysvJbz4aMYPw IOYFFWasLSmnPmPtVte2z612kPovy4Q= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Tao Zhou To: Daniel Bristot de Oliveira Cc: Steven Rostedt , Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org, Tao Zhou Subject: Re: [PATCH V9 03/16] rv/include: Add helper functions for deterministic automata Message-ID: References: <563234f2bfa84b540f60cf9e39c2d9f0eea95a55.1659052063.git.bristot@kernel.org> <7b3f7ec1-a479-f3ed-42b3-ddead0f9b427@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b3f7ec1-a479-f3ed-42b3-ddead0f9b427@kernel.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham 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 On Sun, Jul 31, 2022 at 06:02:47PM +0200, Daniel Bristot de Oliveira wrote: > On 7/31/22 17:13, Tao Zhou wrote: > > On Fri, Jul 29, 2022 at 11:38:42AM +0200, Daniel Bristot de Oliveira wrote: > > > > [...] > > > >> +static inline type model_get_next_state_##name(enum states_##name curr_state, \ > >> + enum events_##name event) \ > >> +{ \ > >> + if ((curr_state < 0) || (curr_state >= state_max_##name)) \ > >> + return INVALID_STATE; \ > >> + \ > >> + if ((event < 0) || (event >= event_max_##name)) \ > >> + return INVALID_STATE; \ > > > > Should define the INVALID_EVENT corresponding to event invalid case. > > no. Absolutly I lost here, this is for *get next state*, must return a state info. > > -- Daniel