From patchwork Tue Sep 26 01:20:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 144669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1601918vqu; Mon, 25 Sep 2023 18:24:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1BBaqcV9/4XR9+AicaRaZYosNXnVHSioHrnAjmkjjH3z1HwNHNnscdRLmpe7ltQRyp0sJ X-Received: by 2002:a05:6358:2823:b0:135:47e8:76e2 with SMTP id k35-20020a056358282300b0013547e876e2mr11651020rwb.4.1695691465127; Mon, 25 Sep 2023 18:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695691465; cv=none; d=google.com; s=arc-20160816; b=oaK2I28eTO11CoEYhUxiHffONoxEmGHuJ56tKE7Ha5lRKLJwqOGrFX+Nz8+69gGGLB X/RtvfTKj/VyB91GatlEa0GoYwiE+zsPUsor/ufj6ObmJrUENbV6QJuGG1OFcYGihYyE VONGc9f6S9PXJ+ZExH1t3zyqInh06LLJ4MpbVdVdlSub8ZpVzRPkmcrXddYoJTvYtvWa 0/u1JsBJC7xgdaSDazxwNfcw6EKkFUkkeMGyqlicOC1xQ4D4efgI+J3ajHBnBkc/KovQ oompOhirPKB2WlhI9fNGpj0ErbW4QXhtcZO9alqXT7S8JKZm/ICvxzUu2biOilxo53nZ SWfQ== 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:subject:cc:to:from; bh=eKgCfje1Ax/3UDGGmWbdqh0ei2AcZXg71FfXk1M72rI=; fh=LzvCeX1kuqDjAXP9dI4IzjeiZr1WK44jllmrJVBQRDc=; b=iGjyKKFrDAbaY/ArVL8F9WEzyv0/JCxgfkBAkWujEH2rRXStxmZK9ugZRk8DGjpdYZ orRykY6nQ6GxSR3F4td+t1wLdwAeVFgSE0KAVPCl1USuxG8UMOZe/bFTqJqs4Af1VBtX JjILeDBx0CCELosFNSQRnU9lsjbEnm0pqmsFbwSfbfmuXdGtSivNSGWcLandlWVFSb/c omLaYX9QmBEb2VttYe+1uNnuicyndjlC6U0ffUznyD5O9RJ9aQpE+i3xrz0PVDgyc4Tg QfgNdiRLXWdUPcY4ZVAcsNYGNiUbhLQUrbu+V1Q1aPnUZR6kFcorpObA6vec9wkRfxyJ +Xbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n22-20020a63f816000000b0056f7592d732si11140409pgh.424.2023.09.25.18.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 18:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 34D1E80781CD; Mon, 25 Sep 2023 18:20:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232910AbjIZBUd (ORCPT + 27 others); Mon, 25 Sep 2023 21:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231225AbjIZBUc (ORCPT ); Mon, 25 Sep 2023 21:20:32 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 0AC5211F for ; Mon, 25 Sep 2023 18:20:24 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 0CFE1604DE359; Tue, 26 Sep 2023 09:20:07 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: rafael.j.wysocki@intel.com, kai.heng.feng@canonical.com, dmitry.osipenko@collabora.com Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] =?utf-8?q?kernel/reboot=3A_Remove_unnecessary_=E2=80=980?= =?utf-8?q?=E2=80=99_values_from_ret?= Date: Tue, 26 Sep 2023 09:20:00 +0800 Message-Id: <20230926012000.28012-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 18:20:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778061373796453883 X-GMAIL-MSGID: 1778061373796453883 ret is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming --- kernel/reboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/reboot.c b/kernel/reboot.c index 3bba88c7ffc6..e00a02a74694 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -702,7 +702,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, { struct pid_namespace *pid_ns = task_active_pid_ns(current); char buffer[256]; - int ret = 0; + int ret; /* We only trust the superuser with rebooting the system. */ if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))