From patchwork Mon Oct 23 06:23:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 156678 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1106878vqx; Sun, 22 Oct 2023 23:24:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdIju//C4wkgoUDcJRq4RyPEMTen7GuLf2UYPQVE1CxMibo0XHMirDe9FUxQ8MviZN8xhd X-Received: by 2002:a05:6a21:778d:b0:17b:3438:cf92 with SMTP id bd13-20020a056a21778d00b0017b3438cf92mr5680836pzc.5.1698042291386; Sun, 22 Oct 2023 23:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698042291; cv=none; d=google.com; s=arc-20160816; b=V522RtPqQb01eUo8Huag31vkfUyv1gRER6myn6GSNnyes7jFDfiLf1IdXSO3E0IVrl aUvJAfPc7SPJFV/jV9/C3N5RBDotn5hLUfK7j2n4Um3+pIb6zj3Gd+wNmVhmr8iuhPXG DI5K4hUZyFKp8ysjbR/Z/kvrwMWS1H1cJqT7hCNdjnMUQc8Rs5IV6nljQRjfj7E0fai+ Fyv3mms9kOfbfA9xA2p5AtjJHm4BOaglk565hHG9T7YcFlqWKE+/u39RL88YHFVFGEER 2wpJf9fYo8P/JSHMcIkF+w2pzL5751y6aZ1Hv4i9v97O2Pjzij2aKUSZlkmpsLhOS4Vn EWDA== 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=eaQe8ra++TMT1XrFjaK5fPsv79t/xCyt+oTUDGGr3WM=; fh=mbFTUE+PaEP9pnaCgOXXpT5f0fgn7RSVIcoRztSbW6o=; b=QHwsRDyWQnEZGjGY8iKe+/NmqBFDZcsnwvSCAzpHyt4lyK4/mGpC1V/OSo5Dm0DH9s bT65UC4a3AG0juP5kjJdxUcbjamfXwXBHnf6N8mmUepny7EpseQeBJ7JFTjT4QzaDzJP 23HSNdzggKT0XAjkNZ1FfzsCJDxVMl9Ti72tc/hrSq2MPdzBIXFX0kl4PSF3XM1YmeKS Kftwc4kgA/AkJl8sGWcNKQ4LT5g9xqylHoO2Js0UEsiQCn6Ge1BnLmz0U3g+CeHkMGcd wQB0+1Xhiv1vsp+WViv89X9e65YoK8aske+tAsYvUkPls0Oisbr1GU6LxyQYVOor027G wOsg== 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:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id lw16-20020a17090b181000b0026b74f6aaa8si8868784pjb.63.2023.10.22.23.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 23:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 646CE805CAD7; Sun, 22 Oct 2023 23:24:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbjJWGYa (ORCPT + 26 others); Mon, 23 Oct 2023 02:24:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjJWGY3 (ORCPT ); Mon, 23 Oct 2023 02:24:29 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id AD041DB for ; Sun, 22 Oct 2023 23:24:25 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 392606017108E; Mon, 23 Oct 2023 14:24:11 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: pmladek@suse.com, rostedt@goodmis.org, john.ogness@linutronix.de, senozhatsky@chromium.org Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] =?utf-8?q?printk=3A_printk=3A_Remove_unnecessary_statements?= =?utf-8?q?=EF=BC=87len_=3D_0=3B=EF=BC=87?= Date: Mon, 23 Oct 2023 14:23:59 +0800 Message-Id: <20231023062359.130633-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Sun, 22 Oct 2023 23:24:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780526393930747631 X-GMAIL-MSGID: 1780526393930747631 In the following two functions, len has already been assigned a value of 0 when defining the variable, so remove 'len=0;'. Signed-off-by: Li kunyu Reviewed-by: Petr Mladek --- kernel/printk/printk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 7e0b4dd02398d..38031fd87f34b 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1669,7 +1669,6 @@ static int syslog_print_all(char __user *buf, int size, bool clear) prb_rec_init_rd(&r, &info, text, PRINTK_MESSAGE_MAX); - len = 0; prb_for_each_record(seq, prb, seq, &r) { int textlen; @@ -4188,7 +4187,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dump_iter *iter, bool syslog, prb_rec_init_rd(&r, &info, buf, size); - len = 0; prb_for_each_record(seq, prb, seq, &r) { if (r.info->seq >= iter->next_seq) break;