From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web08.6275.1606308965349556193 for ; Wed, 25 Nov 2020 04:56:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=ysx5MYJW; spf=pass (domain: nuviainc.com, ip: 209.85.221.66, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f66.google.com with SMTP id s8so1806444wrw.10 for ; Wed, 25 Nov 2020 04:56:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lpL9lsmCbx+i3ctiZ8Pk83H+Zj9HGU+yvNwckvu35xM=; b=ysx5MYJWd1/1T8l4fAY+muk+XSrNdOc1HH0XWJV1HP5UzKY++ITu+2udpR04RZsgln cXieYePo9EzwmimT43xkED8qvTzOMt/Fu1nS4njhxnewN3rBkZ18Yrfcy1+IjT8wXzTI 7V2GDCYsaH4hy2SB7Vb7uR1eq4SODC0RpIFU3voHYlDuZcesEMCKiOqlYmN0oNY0SVgC qnFJbuWQ3tvsSBefQyOBDpPmWcY4GleVkg5bTv/ne4Q5oCyw8O/cO9MlJeBPD4TicPHy fogJIe7XgKhKomF5tRBk7btm6pHyCqpbhK5WRzIVyUPO/cyPjPod4h6XgDtigrjh4tZT SjOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lpL9lsmCbx+i3ctiZ8Pk83H+Zj9HGU+yvNwckvu35xM=; b=XyKvGLPSap5kE4C7uVISXgLlDrTTpB90LGVrOcRmmro7ajsGzr+qKuoYAcWMfywfps 761WWu7ihsRvo05vZ3vfmauM2EBLxOy5uQ1O2X4oMXZ0/SbNCHMvGnsNEmRKjTcst3Z8 Q3UPg9vlmyqtmPtzUeV1pA0LmJYWhG+13rod+hfLeEaRqFVDFc6xZuN+krkSY7tzFuTM Oe50fUhWE7biDxO7vLSKS5NhfwT7y5vxgeKeDTkWqsN1AT3EWO5IQwJEo5g5HeMhNrnW roH15ZLR1bIEGIOPVq6tvzgmXOcYTz4wrx1/DyLCRHKx0O6+CRAAAdgYBnIlwZYHirM0 QouQ== X-Gm-Message-State: AOAM531eXSw/68TD7a2HT5nLRvXw36YxQmfH5yQbXc/jN3A9PGaHe3sn NRcAT9K9t5BJrLtpbB5ae8zT/VNpG7nyr5RCzCEWUWk/m4G4HavR0JrYtrPvXw9J3jDkY+KRq9I A6qM/qrNXHkASYbfiUfpWB3aGHiYuqKC9f2pQpPSyE5Wxv6pJ2YliSs72fcltfnON0q6S X-Google-Smtp-Source: ABdhPJzkJtTtnGvjFIj5b6OLtjHUOCyXVzjWRhnsRC0UNjb8++xuXV7tqCd0roierXVHeTWYsqKnKA== X-Received: by 2002:adf:f8d2:: with SMTP id f18mr3817583wrq.379.1606308963738; Wed, 25 Nov 2020 04:56:03 -0800 (PST) Return-Path: Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id p9sm4942639wrw.29.2020.11.25.04.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 04:56:03 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [PATCH edk2-platforms 03/15] Platform,Silicon: fix beagleboard tautological compares Date: Wed, 25 Nov 2020 12:55:47 +0000 Message-Id: <20201125125559.11631-4-leif@nuviainc.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201125125559.11631-1-leif@nuviainc.com> References: <20201125125559.11631-1-leif@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fix two instances of masking a single bit and testing another. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm --- .../BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c | 2 +- Silicon/TexasInstruments/Omap35xxPkg/SmbusDxe/Smbus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Platform/BeagleBoard/BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c b/Platform/BeagleBoard/BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c index f3e0201a6f1f..e673afda6414 100644 --- a/Platform/BeagleBoard/BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c +++ b/Platform/BeagleBoard/BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c @@ -34,7 +34,7 @@ ResetCold ( { //Perform cold reset of the system. MmioOr32 (PRM_RSTCTRL, RST_DPLL3); - while ((MmioRead32(PRM_RSTST) & GLOBAL_COLD_RST) != 0x1); + while (!(MmioRead32(PRM_RSTST) & GLOBAL_COLD_RST)); } /** diff --git a/Silicon/TexasInstruments/Omap35xxPkg/SmbusDxe/Smbus.c b/Silicon/TexasInstruments/Omap35xxPkg/SmbusDxe/Smbus.c index 894ba3313cdf..a8b820e84800 100644 --- a/Silicon/TexasInstruments/Omap35xxPkg/SmbusDxe/Smbus.c +++ b/Silicon/TexasInstruments/Omap35xxPkg/SmbusDxe/Smbus.c @@ -28,7 +28,7 @@ WaitForBusBusy ( { UINTN Retry = 0; - while (++Retry < MAX_RETRY && (MmioRead16(I2C_STAT) & BB) == 0x1); + while (++Retry < MAX_RETRY && (MmioRead16(I2C_STAT) & BB)); if (Retry == MAX_RETRY) { return EFI_TIMEOUT; -- 2.20.1