From patchwork Tue Jul 11 20:21:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 117592 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4773907vqx; Sun, 9 Jul 2023 21:32:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlGy1YAB1O1V1/bQCXwWH1nxR29AQUKZp2HBVepE43L8K61U87NJjXNnkkrAl6B7HqGuqoiM X-Received: by 2002:a05:6358:988d:b0:133:7f9:303f with SMTP id q13-20020a056358988d00b0013307f9303fmr10341176rwa.23.1688963521373; Sun, 09 Jul 2023 21:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688963521; cv=none; d=google.com; s=arc-20160816; b=D5q99rqDsWKnNNxklxUO8gj6u2uuIzWxGOrpB4gP+kbXdRouDHcit/eG20V01LGnJo ww49hBv4y+Iad34h37v+UZd17q3e39zXDxbnGkEJjUkLGDekRiu2QorCA+r54sIzVxNE 4LGMxnAhwnY0JKEMbJBTPVMxXWdMUbBnwv5WSHUv2vr5cuYoLED0if2+fe0OlXM7HjMB N52ABV3/+xhX8IhsCY4lQVpze21rQKaJNAobZepLgdAZ4f2sDQD5p9kZ9fInX1GitX7C cwAiEP7EfGSh/5z9hf7ijoAm9HxMhRRfS+gmkrnF4xLDPkyEOZH2kCfQWO/HEwsQul+T tZxw== 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=L4zJLwSJP4ogSpuzS5PUfUOoY9+zxP8KSD1nIy+GF8c=; b=jmTjfKXgxR5RVryTKR8bjnmlfGOcqr7JXe9Sew8uebJaAuZj5oLBWRK7swh5n7R7dP zvE769SByo159NIyE9BV1RgtDvzizj96VMYPauPsx85nEJnLH5oA+WvkAuWgNgiktZBq yA9reVyesU32poPOhrYMQGQckiKLhxZaeUPFeoWb7D2+QzHMw3tOYNt27ay52Fxw/qeg IWAmeltxqhAzt0jn4cGcAHYYfWHJZuO487rOpo+tjuDxpDHFktboGd0UYUl0OzLteX42 tkOTd4VEGDbz+3TK1MjQFHY4VA4hiJp6nIYOImqhTXX/ld+8vO6w9XD1a+JMfLTf6szX 7XPg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v202-20020a6361d3000000b0055c558ac516si399054pgb.854.2023.07.09.21.31.48; Sun, 09 Jul 2023 21:32:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbjGJDvV (ORCPT + 99 others); Sun, 9 Jul 2023 23:51:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjGJDvS (ORCPT ); Sun, 9 Jul 2023 23:51:18 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id B9C81C3 for ; Sun, 9 Jul 2023 20:51:15 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id D9840602A09B1; Mon, 10 Jul 2023 11:51:05 +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=3A_reboot=3A_Remove_unnecessary_=E2=80=980?= =?utf-8?q?=E2=80=99_values_from_ret?= Date: Wed, 12 Jul 2023 04:21:45 +0800 Message-Id: <20230711202145.5138-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771006027616464901 X-GMAIL-MSGID: 1771006613212724569 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))