From patchwork Wed Sep 21 00:30:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9342637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9498760B16 for ; Wed, 21 Sep 2016 00:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85D3A29227 for ; Wed, 21 Sep 2016 00:31:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A0F929274; Wed, 21 Sep 2016 00:31:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BD6E29258 for ; Wed, 21 Sep 2016 00:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754683AbcIUAbC (ORCPT ); Tue, 20 Sep 2016 20:31:02 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36729 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754466AbcIUAbB (ORCPT ); Tue, 20 Sep 2016 20:31:01 -0400 Received: by mail-pf0-f194.google.com with SMTP id n24so1577629pfb.3 for ; Tue, 20 Sep 2016 17:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=2yWapqkzAGlJco3AK5hCJ9fJ3K4n7XrPhmvnX18q/F0=; b=d8ESZKF1BYchZnwc1IzyR12dljouEdmipo2fet4hL6tz2x8qQw9/ehIcUKPGqw1KDH DaGk2ymkvQ0vwVsQs5GFGWSysSKj+8XdkPoOOeU5Cs2Bz+VW06mkYfTtrZrSG5UB+J1d 1gRz9SQqIEearuOC8Uf9v8sVey2udVU8gxZxwksxrjflMIsUX3HF2MvQeR01uy+A4bcE 70i13jh1NCiJw0WJwU/7G73rFUX1Mb1M810KnfKG/QhbtfufjbYWErMnLEW1BmbRONWM P4rqg2WCdb7f0KoU8xQD7fFVAYHaxS4jicNgTTHbOVHy4MxV5w+4YuZPtv+RPQcPhfvf 1o9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2yWapqkzAGlJco3AK5hCJ9fJ3K4n7XrPhmvnX18q/F0=; b=DH1v8ok5/Ce68yqJkQqIQGdu5uIgtLAMrAwKIgbLAASp5qQkXVK4O1DLteq7+az6pX J2j6hckze85HBuSGqtAIrnvRyXYlTMwJ9ywef8kTp4YrKcWqiJAe19noN6r8N4q1GRNs whrx0R7sohPXbJ+zOOn+UtQOK+yXMW4ieqRgzhn+eVcv5Yh7eMCbp7ZC0s5v+q8n8hnY uxhub3z9xA3PYbungcRbny0FXvlfDcB1fS8UY/UkcFLzjw0ebbdnnHIE0wCImNdoCnUg IceEJI4qTQ/OGptEHpQl/2i3K/IqjXhSb17zcOUqyOBWsDoYuOf4LJefYI009ROARv44 w5Jg== X-Gm-Message-State: AE9vXwPkmUhGcMee/MRkK0XyJ71UJaDFR43ZRGMQcPcArgIMyqDvV27TM7U1hIEcYT9QPA== X-Received: by 10.98.82.200 with SMTP id g191mr46993460pfb.84.1474417860479; Tue, 20 Sep 2016 17:31:00 -0700 (PDT) Received: from localhost.localdomain (59-115-243-103.dynamic.hinet.net. [59.115.243.103]) by smtp.gmail.com with ESMTPSA id wr8sm41724070pab.44.2016.09.20.17.30.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Sep 2016 17:30:59 -0700 (PDT) From: Axel Lin To: "Rafael J . Wysocki" Cc: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Axel Lin Subject: [PATCH] PM / devfreq: exynos-ppmu: ppmu_events array should not be NULL terminated Date: Wed, 21 Sep 2016 08:30:40 +0800 Message-Id: <1474417840-7999-1-git-send-email-axel.lin@ingics.com> X-Mailer: git-send-email 2.7.4 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The rest of the code uses ARRAY_SIZE to count the number of entries in ppmu_events array. The NULL terminated entry makes ARRAY_SIZE return off-by-one value. Signed-off-by: Axel Lin Acked-by: Chanwoo Choi --- drivers/devfreq/event/exynos-ppmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index f55cf0e..c9ffaf0 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -90,8 +90,6 @@ struct __exynos_ppmu_events { PPMU_EVENT(d1-cpu), PPMU_EVENT(d1-general), PPMU_EVENT(d1-rt), - - { /* sentinel */ }, }; static int exynos_ppmu_find_ppmu_id(struct devfreq_event_dev *edev)