Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8441873rwp; Wed, 19 Jul 2023 09:49:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/uYt4oV0mFcp2RGTzIsWqUv7WfyqBtQSwuXncUfEWL0T0AxCnEGb7SUfaFG3vSLjxmxef X-Received: by 2002:a50:ef0b:0:b0:51d:d1ca:eab9 with SMTP id m11-20020a50ef0b000000b0051dd1caeab9mr2629034eds.32.1689785385017; Wed, 19 Jul 2023 09:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689785384; cv=none; d=google.com; s=arc-20160816; b=J7xOsqMup3C6Ob5SBF1c+/oJhKJPYo/lOmCxVvCGgYj2/iO7AFyKOOhX2HLP5JgTXF rerBZr87vVTuHF2zq2JNtK3rf1W+pN3ECCWjQb0bH66uvUXqYIxUGxVhkr9f0IvyomBT 76+EEKIPcQcsvn67Ghc0Q99QJ+fv8G8XIXuzGO8DI1oChwifqoGgpcEoQmKQ11GBS1Kd AMX4kYAZB1iyS5Jkwr1nf3ZnTwObDhE9A4Qc5kyRA2bTuIuCLOcmwLviK7L5uP1LdOaO zx2tDE+SkalXwmF3PVWuv6hSE+H8NkZp7Thux4lV7AMphmoSCOGCZVqa8S1gAORg6k0a 9YYQ== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=W6cmaIgG550CjEOLbwYDsmtYbG49ghfv6mhIx8RG8tQ=; fh=xMLUTEIDmwtHCpik00FRHgzOFAxlj+IlN3e+jmRIrso=; b=BtsZdERfZ4XfhGe4cFr7aphivF9LTh1TzwxZaFXUSX84XaKbbyUdyHAvv3jQF/9DqH 5gzXX+ynKdyqlG8KeniPSofhUhQ/0IDfsDNvYVq1PGx7RB40L8DdR16gj0ivXl2A7635 WwBUixngwZQkJAU4Hacc7PfWD8AQq1jZfU/6P7IlEDUgTny8HXnuzN4yfSX8KyqOIzIs k/vUzukkIo6H9cOUXMFcOkEW9Qg22gh6NYZuVWqlPb5a7UHvSDJXOpQB3CFVHH7cD8/k Y9ua6EjqmAxs8YBl+k/MII0NcyoWateK+2eQgrG/DXosCVzKKgQq9n0uO9Xxg1d65x25 u26Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EXvCiOqQ; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c2-20020aa7c982000000b0051a596271a7si3318568edt.459.2023.07.19.09.49.20; Wed, 19 Jul 2023 09:49:44 -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=@kernel.org header.s=k20201202 header.b=EXvCiOqQ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbjGSQ2y (ORCPT + 99 others); Wed, 19 Jul 2023 12:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbjGSQ2x (ORCPT ); Wed, 19 Jul 2023 12:28:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7A6CB6 for ; Wed, 19 Jul 2023 09:28:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D50D612C4 for ; Wed, 19 Jul 2023 16:28:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30F21C433C9; Wed, 19 Jul 2023 16:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689784130; bh=mIPWRegXctVmbaqFYfnJtfGdsGtv2kb3BA0sg42Weq0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EXvCiOqQIyWkGkHjU75JEkTVUDrykU8zhj8RUWweMzynUbaCvHTgywL7G2WERN0H7 VnG2j3aRlxlRaJFxaHG4b0uhm58Y2MWZhCFggmrFdcAyJx/ADqR5FiPqYrKGQFQp4o yYVoOu463yyPZ9+hReuXnSls5Oul4NtCCUGXz0CVsk/UbKw/x0QQR2WmUq2DXa6fD4 uBOoM1mlsNtFbA/gxnPJdj8m1ToHDk7UdBD4FSoGQOFGrL4KmlDi7NUjYOm7m2neSn 4cn3Y9JAjG8r64m0QeqP/9saPfcnfwjjXW2/871nHHKef4rGYeNLMlh+DvBnxl6ZrM OB6eIMspE+DvQ== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Andreas Schwab , Celeste Liu Cc: Palmer Dabbelt , Paul Walmsley , Albert Ou , Guo Ren , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Conor Dooley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Yan , Ruizhe Pan , Shiqi Zhang Subject: Re: [PATCH v3] riscv: entry: set a0 = -ENOSYS only when syscall != -1 In-Reply-To: References: <20230718210037.250665-1-CoelacanthusHex@gmail.com> Date: Wed, 19 Jul 2023 18:28:47 +0200 Message-ID: <878rbbkgqo.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Andreas Schwab writes: > On Jul 19 2023, Celeste Liu wrote: > >> @@ -308,7 +312,7 @@ asmlinkage __visible __trap_section void do_trap_eca= ll_u(struct pt_regs *regs) >>=20=20 >> if (syscall < NR_syscalls) >> syscall_handler(regs, syscall); >> - else >> + else if ((long)syscall !=3D -1L) > > You can also use syscall !=3D -1UL or even syscall !=3D -1. The former is indeed better for the eyes! :-) The latter will get a -Wsign-compare warning, no? Bj=C3=B6rn