From patchwork Thu Apr 25 19:52:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 162859 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2362096jan; Thu, 25 Apr 2019 12:53:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzY9R1ekh0EMbh/heo0qwShStq2p9NRCxdUGrhfJtEObCb1bM3oY3O+rBE3xpXq7vqFOzYj X-Received: by 2002:a17:902:f094:: with SMTP id go20mr41440579plb.159.1556222001090; Thu, 25 Apr 2019 12:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556222001; cv=none; d=google.com; s=arc-20160816; b=nGxm3r/rfpITsDwSnjnKuNBlVZoOZzuB8XnNnIRQH/5kX2m+DWcVIAVzF/iZ76IMkF qeZsfrgWLMAs1Qa8LkfvEQu/x/QdbjvNXYlzm73LUQ7ooNIet+1hGTIokapIac2g1wl3 ljEDj49GS5t5ettFaRLCEufIrruPCQSHV/ocRNgS7Vfl69duFt31FY54srz3kmxe5zux gvk9/RUPuq9UTH2pxcpcZnWZC+guqCJf/VIzN3tkfgX2COPV0mGViZOfQ+ssv6okD39G zAgf0G0M5AtJgOWESkMgSnTAG1fCwvuZOewI0+WQgwTwH9XkQ8W0Bzcb7HBEcmEJRXUa X9tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=yUNxZtf++bgU2RFogSdv+irhpIUzYqSjyRPAcofgUZU=; b=P+gD3adlMJMO3zbQmTUoCaqMEpRMxN9A3nGzsZkyt37CoWln39F0M/hChmLQp1pSoC IKXTB4g7CekWxLYJPORiNSuleeZAVBFB1TTCLqKesfK6D+pDj+qoUJJX05tBvI73nmDm sUg19sZtyadqr8hjj+X9jlItiYLmtumZxC9Uhph26xSGHDtmgP3T/8KPuydUCTEeowAD KN4Ml3hpZVAjRYlnvcVp4+YUQf++ctoKhBOM8PDydEmcDNghTM+Drv4JCKeozBVcKmm4 koLsHevJgi0qFnIYg+E7MlCs2TGKLmAZRR9574o/u/2nPJuGy+q2y6Ydl5eeoAZ2QaY3 pctQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hnak5X4E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si21183649pgr.253.2019.04.25.12.53.20; Thu, 25 Apr 2019 12:53:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hnak5X4E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387647AbfDYTxT (ORCPT + 30 others); Thu, 25 Apr 2019 15:53:19 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39688 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbfDYTxO (ORCPT ); Thu, 25 Apr 2019 15:53:14 -0400 Received: by mail-pg1-f196.google.com with SMTP id l18so363277pgj.6 for ; Thu, 25 Apr 2019 12:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yUNxZtf++bgU2RFogSdv+irhpIUzYqSjyRPAcofgUZU=; b=hnak5X4E/hZZbEFX99+vRgNXoePpmOAP923nVhGZ7MH9BwK2J14Eu3zuanxRnWdAOi lLvSLt3sFv8303VxkTXhJsyX+hR31R2JHb3aYUGiWZaF9+QuobQ/bPNEKFofNuk7CAuS l/a8BJCWVPsb21p6vIRXFkIBz1N4A1+VkhdkECnV8A0y1oEv9/PFFWNydd956Z43Tmlp H7ydOFfEy34NovHwiea7/qn26y73dtLTRsmcoO9AOWBg0FT0H4lXj+LXVEumgg0NgJod DZVHXhBeLaiIDiY3GHAFbMFjYPL82wgdvx6+uPKLJO6gPrhAybEeeXa6hX/wypQTvRPL vHLQ== 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; bh=yUNxZtf++bgU2RFogSdv+irhpIUzYqSjyRPAcofgUZU=; b=XGJgexlt0PTaCVdkaow+pRCWfBzBkAwn50rjIYt3VIS0ZegNYKzwZidRvrCaFLyUd4 Q462MDVeWaK95gXbtyHuvFfsiKa/XiIDxMwyqVNwbC480Ig1YM9LMRrLmqQjwMyRkadt bpp272alLinnYE1qZgC8n/e5+Og61M9XkDfrg9oXkzqbDI8g9HQRv6AsGA+jnBirF/xp azgsZpMey316Iocc72y4BdsLoNR/p29coZD/QcFOj7CFc61Z2lH2I2TNRkW/ySnRc/6i cz/T41lb/3/GiJ7RkmJBiFTHUd2Z9SFxJln12DczRnPV4oPVWqRudltmKOZ9//f/Bs16 ahaQ== X-Gm-Message-State: APjAAAVBFDzx2Y280pHVzSV0zSbzrHYP5+PQsPRmkklsxePOCqH3bD62 SsGH7hXwgxCq+BpHUtM7BgtcYQ== X-Received: by 2002:a65:6659:: with SMTP id z25mr38915123pgv.10.1556221993963; Thu, 25 Apr 2019 12:53:13 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id t64sm47261961pfa.86.2019.04.25.12.53.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 12:53:13 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/32] coresight: catu: fix clang build warning Date: Thu, 25 Apr 2019 13:52:39 -0600 Message-Id: <20190425195310.31562-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190425195310.31562-1-mathieu.poirier@linaro.org> References: <20190425195310.31562-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Clang points out a syntax error, as the etr_catu_buf_ops structure is declared 'static' before the type is known: In file included from drivers/hwtracing/coresight/coresight-tmc-etr.c:12: drivers/hwtracing/coresight/coresight-catu.h:116:40: warning: tentative definition of variable with internal linkage has incomplete non-array type 'const struct etr_buf_operations' [-Wtentative-definition-incomplete-type] static const struct etr_buf_operations etr_catu_buf_ops; ^ drivers/hwtracing/coresight/coresight-catu.h:116:21: note: forward declaration of 'struct etr_buf_operations' static const struct etr_buf_operations etr_catu_buf_ops; This seems worth fixing in the code, so replace pointer to the empty constant structure with a NULL pointer. We need an extra NULL pointer check here, but the result should be better object code otherwise, avoiding the silly empty structure. Fixes: 434d611cddef ("coresight: catu: Plug in CATU as a backend for ETR buffer") Signed-off-by: Arnd Bergmann Reviewed-by: Suzuki K Poulose [Fixed line over 80 characters] Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-catu.h | 5 ----- drivers/hwtracing/coresight/coresight-tmc-etr.c | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/hwtracing/coresight/coresight-catu.h b/drivers/hwtracing/coresight/coresight-catu.h index 1b281f0dcccc..1d2ad183fd92 100644 --- a/drivers/hwtracing/coresight/coresight-catu.h +++ b/drivers/hwtracing/coresight/coresight-catu.h @@ -109,11 +109,6 @@ static inline bool coresight_is_catu_device(struct coresight_device *csdev) return true; } -#ifdef CONFIG_CORESIGHT_CATU extern const struct etr_buf_operations etr_catu_buf_ops; -#else -/* Dummy declaration for the CATU ops */ -static const struct etr_buf_operations etr_catu_buf_ops; -#endif #endif diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index f684283890d3..cf7a32ce209d 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -772,7 +772,8 @@ static inline void tmc_etr_disable_catu(struct tmc_drvdata *drvdata) static const struct etr_buf_operations *etr_buf_ops[] = { [ETR_MODE_FLAT] = &etr_flat_buf_ops, [ETR_MODE_ETR_SG] = &etr_sg_buf_ops, - [ETR_MODE_CATU] = &etr_catu_buf_ops, + [ETR_MODE_CATU] = IS_ENABLED(CONFIG_CORESIGHT_CATU) + ? &etr_catu_buf_ops : NULL, }; static inline int tmc_etr_mode_alloc_buf(int mode, @@ -786,7 +787,7 @@ static inline int tmc_etr_mode_alloc_buf(int mode, case ETR_MODE_FLAT: case ETR_MODE_ETR_SG: case ETR_MODE_CATU: - if (etr_buf_ops[mode]->alloc) + if (etr_buf_ops[mode] && etr_buf_ops[mode]->alloc) rc = etr_buf_ops[mode]->alloc(drvdata, etr_buf, node, pages); if (!rc)