From patchwork Mon Jun 16 11:23:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan R X-Patchwork-Id: 31938 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 717D820E7A for ; Mon, 16 Jun 2014 11:26:29 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rp16sf18013394pbb.5 for ; Mon, 16 Jun 2014 04:26:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=M4tXNi+aT7GmlGspYHNpm2hd8yXOm6pz5vOBB0Mvl4s=; b=OyfG0gc47WStvZqwCzz3BITDiA1G8ZRNvrs6CwvIFg5Iw3QeVdXMwv37JPmqPD+KPB OXBtNQUXObB7GEgae5MAhZbaWjLU/+k/ujBx/y+E5slLyN2zGXTNrotsHyZzviKb5n+6 iN/NLtNjx03RcXaPi9AkU45uDuTIvAiaSLr0c4XZiJ2IFC5dKoEZzYaKenPhWeUfhR7/ Fu9p0v1uYU0pQBTI2ypZ4KMNE6O57ULod/zc5eBcqHS7x3segN/StgH2FX0DfMAWyHeo IE5naRJt227farHpozcAdBi0z850HlR97BaSuYCIo+7dFHScaSbDaQYlMGzVS28ijSRf bkZw== X-Gm-Message-State: ALoCoQmmTGX4M4HkSd9NlNchiS0WVetHWRPMOnbb2YdqmKemYgAmYOVn+rcP++slT7aXZI+EsXQ1 X-Received: by 10.66.175.173 with SMTP id cb13mr322330pac.10.1402917988774; Mon, 16 Jun 2014 04:26:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.1 with SMTP id p1ls4330087qga.97.gmail; Mon, 16 Jun 2014 04:26:28 -0700 (PDT) X-Received: by 10.58.23.7 with SMTP id i7mr106570vef.57.1402917988657; Mon, 16 Jun 2014 04:26:28 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id g5si3984750vda.6.2014.06.16.04.26.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 04:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id ij19so4650848vcb.8 for ; Mon, 16 Jun 2014 04:26:28 -0700 (PDT) X-Received: by 10.58.122.138 with SMTP id ls10mr16345530veb.13.1402917988580; Mon, 16 Jun 2014 04:26:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp127281vcb; Mon, 16 Jun 2014 04:26:28 -0700 (PDT) X-Received: by 10.68.247.65 with SMTP id yc1mr23178910pbc.68.1402917987770; Mon, 16 Jun 2014 04:26:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kc2si10613800pbc.148.2014.06.16.04.26.27; Mon, 16 Jun 2014 04:26:27 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755357AbaFPL0U (ORCPT + 9 others); Mon, 16 Jun 2014 07:26:20 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:41710 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbaFPL0Q (ORCPT ); Mon, 16 Jun 2014 07:26:16 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5GBPiRt019130; Mon, 16 Jun 2014 06:25:44 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5GBPiYH025973; Mon, 16 Jun 2014 06:25:44 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 16 Jun 2014 06:25:44 -0500 Received: from uda0393807.india.ti.com. (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5GBOx44008965; Mon, 16 Jun 2014 06:25:40 -0500 From: Sricharan R To: , , , CC: , , , , , , , , Subject: [PATCH V3 07/16] irqchip: crossbar: fix sparse and checkpatch warnings Date: Mon, 16 Jun 2014 16:53:07 +0530 Message-ID: <1402917796-31574-8-git-send-email-r.sricharan@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402917796-31574-1-git-send-email-r.sricharan@ti.com> References: <1402917796-31574-1-git-send-email-r.sricharan@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: r.sricharan@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Nishanth Menon There is absolutely no need for crossbar driver to expose functions and variables into global namespace. So make them all static Also fix a couple of checkpatch warnings. Fixes sparse warnings: drivers/irqchip/irq-crossbar.c:129:29: warning: symbol 'routable_irq_domain_ops' was not declared. Should it be static? drivers/irqchip/irq-crossbar.c:261:12: warning: symbol 'irqcrossbar_init' was not declared. Should it be static? Checkpatch warnings: WARNING: Prefer kcalloc over kzalloc with multiply + cb->irq_map = kzalloc(max * sizeof(int), GFP_KERNEL); WARNING: Prefer kcalloc over kzalloc with multiply + cb->register_offsets = kzalloc(max * sizeof(int), GFP_KERNEL); Signed-off-by: Nishanth Menon Signed-off-by: Sricharan R --- [V3] Added checkpatch fixes as well to this. drivers/irqchip/irq-crossbar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index 42ea49d..2d7fbdb 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c @@ -15,6 +15,7 @@ #include #include #include +#include #define IRQ_FREE -1 #define IRQ_RESERVED -2 @@ -118,7 +119,7 @@ found: return 0; } -const struct irq_domain_ops routable_irq_domain_ops = { +static const struct irq_domain_ops routable_irq_domain_ops = { .map = crossbar_domain_map, .unmap = crossbar_domain_unmap, .xlate = crossbar_domain_xlate @@ -139,7 +140,7 @@ static int __init crossbar_of_init(struct device_node *node) goto err1; of_property_read_u32(node, "ti,max-irqs", &max); - cb->irq_map = kzalloc(max * sizeof(int), GFP_KERNEL); + cb->irq_map = kcalloc(max, sizeof(int), GFP_KERNEL); if (!cb->irq_map) goto err2; @@ -184,7 +185,7 @@ static int __init crossbar_of_init(struct device_node *node) } - cb->register_offsets = kzalloc(max * sizeof(int), GFP_KERNEL); + cb->register_offsets = kcalloc(max, sizeof(int), GFP_KERNEL); if (!cb->register_offsets) goto err3;