Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2061873iof; Tue, 7 Jun 2022 18:28:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj9dG5EZsoZ5jIdy8HnAfsLvpfSArh7dgwZ4fnaSLHJ6nCjPXtdvF+++FbvPqkYdASZdr4 X-Received: by 2002:a17:902:d904:b0:163:dd91:87 with SMTP id c4-20020a170902d90400b00163dd910087mr31383620plz.34.1654651737008; Tue, 07 Jun 2022 18:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654651737; cv=none; d=google.com; s=arc-20160816; b=fYeBSPyxDrSzbznPSIY2RwyNBtyIfOKExwjWKJXuItFZIoYpbC+PzyTA5YhkuFnRRE sAIyNAtiY9J2VWp1KkoH6535GCzTuN3FKj6bxqROdeklScdsDyLX/ZNZFj3cK+nj6oQ9 AkkeAZx9KFivJ6EKNIB36hdbxiAam3Pk2UNO9Dwpgi2q1ouTijL9YYwznqvoGcFaWdvh ye3ZbyCG9URdXBBS9VVCdemIL8NOwwtZb7byZZXmtY0F7cT0Gipmk5Wiyz+hR0JgFwyO kzJ1FuP+gubLFmbAujjr4yTxJWdO9NACkb22yCaXCRlQuHojOaULVnM+gRKGExOujiok +ssQ== 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:dkim-signature; bh=gyeTbiR+uUhE29A+RGuh6i8rdvYUlUvUGCn1xr1k4cs=; b=b6WKWZ+UZPaHxQfDZ5KpjFsmS4sL4OhmGrop1BZz+GlPZyXKYsmMfkN3fXX0X5HSqp FAsXarVaeGadnclch9RVOj+bbEBbOe/KUr+Qy8/Yp85UrVyYzbT8bobsntM7Nyt/fpZp HEf040i/PRVQkVzlPfmK8kiS9I8kKKwq5TCfAN3R7O8tsuK4uUEngS/3Zf/+wb3MCe6F DkMg80BM49WgLTd25Nx1Z41FJvPEUNVOSxkIMOrR4pbNXQsiZ58eLbxF2/Kd4rHGO+eg KZn10H1qAGtBxc2mR1ytEU7IeWxP5VhtN8CM+Fd/1JVTIjH65Oe4mLbZ0Sx8DQl9rG/c ZckQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=E9D9zVOY; dkim=pass header.i=@paragon-software.com header.s=mail header.b=pqBlGqW6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k19-20020a170902761300b001623b7ba910si25816449pll.29.2022.06.07.18.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 18:28:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=E9D9zVOY; dkim=pass header.i=@paragon-software.com header.s=mail header.b=pqBlGqW6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 97689273905; Tue, 7 Jun 2022 18:20:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245728AbiFGP7J (ORCPT + 99 others); Tue, 7 Jun 2022 11:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344674AbiFGP67 (ORCPT ); Tue, 7 Jun 2022 11:58:59 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C74ED5DE4E for ; Tue, 7 Jun 2022 08:58:56 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 5FA5B255B; Tue, 7 Jun 2022 15:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1654617497; bh=gyeTbiR+uUhE29A+RGuh6i8rdvYUlUvUGCn1xr1k4cs=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=E9D9zVOYRdWoge0CnkXB7UdtfsA3h/RovelUsR30YXMLNOThcmNY5zWXcevyMIw/Q 3eCOD2nG2R+3aLqY8ZGWKCJx+9DiwE0RBwNrdkR2D3GjubNIVFOvyxH48FP0tMAON3 Uv+Gj6A4iEawWW7EDTGe4C0v6StfNftJ4zYbhw8s= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 6C7481D0B; Tue, 7 Jun 2022 15:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1654617534; bh=gyeTbiR+uUhE29A+RGuh6i8rdvYUlUvUGCn1xr1k4cs=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=pqBlGqW6xS6n3BWqW/81M589K6ALyy85JH0UEAahiZxABf8Z0GwvzPioqJXHZnbLI clBXZyjEH412XG3NHfnqLNEBpR0dpNBqqz6lBPwotKWopecHCbnZ1gcz+qxKBVFj/o QvS+0J5c+2tkBgkcEFk+AsJMy1fcsjBc5QCxwimE= Received: from [172.30.8.65] (172.30.8.65) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Tue, 7 Jun 2022 18:58:54 +0300 Message-ID: <4f66239a-2209-6375-95ad-e8be0d28cf85@paragon-software.com> Date: Tue, 7 Jun 2022 18:58:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] fs/ntfs3: Remove a useless test Content-Language: en-US To: Christophe JAILLET CC: , , References: From: Konstantin Komarov In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.30.8.65] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_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 On 12/23/21 15:20, Christophe JAILLET wrote: > 'new_free' has just been allocated by kmalloc() and is known to be not > NULL. > So this pointer can't be equal to a previous memory allocation, or there > would be trouble in paradise. > > Axe the always true test and make the code more readable. > > Signed-off-by: Christophe JAILLET > --- > fs/ntfs3/bitmap.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c > index aa184407520f..e3b5680fd516 100644 > --- a/fs/ntfs3/bitmap.c > +++ b/fs/ntfs3/bitmap.c > @@ -1333,9 +1333,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits) > if (!new_free) > return -ENOMEM; > > - if (new_free != wnd->free_bits) > - memcpy(new_free, wnd->free_bits, > - wnd->nwnd * sizeof(short)); > + memcpy(new_free, wnd->free_bits, wnd->nwnd * sizeof(short)); > memset(new_free + wnd->nwnd, 0, > (new_wnd - wnd->nwnd) * sizeof(short)); > kfree(wnd->free_bits); Thanks for patch, applied!