From patchwork Thu May 13 13:27:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "liuqi (BA)" X-Patchwork-Id: 12255811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 615BCC43461 for ; Thu, 13 May 2021 13:31:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 15F3761438 for ; Thu, 13 May 2021 13:31:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15F3761438 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hAx+Loaim7hyXKWtmd/xYa/Xi6Xh6UFaKaycqE5PmgA=; b=eVtO12NDiPrqytUAk88y94nM0 lZlb7jH8cosCLpV/JYN+aPqCBcLZ3HCaw+HkLZ7ux6O6XQOcdw3x5k8cSIya8Ay3gtIfADJl4cVT4 ekW6amnPIGxbi2rRzE/haO9844igQvJEpTVjeaBAYAax7vSgqf7LJq+6+2uJwobCBoXc2ZlhS4KZ5 T3+q6ZLK7f4XRDc/qsm0TshCbny47uXhyu2klHuK8GvfaRuWM84VR//jDaUUE2bRjDn//2zh59wA8 QGyM33O1BD7kOu1bfiotn0chHAB5jn0StXXAurMNei+fNWZpJOlb3d1Zn5NDgAcp8vz6nv1AN0IDK zQxd23o7g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhBO0-005bhC-Pl; Thu, 13 May 2021 13:28:20 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhBNy-005bgs-5u for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 13:28:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qSk8EdDb1kcRrXdlXtdeQ8jEmZ0tZKCez1hedruhaUg=; b=3RU7fTGpc1Z/IqhSGaaQ1xWxel 57OYZ/KL3Pi+3BzhF5LIv3bcp746z03fFDNDZLb9Gg0bLlQ6PSCqMb8S/e9u5pGa3lpLQZB0S+7gK ELUE9AcpQBI+UlCJTMtPnN6xmRycyAHi6+cr4CqVq78GljQTV3e9NBrUPB9vmaf6CDN8uj5xnzy9H Cd3EmBbrnUQJWQsHOLD4au0cEY5QWoMIvKLrA8kTvSuuafgNVLTCLe+WPeL7WVBaUmPEbIopiXDwx rstqFJJ0jfmvmShRwtas2xm0T9rFemUNxBcgpHxDnvp71zQRRJXRUqlL9Ho0ukVP3SE13sItthMts G6lZQ7gA==; Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhBNu-00BGzu-DH for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 13:28:16 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fgspq0bGzzsRJ3; Thu, 13 May 2021 21:25:23 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Thu, 13 May 2021 21:27:53 +0800 From: Qi Liu To: , , CC: , , , Subject: [PATCH 1/3] coresight: core: Fix use of uninitialized pointer Date: Thu, 13 May 2021 21:27:47 +0800 Message-ID: <1620912469-52222-2-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> References: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_062814_630293_8F775B78 X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Junhao He Currently the pointer "sink" might be checked before initialized. Fix this by initializing this pointer. Signed-off-by: Junhao He Signed-off-by: Qi Liu --- drivers/hwtracing/coresight/coresight-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 6c68d34..4ddf3d2 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -608,7 +608,7 @@ static struct coresight_device * coresight_find_enabled_sink(struct coresight_device *csdev) { int i; - struct coresight_device *sink; + struct coresight_device *sink = NULL; if ((csdev->type == CORESIGHT_DEV_TYPE_SINK || csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) && From patchwork Thu May 13 13:27:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "liuqi (BA)" X-Patchwork-Id: 12255807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AE3BC433ED for ; Thu, 13 May 2021 13:31:06 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 065EF613B6 for ; Thu, 13 May 2021 13:31:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 065EF613B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OiBM7EEaY2pKW9K24eY2fzl2UyFew0/gpS1v6grqvLQ=; b=PIwB1B7zWGvJx25bj8g28qZpU xHL+Ez+rFAj/yXJDb1DWe1DSS5o9BzCnsX6Kv43IrPLRWKt6liuLS8xm3Yz1DN1rB4M/wakggE1A3 Qdg/QzPUeygntSZ8+sUfoUnmGioUnzDvp0AjiG+gFb12kNa74caiISYpZ4HFqIGzSX2D8wQ5G2Ceo dtFXOOuizyY2Rb0gttptkXJVkyd8FFrB708A4UHzWSFpAxpyRm80QXymTH5ENfAUaHIJNwv16MEkX LV7omHuS51SFpBKKQznE1Cyk04YnQN/JDb9qxPN5qMEA0/AmrHtud6vNdMQVvBFCj/fL1GGGoyQDH kl26m6/Wg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhBO9-005bhk-Uf; Thu, 13 May 2021 13:28:30 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhBNy-005bgh-5t for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 13:28:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pCquCGF0uwBmRr9NPYkXpwP08rWkvRYkvEKsvXoX1po=; b=nSmcaykMCdnrgshzb+25O3VxDB cAeMxita0hExutDfb7OdnAhyGGFOn37vrlMXlHawhyj7LMoWBiwh/MpvgsupEfdCK/y6dNKnWK89q Lg/HpEA9FQVQAKfzWQSiCSHjVdSBOYz4dUX10yMOHulQGb3jf+VVUqlOnSKSGkAWrWMagzZVhgwP3 ww1YCte0v0E0u5teqkEecMGANKQz/Bg9AD6EBCv/aqGZ9ying2bS/e6Ai/x1kDOb2oejhZSE0MjgW FmHKn+cvrhaG4NEjfBwWMxCVE1hcpmOoTOyxc1xtA7m7caf9a2wGhEvJfD0BM1TqQfGdCijFCGBbT RbhwcpWQ==; Received: from szxga04-in.huawei.com ([45.249.212.190]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhBNs-00BGzs-Pn for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 13:28:14 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Fgspq0x91z16P3H; Thu, 13 May 2021 21:25:23 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Thu, 13 May 2021 21:27:54 +0800 From: Qi Liu To: , , CC: , , , Subject: [PATCH 2/3] coresight: core: Remove unnecessary assignment Date: Thu, 13 May 2021 21:27:48 +0800 Message-ID: <1620912469-52222-3-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> References: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_062813_040202_0B49D29B X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Junhao He Remove unnecessary assignment of "path" in coresight_release_path(). Signed-off-by: Junhao He Signed-off-by: Qi Liu --- drivers/hwtracing/coresight/coresight-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 4ddf3d2..d75b19a 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -886,7 +886,6 @@ void coresight_release_path(struct list_head *path) } kfree(path); - path = NULL; } /* return true if the device is a suitable type for a default sink */ From patchwork Thu May 13 13:27:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "liuqi (BA)" X-Patchwork-Id: 12255809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48349C433B4 for ; Thu, 13 May 2021 13:31:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 EAA89613B6 for ; Thu, 13 May 2021 13:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAA89613B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fzDZh2DIVq1axkxmwHEqR5/C0qdlaOnA8AaIoc4aMqs=; b=LJwrWEnkmlgt4Aucnr6uLtIfw XehI03o/jktTfwpIyFOHclcuteLhC/5QRSPK/u5BhlR1pMoL49uWMtsotP/rZ05G41R4y3k1mtn8d TC813sPsOduAkOfCKPHFl+PZFEUJm+egWUme/DvW4uii62bCan71ECgnA5lzIi6SKWP27oa0q4CZ1 XLjfl4vf7IRSdGC14bv386OnY/n+LMquoV5eqXgCc+0w226iBJglG5u0lGm3TDPjhE+dgAnLYwhtT RnLBn/sp49jff2J7ILtgwd0D0lxEEAE44VXFejYgojp0komSrwkzcyt0gPimfgLVWzmnHxi/TMcwt Zdi7HQuBQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhBOI-005bhx-DQ; Thu, 13 May 2021 13:28:38 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhBNy-005bgr-5u for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 13:28:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=p5fBATYCllSM6F3/NMFgG+IQcmdGO9UEdSt5vczaSNs=; b=gaWSGmMoRW1QUVvH/UF7wBgbdu Vr2MfKDJW2+UyEgM2k0vVmtZQSaCi7CHOw8WAjti0uftukjuBeW2HkpOUbzwKp4UbPZOiW7r0qgyL tSGK7q9lpTTdcSVgTbLlAXAB/Md1m4fPH/39DfYMFjQV5m1t+L8Ijvu6Tjaqaq2WVEWXEQhbF6uBQ O4881aPAFoccxYhNDIdjZEaSciC1K+mKJEEN6+vHeIq2Wy1u3UJYvQdHZu1oKqu/oKRNxtPR/QR4Q gGfv+oV6TbJgEMJCgvKhvDw6C4S3AtxA9G4tf7sDIM8J5HVRbWYA4fJlAR61dNhEjaj22yg6mqeZy WXdHlESw==; Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhBNs-00BGzt-Un for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 13:28:16 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fgspq0J0RzsRJ0; Thu, 13 May 2021 21:25:23 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Thu, 13 May 2021 21:27:54 +0800 From: Qi Liu To: , , CC: , , , Subject: [PATCH 3/3] coresight: etm4x: core: Remove redundant check of attr Date: Thu, 13 May 2021 21:27:49 +0800 Message-ID: <1620912469-52222-4-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> References: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_062813_172501_BB2B210A X-CRM114-Status: UNSURE ( 9.37 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Junhao He "attr" is checked by perf framework, so remove the redundant check in etm4_parse_event_config(). Signed-off-by: Junhao He Signed-off-by: Qi Liu --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index db88199..da27cd4 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -568,11 +568,6 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata, struct etmv4_config *config = &drvdata->config; struct perf_event_attr *attr = &event->attr; - if (!attr) { - ret = -EINVAL; - goto out; - } - /* Clear configuration from previous run */ memset(config, 0, sizeof(struct etmv4_config));