Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp473027lqo; Thu, 16 May 2024 11:22:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcPGqq5beaZsPM3k8HWdcIFcrinNr9+5gkh20D0tZ2qv5fQfxPiDLLiYBhFX7MMurX8UOv7A/hJGGu5bXc7N96/JjNI0er8EAje1Ojag== X-Google-Smtp-Source: AGHT+IF6xM3+TR0+RcdwcEqIYDym2tRMGn+pk0U3bkuJlKd/qha+bJouyvai7Qday3Zq0PGQKACG X-Received: by 2002:a25:2d07:0:b0:dc7:4b0a:589 with SMTP id 3f1490d57ef6-dee4f4bf2d8mr19356979276.55.1715883739442; Thu, 16 May 2024 11:22:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715883739; cv=pass; d=google.com; s=arc-20160816; b=qvQlqLBPozqUL72Ofcj0hUdLSQsdpBGqnVEINXbFhAxRN9X6ggFgjy8a+2LMxZnic9 h3d1zVXPvDJnFn/fvcpnygqENQ6ZMEiYXZ8X2ILgqbFeKhoWea+jIGcKjMx2xYE0kTgg X2xX0DvK4NTqK+ZfcCoSgtg/ZkBxd1a9B1VPNUXSNqUnAosiWXH6AIDHvcSn0I78VbJr PmFe9qVAyYdBm8dt7Fsa9QFqg20DrTpSep9FkLZ7obR4K9NZvuCYlYpGInNXEn8Mas40 DT/inpCpvFXAPm90f0KMwctaUrRfSJaEkWmUp4V4dxdv9Gc3UW46KMsO76djNVYXzEuo 5vow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4QzZpzonx2C/GWGQRLgt495aUpGk9FXO31kMVCNBj/A=; fh=r7jucx4EDwcx4QmKdJY/B/BWs7eG+xdxvoZ3FO/I2uA=; b=l6oHHNkJhbjV7AlNFo2NRzmmHYoBSME3LX+SEbOEsrRY/Xmj4lGva+lQbktAz2PjNf KbByEL/snMvl+vk8mlUAKQmgFuMbVq4JByVQbFWjmfjYs37dEsk4CXBxN3h7aDmNruaE C6xbWqDCls/9PIcQwXzh/akiAn9FHfZ8GyvilHyYFrkQ998uWmDV2oqiDRCRy6KWqPQ8 /W0qSpgMcRtjViKyvU9ePOcSf0GpdmUexO1WsUhTlRrpQnnyhyRwC1e/pAqd7Y+Zm43R Unhh2X+ac9eGt8CUpSM7tZThHrwqrHpRfV5DYamtJppU5mM9QotwlXKzP6mOcswgwQ0F 7Gdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=TcvnQkC4; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-181446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f30570bsi171267556d6.607.2024.05.16.11.22.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 11:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=TcvnQkC4; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-181446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 308821C20C10 for ; Thu, 16 May 2024 18:22:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B8F1158D79; Thu, 16 May 2024 18:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="TcvnQkC4" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 628051581F4; Thu, 16 May 2024 18:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715883576; cv=none; b=YKKd1o1+gqEgYq62UADrw0xNq+HZWo1C8/fhYiov7pqhLZsqPeb7dUanGBb9aYO8i+7gj052qFANqd3cF3FtEyYfSltQQcOqLDEQw6CNoCV8y4EOljIOGOK7eJB4/tKn9c4Yjt+67sZmkF3v1gQl8YBd+4tii6Q09MGZ9buxM1M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715883576; c=relaxed/simple; bh=gcQ2zkmKa+fmA+wA1USWs3UuxyNB+5m2pTe6OU5K/+s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iQFLNmWe6EqoUVRr7ChWiTRECkdr8EbDeEVilrHfHD7uo7tByC5g024CGyc7B7TjqqMraMzuB+B7JtRE0VWH7XQuBkZVpX6yAseu3B4iBn3AbsH9TkXjnrtJIpqGSpumeU+Y+djkjrWw/Ee/t6ACnUp4t7B6O6soZoTVGrsxKyo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=TcvnQkC4; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44GGGCUn016301; Thu, 16 May 2024 18:19:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=4QzZpzonx2C/GWGQRLgt495aUpGk9FXO31kMVCNBj/A=; b=TcvnQkC46AqLwhXr0vmmKLHDbtl7aiQ0m1MWoBdGhXcISifjSMQnlsnghw4vZFs0KYUR i/i0xjVO/8fOy1wfEwPE3xcUxWeYV7FTSXLbuLzu3GM8grVlKuuEP/KrWjvxzcZ8iEAh TjIr7QxWPXKP5QBsJ43JS31nvGQLuTqBCON/buH+Inq1Rz7bIYz4cBz+d2iwTLcLeqB1 f4a8O0KE1E6I3NG4DWSxmvhNNmqdZ63+9G7+yFq6iJJKKdnTg863UFi26QA+9fNny9vU eG1ZxQWzrNQ3Q5tLNvc5QNsQy+2cENkMnWmlMEtTWVVMeI0xcb6nMa1Y4HYQc05TK6Ek xg== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y5g6jh6u3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 18:19:16 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 44GFQLsL005986; Thu, 16 May 2024 18:19:15 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3y2mgmud31-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 18:19:15 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 44GIJD6X48431432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 May 2024 18:19:15 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45F2058086; Thu, 16 May 2024 18:19:13 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0837158078; Thu, 16 May 2024 18:19:13 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.107.19]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 16 May 2024 18:19:12 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, broonie@kernel.org, andi.shyti@kernel.org, joel@jms.id.au, alistair@popple.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, linux-aspeed@lists.ozlabs.org, eajames@linux.ibm.com Subject: [PATCH v3 19/40] fsi: aspeed: Only read result register for successful read Date: Thu, 16 May 2024 13:18:46 -0500 Message-Id: <20240516181907.3468796-20-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240516181907.3468796-1-eajames@linux.ibm.com> References: <20240516181907.3468796-1-eajames@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: dseMJk1nsvCJkqP5Ol27olpILNqvAdTi X-Proofpoint-GUID: dseMJk1nsvCJkqP5Ol27olpILNqvAdTi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-16_07,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 spamscore=0 phishscore=0 suspectscore=0 clxscore=1015 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405160132 No reason to read the result in the error path, and remove the null pointer check on the output, as it should never be null. Signed-off-by: Eddie James --- drivers/fsi/fsi-master-aspeed.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index f840c7c4a56b9..10ca23cf58c2e 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -181,8 +181,6 @@ static int __opb_read(struct fsi_master_aspeed *aspeed, uint32_t addr, writel(OPB0_XFER_ACK_EN, base + OPB_IRQ_STATUS); status = readl(base + OPB0_STATUS); - result = readl(base + OPB0_FSI_DATA_R); - /* Return error when poll timed out */ if (ret) { trace_fsi_master_aspeed_timeout(reg, status, true); @@ -193,21 +191,20 @@ static int __opb_read(struct fsi_master_aspeed *aspeed, uint32_t addr, if (status & STATUS_ERR_ACK) return -EIO; - if (out) { - switch (transfer_size) { - case XFER_BYTE: - *(u8 *)out = result; - break; - case XFER_HALFWORD: - *(u16 *)out = result; - break; - case XFER_FULLWORD: - *(u32 *)out = result; - break; - default: - return -EINVAL; - } + result = readl(base + OPB0_FSI_DATA_R); + switch (transfer_size) { + case XFER_BYTE: + *(u8 *)out = result; + break; + case XFER_HALFWORD: + *(u16 *)out = result; + break; + case XFER_FULLWORD: + *(u32 *)out = result; + break; + default: + return -EINVAL; } trace_fsi_master_aspeed_opb_xfer(addr, transfer_size + 1, result, true); -- 2.39.3