Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3512211imm; Mon, 4 Jun 2018 05:00:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLLDvsmt6SC+u02wHLEcw3N/TaYDSvDptEJRCDZ37M0upTuyiOym7H2TXdQOzQTLUK8s9A/ X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr21407112plc.341.1528113617502; Mon, 04 Jun 2018 05:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528113617; cv=none; d=google.com; s=arc-20160816; b=VQjMG4nsFqQtkIGl+ZrHo6EXbFAyYS8apKxVhZW9tRcYL23v8F69gauew2j6bKNyGC bi83co03EAaJT11ruW23F55ypI5+nHnsWowsfAneRQFciWuGpH/sh2tBX5syLMk6DMUM ZE9uDZxNL/qwsUH2YUY+w+4gATZFJveT8yCBMuk1o6cHU/6J0CG1ddr7aSk1GMMe9J2W pj1gDXpRcibdqgMly4IavXJI0IIzIL5AgTFYwgvEVXqDmbSQ0v8PFIuL6bWkZMeXWM0W v/zrfBc279k37Y2xK8ismJJTwh/xdj2TYymQrDwETNoWiFDMGpOT88KBVZbjjAKvl5Oc fUMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=S36QaCVmRbDZSwf6DaJx8SXf5AP3doCUntZ2u0dW9go=; b=DxlTAbAoCXcNpTqOwCRBZE9USTUv964O83Oh+gfSsv7XOXfAh4oDhBfAEzuMMhQWlf kbn47iW9IfdmjRkuAgvnWXr2LHhvjeEBIE4e8tmz57Le3NXTiGzLpueduu1K6nrhRxN6 rCsnzRK7eVgHdrdVMS7BVjkNy5CPNErVXltnOq64kjonaYiMYd9rJMqS1Co+DDveEUTZ j3ngog9CMOemp7jCXm5DMrYTXtiR54Trk8ZyCHwzfpmLs6veSF9wGWPRThMeHQ88QFmE p8m+y/lqHHIdMn62BABPaGQMYfLYICcC/wCcImO5R5yGXOe5pbLaXDJvI3yJv781iYXw CdVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=f37V+Opk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8-v6si8711541pgc.182.2018.06.04.05.00.02; Mon, 04 Jun 2018 05:00:17 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=f37V+Opk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbeFDL7O (ORCPT + 99 others); Mon, 4 Jun 2018 07:59:14 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:55496 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752017AbeFDL7L (ORCPT ); Mon, 4 Jun 2018 07:59:11 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w54BtqjR128922; Mon, 4 Jun 2018 11:58:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=S36QaCVmRbDZSwf6DaJx8SXf5AP3doCUntZ2u0dW9go=; b=f37V+Opk5E4ILI2+5diP+Yd/uw24cawU72FJUArpSueLVZEgSpvCboJi1248/vCaNpYT j5DarFhToHEko1hrCaNjTCU7Qx03HVvWtiCCI2pu0pdZqs/AuYgsG/Fi9WjELRXOhP0x mZjKYDIT6Pizo+87WHAcMLrPlnMW+FBZNCaK2llZgODfJHCJJihC20qG2OcKizPOmi3h qCi2XRg1Lb0+YtYVVHub1Z4qyu31s+jB6n0cLsIjVJYqKBG9AqFu2Vn8Lpf4NbEwMckm nAnqs9iZ3Ukb8SbcV1clqzIJFvyIX9pWedYbGQmtPDXjNvmgShnnCmH6X/ZniZelgP9p mQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2jbvynu72u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jun 2018 11:58:54 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w54BwswN014210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Jun 2018 11:58:54 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w54Bwrcj008146; Mon, 4 Jun 2018 11:58:53 GMT Received: from kili.mountain (/41.202.241.46) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 04 Jun 2018 04:58:52 -0700 Date: Mon, 4 Jun 2018 14:58:42 +0300 From: Dan Carpenter To: Qiang Zhao Cc: Li Yang , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift() Message-ID: <20180604115842.7c4vzge3igjbnblt@kili.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8913 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=811 adultscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806040145 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. diff --git a/drivers/soc/fsl/qe/ucc.c b/drivers/soc/fsl/qe/ucc.c index c646d8713861..681f7d4b7724 100644 --- a/drivers/soc/fsl/qe/ucc.c +++ b/drivers/soc/fsl/qe/ucc.c @@ -626,7 +626,7 @@ static u32 ucc_get_tdm_sync_shift(enum comm_dir mode, u32 tdm_num) { u32 shift; - shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : RX_SYNC_SHIFT_BASE; + shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : TX_SYNC_SHIFT_BASE; shift -= tdm_num * 2; return shift;