Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp458132pxb; Wed, 6 Oct 2021 08:31:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSHassfIEHjaMT1VsvlATHQM5qfQbONbkwAOJntDQeK9IIf4nW8SMQjTEQBsjZ+fzTl/Z+ X-Received: by 2002:a1c:f405:: with SMTP id z5mr10479903wma.33.1633534278959; Wed, 06 Oct 2021 08:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633534278; cv=none; d=google.com; s=arc-20160816; b=Zbh0Sq9NoUyf9coaA5qTVx5M5TWcYi+XPBBTt5ea2xgj44wJF8Kor/6Wk4JLUNdpfZ 3x8+p6QgBOy9k0lAhUhefJwVZyif1MiKvYq7d8N6KaTq6C3UC3Z7YDsNZUrYGJkkV7bB H/FEEcNhtKfVjnj+c2l/BVqu6rxq4dRm8ep7PbWN/aNgLvd/0LN6bjrHjEdVA64fPEkn IPzkoLj8SKuSdN83cox1fYHOkk3qLkl2zms7vg196+8CUgcVt+2OwcWJbJh0wFeRB7dl HxGZdXt7BSUFRF/K4kIhN6mCrV3sbsXDUMWxDmAGe0hc0HlVy84kZBtre5FtjQzWXRfW jvnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GNWkAy0SlRNxOBETJgImmY0Do5cojfiwv7ryWkhaiuU=; b=r9lJFl4NFdGnIniayUe7tuwsps+itIkFnJB8lElhQdxFR+rD28Zc60F8cZcBw5cNE6 MBUsahijCADazrP8jCh9ygs3p967x12bFCuvLf7fpJ/9nYFT12LZhYp9HK4+Sop0bbxv vbWkUJjyMWwxXv/alcS2IvAlbRYRmFMMwNz12OLQp6y43wSAnJYIiZs2EdPEJRj2KXLy EFfP3K8CS0OcnwQXSa0fd625N7ueoqK/zkIXQVe/zA2/bhA79CM5JXPcO70qAovc8UgG 1GjP5pWWVUzDtWTZio8rWMaU6+Jj9ywgI1fTZKs9zfaPL4D5KVl8UallfF1HGmWDZLge JD5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T6JOPNbp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si22168242ejk.767.2021.10.06.08.30.49; Wed, 06 Oct 2021 08:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T6JOPNbp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239113AbhJFPbC (ORCPT + 99 others); Wed, 6 Oct 2021 11:31:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:59350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238124AbhJFPbB (ORCPT ); Wed, 6 Oct 2021 11:31:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9E8D60FDC; Wed, 6 Oct 2021 15:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633534149; bh=QUoyOL6OKULLLn7PEX8SoWT6GhmIXGbAaIkLoV31JTE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T6JOPNbpPN39ApHvyDoURRufEqEmkxBN1lZlgjradLHZKy1HHXowQ/s4WWyu6EbZ/ h4PjXnkejpZz5tzIwEXcosIp4KNadK50ltyM+w0VzFOBlYAg9sMHw8AXT984bmDKpW z9JF6DiTploHyc467aKH+7QhuCibhvP+qnOPmCK0= Date: Wed, 6 Oct 2021 17:29:02 +0200 From: Greg KH To: Wei Yang Cc: kuba@kernel.org, neilb@suse.com, mojha@codeaurora.org, jkosina@suse.cz, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hashtable: remove a redundant check in hash_for_each_xxx() Message-ID: References: <20211006152100.17795-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211006152100.17795-1-richard.weiyang@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 06, 2021 at 03:21:00PM +0000, Wei Yang wrote: > The three hash_for_each_xxx() helper iterate the hash table with help > of hlist_for_each_entry_xxx(), which breaks the loop only when obj is > NULL. > > This means the check during each iteration is redundant. This patch > removes it. Are you sure that the compiler didn't already remove it? Is the code output the same or different with this change? How did you test this? thanks, greg k-h