Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp461887rwe; Wed, 19 Apr 2023 01:07:01 -0700 (PDT) X-Google-Smtp-Source: AKy350bp3YEEzmD+OYEqQn77ZLcQJ48+TclNkMwMfrg6pfzyKPfPVN6vxm5R2ySZg4Llpd+qO0Kl X-Received: by 2002:a05:6808:13d2:b0:387:210a:6f47 with SMTP id d18-20020a05680813d200b00387210a6f47mr1273738oiw.21.1681891620902; Wed, 19 Apr 2023 01:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681891620; cv=none; d=google.com; s=arc-20160816; b=g0GJsXegBRoFkUYVLTeV+h/10a5G1QtqE6xbVpIYzsiOGhvs7WygaGhNarQiOrmcqQ 4tq8retaEyzz5sXqEEaD4qiLzoLiAbK+yJVFtYzw+87EAlZwL+0GmyquKFWihJF42cWJ hIjaFMlIbBRqSpSw7QE1SsdTD3u+uP63vm/KkR9rP0UtkDzjKchWaE2A1fTqpqZD94uv lr7rOb7EFHjTap94qlH1WIz1SbFQhIGJQ7+FgDXXGfpAJhdC2rAvNckc3FStBf7PO9nq DkfqyQhZzBPPFdfrLkKMj2bGrbnen7M1KCXX/mdmwu2O04sKW7D1K0/Szi07uYvNxj8o Dzew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=v9nhWTNFUot8DhVxJTGVf8U7r1UFd9xR4G2cjz6ra5U=; b=RzTH2DRfYNMEuO69NBwd0CKNGaHUgPOWit8ty0OPAwt8on/TfwvV2wzAPZf99SoPta j8TdrffgcXZR3uAYIXn7QMrMG7ZE7ENtKY8ShJVN4FIfGHqfUi8yigLJ5iSr/hUmDd7U 8TWy3eQJLVgnxPf/2SaMtAkk+EtUaMU+FngaSASDTlmFUsrl4Sm+R27GN7UfOEZ0j9Z8 qXJZSOguycVqXYXq4PPil5rlk6C8c4qDIVwEfp2qe43hqO9OLn0+BSdjokEm/b0EvJGu bJEabVK8ThPLPCWtqEzewJMY9VWPboV8tx2q5paPREPCGf/YSZfbcfkX1clNG7b1omod DUqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGBfyPyJ; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn5-20020a056808618500b003877dc1c2b6si14821594oib.325.2023.04.19.01.06.47; Wed, 19 Apr 2023 01:07:00 -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=@linaro.org header.s=google header.b=EGBfyPyJ; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231925AbjDSH6x (ORCPT + 99 others); Wed, 19 Apr 2023 03:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbjDSH6w (ORCPT ); Wed, 19 Apr 2023 03:58:52 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC8D49D2 for ; Wed, 19 Apr 2023 00:58:51 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id d8-20020a05600c3ac800b003ee6e324b19so969479wms.1 for ; Wed, 19 Apr 2023 00:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681891130; x=1684483130; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=v9nhWTNFUot8DhVxJTGVf8U7r1UFd9xR4G2cjz6ra5U=; b=EGBfyPyJHJotUnoVy1IkY/z6izta25ZfsN2JEoy7WTUfA2I/BsJnN1O/cGBb9O6axs Q+SZT3mKAnoCtliZ+TRB+QWM9K5ES5jHA2a6j9xIpoo+tWdQvuF4XBrDs3085yMn2ajB XI5+iIOwoaCrXk1FmUiH+A4Sf9SnQvAjRjfzbKH2gFO5cCvpjvfRKxsXtSRaCJfGjG0I AaYKERq25347rd+waTxa58Ifxf5rRW5e+g8Q48fpTjblXj1heahw1x+1JG4b80FE2k33 Q70fMZmKlNPuox0UJjNcIVPNS2gW0xmt+EN73JafKqhsrE8EFhtyP/MXLWBtBhEBXQEM vK9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681891130; x=1684483130; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v9nhWTNFUot8DhVxJTGVf8U7r1UFd9xR4G2cjz6ra5U=; b=EI1orF2CrrXvuhGrJBOvipvm1iQWNEiFIScdhQVhtpaBj1oZ0TAoxSQr2p3JiPOiOu Nwxv1k6cMe1tIuPpSJssoGRHioCEOWN7SjxHKJ2BlZZO7hzL/mP0HNyjjT0sSSBYoPyJ YTIUTWeiukjeDWNlgyyp+PVaKwnAXvp2t+bYHmBnfrzjSCkKXKxUQNG3zTjFwOvVZNpw v3VJ9OnWDD+GLe4HQmKrZxh73QIcFmCQvVVq/b472DDGPOH/MpQMwARs5ePphdADnOBg p+sHkFOHk7GIClUwgsN2F2KL+JZlSC3q5QiXezPpkUvxmwc7YRcrUm/5KUfNx+BmF621 JzkA== X-Gm-Message-State: AAQBX9e84i8iTgr31iXp53+S7+Zz+ErSiBmtWbaCX/kAxdtEMZ/SfMge RXb52ivbEEDT4ZswUGIcDfo7Cg== X-Received: by 2002:a7b:cbd0:0:b0:3f1:75b3:60df with SMTP id n16-20020a7bcbd0000000b003f175b360dfmr5955964wmi.41.1681891129997; Wed, 19 Apr 2023 00:58:49 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id p19-20020a05600c205300b003f173a00304sm1330043wmg.17.2023.04.19.00.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 00:58:49 -0700 (PDT) Date: Wed, 19 Apr 2023 10:58:43 +0300 From: Dan Carpenter To: James Morse Cc: Will Deacon , Kristina Martsenko , Mark Rutland , Mark Brown , Ard Biesheuvel , Liu Song , D Scott Phillips , James Morse , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] arm64: delete dead code in this_cpu_set_vectors() Message-ID: <73859c9e-dea0-4764-bf01-7ae694fa2e37@kili.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The "slot" variable is an enum, and in this context it is an unsigned int. So the type means it can never be negative and also we never pass invalid data to this function. If something did pass invalid data then this check would be insufficient protection. Signed-off-by: Dan Carpenter --- arch/arm64/kernel/proton-pack.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c index fca9cc6f5581..05f40c4e18fd 100644 --- a/arch/arm64/kernel/proton-pack.c +++ b/arch/arm64/kernel/proton-pack.c @@ -966,9 +966,6 @@ static void this_cpu_set_vectors(enum arm64_bp_harden_el1_vectors slot) { const char *v = arm64_get_bp_hardening_vector(slot); - if (slot < 0) - return; - __this_cpu_write(this_cpu_vector, v); /* -- 2.39.2