From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B590BA4A for ; Wed, 30 Oct 2024 00:26:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730248007; cv=none; b=XxRfGTVLfJ9YBnZuTKJ8BLepD1NXABdEgbA3B3exxt9z+X0docRDbf+1WADSwv9VD+ytl0jWc8iDrZhkqBx48DV6QamNTyQuHKnIFdXAfMbRCu/9tZKxj6j/HxoIXsj1nXNcaRSDCeOUlizmPSz8Ub5KKaEhqw7Ix8V6ANP//yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730248007; c=relaxed/simple; bh=zd88StyOhjzjHySQr8kpJEgsrhxqHnjBmx5BjhTdaQw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NH6c6L1PYd50/7yjK561RuQzHPp25pr71ivBugZ2/9KDWpYNIJptTr9kZoB8qrdoCz9UnaDnUrgwivpJMmWQVh5URkEvuGEuv/CJRHCjAiqiep7/KfDiAK20q8ihJtTAHSUp5izvTwWotusC6eDCThFf27fxQk8ggGqfszBhwB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AyBpilZw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AyBpilZw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A3D4C4CECD; Wed, 30 Oct 2024 00:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730248006; bh=zd88StyOhjzjHySQr8kpJEgsrhxqHnjBmx5BjhTdaQw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AyBpilZwajuhqfSjZ+u1HinbpAxGUwsjTK4bHH7n+fZtM78sfu1sJvsIesiR2YDQ+ 7AHvoGttfw+WlEq31VszoHmdlBau/m7SbnPv0/xlKnFjoLAKo5USdun6IojrSw6JbQ G9z/MMjXip5bbiGEZ9UcdojM8uDfu5N1s0fPxhPf3BWT+Flk4TGGznUJJZ/Y74JoRA KEtL05faxGWmT2Cb209Ob6eMcTWSwmX1RZ/saH1/lm0ZDG3uvH1TFQoHuN3YMRFHp6 aH9uK0i9tTBoSKhBDf/bXYp4dCxLxVAvLdaV5r+RhqnR5KNbQDG9koMDPyA6cPOZIJ oPZ+M2YU+AEsg== Date: Tue, 29 Oct 2024 17:26:45 -0700 From: Jakub Kicinski To: Alexander Lobakin Cc: Mohsin Bashir , , , , , , , , , , , Subject: Re: [PATCH net-next v2] eth: fbnic: Add support to write TCE TCAM entries Message-ID: <20241029172645.61935736@kernel.org> In-Reply-To: References: <20241024223135.310733-1-mohsin.bashr@gmail.com> <5a640b00-2ab2-472f-b713-1bb97ceac6ca@intel.com> <20241028163554.7dddff8b@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 29 Oct 2024 16:30:54 +0100 Alexander Lobakin wrote: > >> Please declare loop iterators right in loop declarations, we're GNU11 > >> for a couple years already. > >> > >> for (u32 i = 0; ... > > > > Why? > > Because we usually declare variables only inside the scopes within which > they're used, IOW > > for (...) { > void *data; > > data = ... > } > > is preferred over > > void *data; > > for (...) { > data = ... > } Are you actually actively pointing that out in review? If it was an important rule why is there no automation to catch cases where variable is only used in a single basic block but is declared at function scope. > Here it's the same. `for (int` reduces the scope of the iterator. > The iter is not used outside the loop. > > > Please avoid giving people subjective stylistic feedback, especially > > I didn't say "You must do X" anywhere, only proposed some stuff, which > from my PoV would improve the code. You said "please do XYZ" which in English is pretty strong. > And make the style more consistent. "Avoiding giving people subjective > stylistic feedback" led to that it's not really consistent beyond the > level of checkpatch's complaints. checkpatch is obviously bad at its job but I don't think random people giving subjective stylistic feedback will improve the situation. We have a handful of reviewers who review maybe 1 in 10 patches. The reviews are very much appreciated but since those reviewers are not covering substantial portion of the code merged they should not come up with guidelines of their own making. I see plenty of cases where one patch gets nit picked to death on small stylistic issues and another gets merged even tho its far below average. Doesn't feel very fair. > > when none of the maintainers have given such feedback in the past. > > I don't think my mission as a reviewer is to be a parrot? Not what I'm saying. Please focus on functional review of the code, and process / stylistic review only to the extent to which such rules are widely applied. We even documented this in the netdev "FAQ". > >> (+ don't use signed when it can't be < 0) > > > > Again, why. int is the most basic type in C, why is using a fixed side > > kernel type necessary here? > > Because the negative part is not used at all here. Why not __u128 or > double then if it doesn't matter? We have plenty of bugs because someone decided to use an unsigned type and then decided to decrement as long as its >= 0..