Received: by 10.223.148.5 with SMTP id 5csp7703764wrq; Thu, 18 Jan 2018 08:32:37 -0800 (PST) X-Google-Smtp-Source: ACJfBovQlA7yRU0ViOtPyzM4RntsNa4Dmh+PzXU4Bd+mkWJK6Dle9jisOFz1UOlTCTmRHdMGpoMt X-Received: by 10.101.90.129 with SMTP id c1mr37821026pgt.209.1516293156998; Thu, 18 Jan 2018 08:32:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516293156; cv=none; d=google.com; s=arc-20160816; b=YEDDH5G0kZg/ESXapAjM/U9M64RFQI1mfkFABFn8illNMoCDweejrNBOMRLH0n5Cla hrYUe/+pPHZveeeXj6ltZgk57/VYFYpQbLAd6zd5SXdg8+pIIAoYsm55gy9w2wQpuBlJ DF1zPxCsQSmd2xH2uzjDBxn1viOqQ0m2cFl32Fr1mqLbDS+zSaSfurPcecgNpemezBw+ c/TXhyMoL1JnvsjKZjDEqVtrwPkFGCO+BpB4/7XRUY5SPylMu5gx4p8J7hoWr6uzi2la fDo3cocfNHmWhtLrWJ6dBNZI524ElsZu0bmvxYFXnFy2c9Pg/EcgGhLoCWDmTaaLYO2R d/Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=X3EPHfcKmKdTWgoyU8WwNzuAC4+nI4cfLA+YTAOG1MQ=; b=lScJLtjOKidbzjWDTWIKSN5Tp7CGaw4+fIGD8pxU6hBIITM3w0T2owuFeusfr5ofG1 BY1YwHlBijgb7TgLVaHtI0QPJ8CBDiNdQ87JPER+XqOyCHoEYXX9jOVijPYzGXBOgh6S 5ckhh5JMs02Yd/pNndIV5+Rl57ltuHOkSUQL4/Xpd7hUNontz97bUYPriftQXdkSZhf6 t98JX7iA+ZnGQsNjB+yU+MIAsp/SNhH1YEJKq7vwCsXtn0yaBBDFGGHmk4Pi2Z9Iv1vj gUE04t+NbvKIbAjJL8KP9zbp6JRIcx3b1gappDYYiP5schreFYGh3B4r7iw4g/TRdcWu x3Dw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62-v6si15846ple.267.2018.01.18.08.32.22; Thu, 18 Jan 2018 08:32:36 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933502AbeARQYm (ORCPT + 99 others); Thu, 18 Jan 2018 11:24:42 -0500 Received: from mout.web.de ([212.227.17.11]:64895 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932219AbeARQYk (ORCPT ); Thu, 18 Jan 2018 11:24:40 -0500 Received: from [192.168.1.3] ([92.228.88.14]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M4I6Z-1euQSi1unD-00rsZb; Thu, 18 Jan 2018 17:24:31 +0100 Subject: [PATCH 2/5] irqchip/irq-gic-v2m: Improve a size determination in gicv2m_init_one() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Jason Cooper , Marc Zyngier , Thomas Gleixner Cc: LKML References: Message-ID: <10ededda-66a9-001c-4ad6-db5baa80b679@users.sourceforge.net> Date: Thu, 18 Jan 2018 17:24:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:N7KyEADiwNEXDeFHYIOHia3VMkfUWdSpyRM2pAJ/zUp5PRXjKBB ha2eSDAw/eKdKU/MBt/cCmtTZ4VR9ttsCwEc4tqWF58gJNAvGDuJ3zWWqYJk61iHadTIHe+ lcPbM5inawbjZnc0v2znlXtpru/PVwDHer1BzZ5p/IDjSAuQn1yglXmEZawCkvgLaAOjhpo autKpG3XzAukn8LZzclBQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:3HXH7/soqvU=:o5Rs1FDvEvzrT7xnW6xDrw xQAmQkEJPHQckbUMPZKXUnWT8faGrw/i1dFJ0V4Ae4/PTDsfoSCCNpPccYnh8cCAAEouqkenk twbMZ8ciKiSHed5OlTfP6t83GfJCcNorgLhvozDysIoIpcfaVl4klvkZ8hGEtOqtJfrIKkUfS SNfH5+QMNAh2N7W3MnJ0zlYwnQQB5KVMjtz/aUwg7CCGqSYA1iyoY6kA4L4elaFax/0Vuu1/g oH8faie1OZYW8eP5ivWomRXFI96pF7MPj0MlI7AlcjbUu7Shq7DNrXJcgtPAGQf/943Ty52gy 9yUWzoz0xrVPnCdNlgCTfpTlc+9nEz0UP2AXhbGX+PpkYjCGoPijGK5BSFVXYkDyMW+Se2kod ykenu8FGDuxNInz+L5MUQV9fSzzJ1wEMCELo93a2piJQSWflLbNYkkrkaD0/pOQtdwwqQB7M9 5NVfBmrYalBS682ZJetQ6NnB69ZeQZy0tetir+VZdatx1gsb0O0/fidgSYynQ2tv74hWAZc2B 9oIctc9ZXoSexVZZn8evQq+/TQhmRevxAelrJuyPLpcnYhoTzxhTeds4DpMd1Qhl2sTQZ5q1N LieDACygw/wMJBs0mPX4XBifLCnIueh+C0pThkN5liVyng7b9XjKs73bpiBG6dxqvir+XZvms fVkg7HjwxVkWEGxliQ0W8gP8hg4MiFnlDwyNTG71N+o3ylNnHw2m5HmsSfRJQ/bfk9vQkV9cK YwHB9JE+aKLkf0kCyR49UYXBfcW6I05idgb1hx3/OnbeG2zedV2z5l/1UISZTHONorp6aBZ3X o7sdmBugN1XoVV7KfwGWF9xxZ5LCTq0CFJOBBsxeXmQSiYGLzk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Thu, 18 Jan 2018 16:07:41 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/irqchip/irq-gic-v2m.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c index b795fefafb12..930261710ba2 100644 --- a/drivers/irqchip/irq-gic-v2m.c +++ b/drivers/irqchip/irq-gic-v2m.c @@ -306,9 +306,8 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode, struct resource *res) { int ret; - struct v2m_data *v2m; + struct v2m_data *v2m = kzalloc(sizeof(*v2m), GFP_KERNEL); - v2m = kzalloc(sizeof(struct v2m_data), GFP_KERNEL); if (!v2m) return -ENOMEM; -- 2.15.1