Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp741879rdb; Thu, 15 Feb 2024 14:11:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU9v7CbOYS56xKkz55ITUvFJeIKhll1IltaZ3BJ7T/Z9pYwZYY99wfCoAnxvigJQToYpk0vf6ymkxcBq/ggQRJEXDgGxPWowtcMqAQJ6A== X-Google-Smtp-Source: AGHT+IHmSWznpMEU6e6lsh+tZTAwjPxFOmDj6l9S0AJhYHd+urWIZ+sMA0PkbjmGU85vAlB5rmHP X-Received: by 2002:a05:620a:1723:b0:785:ca44:278a with SMTP id az35-20020a05620a172300b00785ca44278amr4042906qkb.58.1708035065026; Thu, 15 Feb 2024 14:11:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708035065; cv=pass; d=google.com; s=arc-20160816; b=dLnQE2g2Yubodr4AffSiVU6ZB+SeBiETbar9cu9NFTIwBaRht104N72R1GpKDxM5/O LrWRCePA8l7Q8CEzOQ6pcMbucQAL7pzqAEMmAQoLYP/YQLq+uXUhAJAIZpmptwb78FMI A+4VAue/GS/fe7K04Zc6yJraqzcMBVELbqNeFTpZDhINjXeKV8+2+M8D8vzJVy5FPR9i MzZiBxu2MankpUKKgfV5LYYCzvNfCHO7Sq1Knab1a0+XPrIyE2BtOLYFYXEg420mGbFA CFoiTmx/EknGb9h2+zLJr0UTAj40QsZpI9qoFTyFGzqvK+YCNBnguTMUS8aZQzzHz9gR CP/g== 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=sgsnboEv26LhiTyNfYfFAh+jxPvF4LGnhtlgk/oYHyI=; fh=Usz7XAB1EI7Q/DdLEXd449E1MLGpSzqdCCNe5XKh9R0=; b=Qq7jvFZRE9nPqG6OpA+jSn89qZrkd2c6jPlJtrZmakktpEYLHMimGMREdfw5UZxiQ9 tuNx+qqu+7lpzTPgveauFbgJMIU4cDM8dX2MKN7JKq+Wyc4tA//0doEC0dkGmltW5Izq BRKEoXu6DoHxzRRObeEKQS+tvY7M7/YAHUk8aX3qOuEgkiy3dcP6WQraHe49bfCb9W6p 9najt4XOZ3suFGIdX/l+Ug0y8HwrakAYpTTGRBnaCmSy1kDj4wuPD2Lnw7cWiU7OFyOB BSi7vtioA/D1kkXRe++++u+McNr/+myLpOqQNPOZjQEF0E2GXGPyCYANebzGmZxJoGB9 pWvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=DS7eEBFs; 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-67745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67745-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 c16-20020a05620a135000b007872f3ac1c3si2470843qkl.13.2024.02.15.14.11.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 14:11:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67745-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=DS7eEBFs; 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-67745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67745-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 C4AF21C20C80 for ; Thu, 15 Feb 2024 22:11:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3375148FE5; Thu, 15 Feb 2024 22:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="DS7eEBFs" 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 85B8F1468E5; Thu, 15 Feb 2024 22:08:26 +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=1708034908; cv=none; b=ty5rwp5ZXbsS+AmVsM9II1veseBx5SGlhz+PfHexOylS7gTHEHwYVJPqt9dj77tSrxfw+tRLxZIaLpHqUzw+Z+cBs2Z8LglfBlBRLx3pbzqisOeln0EFiQDJ/9C4CNGlhrMstSSC/7Omb2Mky/VkjS5vrBFJeVHIRriznSjYExc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708034908; c=relaxed/simple; bh=J/YFPtGFuZwFnq9P5eEqxyt+AdQR6C4+3VLiCYKWnjA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d3Aot4yF21BFmGk1sV2J5agrjsOlnik6qcNd1XjUZk7+6rdQgZnkZBatLMUXl1cIgARh17JR0oBTlYe3n0MqDZYQt6jEggj1V5PdWqksPwzeEtjEJErU4FUCzD+3ld41gWH8UuREEh7s+ZQIAN7u5KZ6R5vmXcF2rDoy5T5DFjM= 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=DS7eEBFs; 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 (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41FM0cQG018096; Thu, 15 Feb 2024 22:08:14 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=sgsnboEv26LhiTyNfYfFAh+jxPvF4LGnhtlgk/oYHyI=; b=DS7eEBFsS1WD9rDcLCYgPn8oSGulCVGF+NPI2Id+0v3231q5tembzTTH4eKKUB/q/ve3 eCQpONIlTdlXakHi4DVt0Ku085gzlhoedUvSIwKw+P5b75RsAl78Qrcd110oj9J/4/cb RSJX/edlXjDfrKjXffxcFcCigJtmgXoofB2jLFSVVZw6w/rHMdvorqZkeLB7CSMmWyDw MRDnS8skOrXrWoQXfTauAY+p44oLMRHFdCBR8q20UlmEdNi0qrAuUroXh9W4hTKchqRD cp0Yc/eVWxaw0faisK72/nYj4na4fPRWSswjCf436gPucyAYIzLrZ2AEukWx103atKwQ lQ== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w9u1bg6b0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 22:08:13 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41FLB5uj010083; Thu, 15 Feb 2024 22:08:12 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3w6npm781k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 22:08:12 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41FM8AJ545810374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 22:08:12 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B066D58081; Thu, 15 Feb 2024 22:08:08 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6683358061; Thu, 15 Feb 2024 22:08:08 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.14.18]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 15 Feb 2024 22:08:08 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, andi.shyti@kernel.org, eajames@linux.ibm.com, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, sboyd@kernel.org, mturquette@baylibre.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Subject: [PATCH 19/33] fsi: aspeed: Only read result register for successful read Date: Thu, 15 Feb 2024 16:07:45 -0600 Message-Id: <20240215220759.976998-20-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240215220759.976998-1-eajames@linux.ibm.com> References: <20240215220759.976998-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-GUID: r6Q28LyMcXJ1VHOef_sDs1gUTO3TLGow X-Proofpoint-ORIG-GUID: r6Q28LyMcXJ1VHOef_sDs1gUTO3TLGow X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_20,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 adultscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150171 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 64a5407a15ec..83f84ee6d6f4 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -175,8 +175,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); @@ -187,21 +185,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