From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40zx095Gx8zF0dm for ; Mon, 4 Jun 2018 23:40:41 +1000 (AEST) Date: Mon, 4 Jun 2018 16:40:24 +0300 From: Dan Carpenter To: Julia Lawall Cc: Qiang Zhao , Li Yang , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift() Message-ID: <20180604134024.dmd7mn2wggqpmkcq@mwanda> References: <20180604115842.7c4vzge3igjbnblt@kili.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Jun 04, 2018 at 10:25:14PM +0900, Julia Lawall wrote: > > > On Mon, 4 Jun 2018, Dan Carpenter wrote: > > > There is a copy and paste bug so we accidentally use the RX_ shift when > > we're in TX_ mode. > > > > Fixes: bb8b2062aff3 ("fsl/qe: setup clock source for TDM mode") > > Signed-off-by: Dan Carpenter > > --- > > Static analysis work. Not tested. This affects the success path, so > > we should probably test it. > > Maybe this is another one? I don't have time to look into it at the > moment... > > drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c > > /* For strict priority entries defines the number of consecutive > * slots for the highest priority. > */ > REG_WR(bp, (port) ? NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS : > NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS, 0x100); > /* Mapping between the CREDIT_WEIGHT registers and actual client > * numbers > */ > > I find some others that choose between constants, such as ... ? 0 : 0. I feel like it should warn about all of those because people shouldn't be submitting unfinished written code to the kernel. Coccinelle is a lot better for this than Smatch is because it's pre-processor stuff. regards, dan carpenter