Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3624002imm; Mon, 4 Jun 2018 06:48:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL7GzLqX+En3BuOt6IpfCzTWJBwNnXk8W/eQxARHfc1LiGvqY9zlGMKfJHFn/pay6K2hSSh X-Received: by 2002:a63:8f0d:: with SMTP id n13-v6mr17745890pgd.109.1528120095630; Mon, 04 Jun 2018 06:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528120095; cv=none; d=google.com; s=arc-20160816; b=hUklgZsaJ68UbxKh7dXJmjLCcbNqYObASMPITLYPzHZ3pjHpON1W0CTWwJwLkAlEII gDohHZN9J5XxZLu/bbb97AxnsT5Jng7958PZSO9YmSHlOo9c/gVLMmT6e3pHhN0mGnwq inX07GEHQoDw4FLDCgomePOmZBo79puEkP7rW2giBkkqNk38oA2Eb6DqS1bnsAoFEHA5 SQSJK7RuF/bJl/37AfadYvH96BJm5wo2g3T8gjDZyNh+jDvdXXOyYzKqteVCNzPLKbnj OoDzpllpVuEjXyiKw/i8luYYQ1C3Uj+01Yk3wDjrnQ4UUeDnJ2wPDSkR+8X4u1YEbkg2 Im8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=4cHENJVYE1OR2jKFWBSSVsdmzGwfXSKMr7oN+CldhUo=; b=zyzpDpclyoGgwsFgpHZCduYs1u0J9jaZnVbprFuq7yxX6PZVcsuErqo9t5MacH+vtv VNnNMaxFf8I8hg6kTdlNhRmneHLWtNNlRcQMngbBKgILY0+KNDJMd++OidShsB0UEkYY 1kqd6YDYWOwbW5dgBQXYKevDqnaE+DbM6mVvPO9KrXvJfAM9FrlfIgrA6WrilY5tN6NH R3fH7QTyOfahO8avoL6Ji9vSZ1qis85ELS/O0FiPyQ0C753iiocATZ2i7q/HxXnTgtiE Jhqf0WkbsuoeTawSac3ms4DupTV7BxGWBlntiSI3R6b3zOgBl+Fw6XJLjYGFNJ95JK4m nuSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si44166210pfm.32.2018.06.04.06.48.01; Mon, 04 Jun 2018 06:48:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753265AbeFDNqS (ORCPT + 99 others); Mon, 4 Jun 2018 09:46:18 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:56361 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbeFDNqQ (ORCPT ); Mon, 4 Jun 2018 09:46:16 -0400 X-IronPort-AV: E=Sophos;i="5.49,476,1520895600"; d="scan'208";a="330239338" Received: from 115-178-117-63.flets.shareline.jp (HELO [10.5.3.74]) ([115.178.117.63]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 15:46:11 +0200 Date: Mon, 4 Jun 2018 22:46:08 +0900 (JST) From: Julia Lawall X-X-Sender: jll@hadrien To: Dan Carpenter 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() In-Reply-To: <20180604134024.dmd7mn2wggqpmkcq@mwanda> Message-ID: References: <20180604115842.7c4vzge3igjbnblt@kili.mountain> <20180604134024.dmd7mn2wggqpmkcq@mwanda> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 4 Jun 2018, Dan Carpenter wrote: > 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. OK, maybe I can report these in the next few days. thanks, julia