From patchwork Tue Apr 28 18:10:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11515353 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A830392C for ; Tue, 28 Apr 2020 18:11:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87D1E206A1 for ; Tue, 28 Apr 2020 18:11:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OJ/N3jVa"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="odBlKV08" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87D1E206A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rV9frYMB7mMs1igHxl60HwXVGemYhm7Akf2MVZYUWV8=; b=OJ/N3jVaLI3zTf aNOdvWVoAZyBnTSv7frpo2PAZgGG6pCzPkaaoIhIlRQ7IcqjnnBvVBXYcOpggoc8jv8mgnHvgo1Tt vJMBHNgMkcSEXn1KXfDEYEcWw06+e3FhBqunZ54NKmitCBKgU5uMetoKX+s8ogKNqLKH12tunS2nY 2coXLWWxonhiUMsypnbHo/zXeoJ/yTrscCUdDt+90s7LZs1LnXXxXrNXiqLeZK9k5bf3ztnhFHNDe HpVe9reCrBqT+MkHSU2vqAqIZ3RUW1XBfyIyEG4t5QFygSrIVQgquufrMmzX2Z2UPDsP+rF4OT845 9eFM5HFPKGsnM4dGkoWQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUh9-00066C-Gp; Tue, 28 Apr 2020 18:10:59 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTUgQ-0005cp-GK for linux-arm-kernel@lists.infradead.org; Tue, 28 Apr 2020 18:10:16 +0000 Received: by mail-pg1-x543.google.com with SMTP id r4so10762461pgg.4 for ; Tue, 28 Apr 2020 11:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=feeBoZmiNK+PqfmUZIUHdcZ4oBKPOjHptWecqjvhfI4=; b=odBlKV081b57bKb3sexaYhZ/qqcstSbg/s2iZYJthN7dEiR/vQ+YpQrlo3lkUvQWy3 MjiNjirFDo5mutK+0rE9HWjSjOD4HkEqLHDaGUt7AE2b3OBugG1Ww3EkGpdGis00LY6Q gjCU62klhAJN2mXBhEgl2s/FwKD1XU8iv0xLc= 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=feeBoZmiNK+PqfmUZIUHdcZ4oBKPOjHptWecqjvhfI4=; b=daSQdj3UiUTWkZ9K9j3aHbNFv+rDRqZj1JoA33JH/k3+KEm2yEAV9B0Mb+aBR67AaY LXYS3LHqehuLEukJcq1o9KRPkQ3rU0E0HEccrBDShFoZ+ncvryPaMC9ViCI55pMrZW0/ URd+ctYM2cddnMfHh7ik1/vEM+atDycSWlzXePKonK8a1wIlQiXBB7Ngx8rFKEN5hmJi 5TPFJ5k55wH/xUxHmMo9OHzXJah9M+jOIGPzQ3OEAd6Je/fPY2H7pGvSx1w2Z+voSng5 HEBtt23rs54G6ZrMXZWDAmbPs67X/CQCc11xibUGIckSyWp6eQK8mix2s3gWIDVOFIpW cKag== X-Gm-Message-State: AGi0Pub5vOlsIURBiKdYdK3Q1I4ddEGmOir1W/1AsyQKU6DT3RQjLzxL VbbxTHEw5uqi2CdbP5f4u/2iCw== X-Google-Smtp-Source: APiQypIL/096cicyoZjsKpAn19BhU3sgp026+T4Ap3M/8jcviaZEa8JyagUmCZZBtGmw0suU4VD5Xg== X-Received: by 2002:a63:3814:: with SMTP id f20mr27969431pga.283.1588097413701; Tue, 28 Apr 2020 11:10:13 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h197sm16260910pfe.208.2020.04.28.11.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 11:10:13 -0700 (PDT) From: Stephen Boyd To: Mathieu Poirier Subject: [PATCH v2 2/2] coresight: Avoid casting void pointers Date: Tue, 28 Apr 2020 11:10:10 -0700 Message-Id: <20200428181010.170568-3-swboyd@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200428181010.170568-1-swboyd@chromium.org> References: <20200428181010.170568-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200428_111014_544084_4DD22CE1 X-CRM114-Status: GOOD ( 12.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Mike Leach , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Suzuki K Poulose Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We don't need to cast void pointers, such as the amba_id data. Assign to a local variable to make the code prettier and also return NULL instead of 0 to make sparse happy. Cc: Suzuki K Poulose Cc: Mike Leach Reviewed-by: Joe Perches Signed-off-by: Stephen Boyd --- Thanks Joe for finding my thinko! drivers/hwtracing/coresight/coresight-priv.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index 5a36f0f50899..36c943ae94d5 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -215,9 +215,12 @@ cti_remove_assoc_from_csdev(struct coresight_device *csdev) {} /* extract the data value from a UCI structure given amba_id pointer. */ static inline void *coresight_get_uci_data(const struct amba_id *id) { - if (id->data) - return ((struct amba_cs_uci_id *)(id->data))->data; - return 0; + struct amba_cs_uci_id *uci_id = id->data; + + if (!uci_id) + return NULL; + + return uci_id->data; } void coresight_release_platform_data(struct coresight_device *csdev,