Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1623883pxm; Thu, 24 Feb 2022 06:38:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5w5nNKYAcF/vQpiIt9Glji6ii29GQc3CeNoFW/933DHPal9Xd5w4S/gNqIH3ccHdQ1UkK X-Received: by 2002:a63:ff01:0:b0:34a:d500:c77a with SMTP id k1-20020a63ff01000000b0034ad500c77amr2500932pgi.320.1645713490735; Thu, 24 Feb 2022 06:38:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645713490; cv=none; d=google.com; s=arc-20160816; b=OV2oUVZK2x6AU1mUULSt8AIHOydDVH93E32yOEvNXle9EQZwavHDivKy91YZP3oCBP LH6yXjq2KsYlMSu9HmVCuZRVakp+xOShoCPBNQucAf9RTwME2z6sqT//29n6nAQ7flMW 6uUhkio7lWe7pQ0nXrdldzI6tj11o7ka6Y+5y+D20q2h8XOx9lJPV0Cty0bptsJoWFCY yyZWArb8QyfRGSPzBGIPwhlii4WLudph1CFqNJ2CCi980nVFgcoJHGGULKcNMwQYHfvF AFsKmQZiz1W5ZhsFPyUaiFwenNnzDyVFKLUlIyawcPoC2SmfkRt2WGQt6f2/OIZY0o4R 6WIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=g+rrF8JUub4OBg9MyDm/2REtxx0IIbE/BeW/5erIvm0=; b=HROc0JYbCPp6znWu8Imh84UAJ0OOHqSei+BJvEHMqgMGWTzYSHu2sqscNfCqlwOkJg 4aUN7Fys26wGf0CHThxfnVoqgMAGVYZK9fisGQozmzSgDELcvyd65IpYfu6mG4fXAW8E eO57NN/qjmfGYsGfj81lqTfbm8YobqhxWQr0jrXJ/WFKGzLXYFPrJi3nIL/JexTvJNhK 0kR31kIu52+FPTchzb8uMDCVaThu9Gx9K6uDmJs2BS9P9qFSl1rjASpgtKvUJJw6g4Pf NDR8faZLQJICh0z9dtZDmBFsPAOU03Vq2ndy2hba9fAnbMtwILoanOpBupCikycWs8az hpzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hyRVWMMi; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5si2514682pgp.240.2022.02.24.06.37.53; Thu, 24 Feb 2022 06:38:10 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=hyRVWMMi; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231235AbiBXOaB (ORCPT + 99 others); Thu, 24 Feb 2022 09:30:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbiBXOaA (ORCPT ); Thu, 24 Feb 2022 09:30:00 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46F4117C402 for ; Thu, 24 Feb 2022 06:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645712970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g+rrF8JUub4OBg9MyDm/2REtxx0IIbE/BeW/5erIvm0=; b=hyRVWMMiEv7gaYo2vvV96PVVPrlRZdn/6QxsdOVC2/vbMPP4PM/1KBSpVtipiobaDnLcAl xC0iBBgNK+08u7zDmOybbbxzSZpVIuzXt4aPIdwTkrtWvopLxHD4lLAYg1oxQ/sLtMxq5x VoOnPpOu5cnK8Mj5m3GtE/5NvnrDtjg= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-499-oJ337DgNMhuMaOMk2Uh3Qg-1; Thu, 24 Feb 2022 09:29:28 -0500 X-MC-Unique: oJ337DgNMhuMaOMk2Uh3Qg-1 Received: by mail-ej1-f72.google.com with SMTP id sa22-20020a1709076d1600b006ce78cacb85so1300688ejc.2 for ; Thu, 24 Feb 2022 06:29:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=g+rrF8JUub4OBg9MyDm/2REtxx0IIbE/BeW/5erIvm0=; b=KMiPYM0B2NX9rvfvpprzmdlV4MwQWUJvuvfXSSG2Jm33IiccV4uKzC9DW5X1KjAHhC HH6OiDgAc/DycIM+bvNyJ1C5OsculNcqhBk7zmSgvqpgqBUEd3Sz/nI1FtBEbFDZ2WDx a1GLT1ppgNNjjEx5iHzoRs22bL1kyjMsSQMe6YcZ4S0zurQkG+lWz7OW+FnoFmF0+bSN UPQ2blAhtzQkHruxSuYPsBeEzNRyuQswt4FxANwZVaumSXdaqidxwMPDyD7g+3QAWcaH lujy9N382VQLlok2L9zMoV0qu7+gW36dyQ5OE8m6rksaXBdP8WqVma2uME5ZxjhyWZWG HG2g== X-Gm-Message-State: AOAM531b2DmEuBpmh92skhxhoTHwRDuyeX4iX3NnTqD7CGt+wjZIn/up xDTLy5AkUkOM1Bo+u8ZooQ2ailLPDD4c60VLRulo8tjyv4OVQ0cOQUAAUVNPAlHNqUnBxGfN99j w7SgI4AMUhO7LunO//U96u+yc X-Received: by 2002:a17:906:edb5:b0:6b8:1a5a:f3a0 with SMTP id sa21-20020a170906edb500b006b81a5af3a0mr2569834ejb.501.1645712966833; Thu, 24 Feb 2022 06:29:26 -0800 (PST) X-Received: by 2002:a17:906:edb5:b0:6b8:1a5a:f3a0 with SMTP id sa21-20020a170906edb500b006b81a5af3a0mr2569822ejb.501.1645712966649; Thu, 24 Feb 2022 06:29:26 -0800 (PST) Received: from ?IPV6:2001:1c00:c1e:bf00:1db8:22d3:1bc9:8ca1? (2001-1c00-0c1e-bf00-1db8-22d3-1bc9-8ca1.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1db8:22d3:1bc9:8ca1]) by smtp.gmail.com with ESMTPSA id 23sm1421805ejf.215.2022.02.24.06.29.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Feb 2022 06:29:26 -0800 (PST) Message-ID: Date: Thu, 24 Feb 2022 15:29:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] vboxsf: Remove redundant assignment to out_len Content-Language: en-US To: Jiapeng Chong Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Abaci Robot References: <20220224104853.71844-1-jiapeng.chong@linux.alibaba.com> From: Hans de Goede In-Reply-To: <20220224104853.71844-1-jiapeng.chong@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hi, On 2/24/22 11:48, Jiapeng Chong wrote: > Clean up the following clang-w1 warning: > > fs/vboxsf/utils.c:442:9: warning: variable 'out_len' set but not used > [-Wunused-but-set-variable]. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong This is not the correct fix out_len indeed is never read anywhere in this function, so the correct fix is to completely remove the out_len variable . Regards, Hans > --- > fs/vboxsf/utils.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c > index e1db0f3f7e5e..865fe5ddc993 100644 > --- a/fs/vboxsf/utils.c > +++ b/fs/vboxsf/utils.c > @@ -439,7 +439,7 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len, > { > const char *in; > char *out; > - size_t out_len; > + size_t out_len = 0; > size_t out_bound_len; > size_t in_bound_len; > > @@ -447,7 +447,6 @@ int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len, > in_bound_len = utf8_len; > > out = name; > - out_len = 0; > /* Reserve space for terminating 0 */ > out_bound_len = name_bound_len - 1; >