From patchwork Wed Aug 16 20:19:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Stitt X-Patchwork-Id: 714287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E0ACC41513 for ; Wed, 16 Aug 2023 20:20:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244350AbjHPUTn (ORCPT ); Wed, 16 Aug 2023 16:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346102AbjHPUTX (ORCPT ); Wed, 16 Aug 2023 16:19:23 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F40F1BF7 for ; Wed, 16 Aug 2023 13:19:22 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-589cc9f7506so67157567b3.2 for ; Wed, 16 Aug 2023 13:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1692217161; x=1692821961; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=3wsWTylhhPdG3/T8LNZoJaxLDgLi/vqIDceWVK88NME=; b=Ht3ZRd1ImNrc2iTkzCJ5Fql3ljWCB2/SIVSsRNPxYYsUGod5lhvmeTUN5m3FrjuquK yL/RgT2BZliIqrkqCktYGQQQcjCncJNHHINboxuRqGGFWxbtQ1YDCAEtEKwrmFE4ZBHP UFxkKjPiw6Qij5Ai7S4lvAOmHBP0MUy6fAM+SSZwI/F5Z1pCqWikJh4O7NUr7IxN2+7V dC2jUXD03hBSxm5SCpr2+nuPq9ZM3WVjvxqaJCnHxvtyEduJvTqlMNLMf6Dt7hNGzZxV OObllt001yGEJEjG4sYLTOL+Q2yr8czIGVcvpF7v5/YIvcUWt2l8KuK7e8rBtnrhKKZG fv/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692217161; x=1692821961; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3wsWTylhhPdG3/T8LNZoJaxLDgLi/vqIDceWVK88NME=; b=FVWMzoT46Vf7RUX7FnZdYX9EecTv+KBgoloNpvvQZzpkRCwd4NyzX9J+pewixNS/6y FMr/oThW8RfC9gBUDKN6H5RdXOx+SzJZu45xryiiDU1ta7Uk9DZT2TCnWP/jrst1PdC+ GPSLuvWR48NzeDnRPVgXqWoC5NAzLxTSqRY6H/6LDtjV6IjEoOICyACfDPj40LSWCPhp /JC0jaAOM+vjZiOWKIRsSqLJ5mJMfGyBWPPQdk+sSggADgG5RN1JESvroCDz1TftY98u 2Gr0PcdNImFPMrRcx0Wpur9ndUCqVNnFJsBehqbNLar1mO5GWV9yP91cItc9dXm7rXjG QyvQ== X-Gm-Message-State: AOJu0YwssVJuLl82mioa1+QO2chfoNGTgfrUBhVXqoqPsq1r55EdPNq7 GZZwPhOeTgR63sVyT7ZtbpVmii8fjurVKImGiA== X-Google-Smtp-Source: AGHT+IF1NY2O9E+AcCVUc6YmSnFStWnAWmT+ayAT17Q7KEQNdNUBTRt8h9InsGVkNddn7kVhEA8MaXYUcc13W2aRUA== X-Received: from jstitt-linux1.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:23b5]) (user=justinstitt job=sendgmr) by 2002:a81:4407:0:b0:58c:b45f:3e94 with SMTP id r7-20020a814407000000b0058cb45f3e94mr37282ywa.8.1692217161433; Wed, 16 Aug 2023 13:19:21 -0700 (PDT) Date: Wed, 16 Aug 2023 20:19:06 +0000 Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIADkv3WQC/x3NSw7CMAxF0a1UHmMpCVX5bAUxqMgLeEASbIiKq u6diOGZ3LuSQQVG52ElRROTkjv8bqDbY853sMRuCi7s3dFP3IpEjioNahzRkuLFaMhvxvLNxbj W54encY7ehfF0SIF6rCqSLP/R5bptPwOrzAp4AAAA X-Developer-Key: i=justinstitt@google.com; a=ed25519; pk=tC3hNkJQTpNX/gLKxTNQKDmiQl6QjBNCGKJINqAdJsE= X-Developer-Signature: v=1; a=ed25519-sha256; t=1692217160; l=1505; i=justinstitt@google.com; s=20230717; h=from:subject:message-id; bh=3i09RUBjajBo5aL6e0TrKmXYq85q23Jzin6ZTPYdgyY=; b=S4oTPqidmSx4pnXekqz3cAvXwTPXkBzQ1EIFWu9hSsoThdtp9eduwMFBcm4W1kNzVJZvIyFio YGlmbwClC6pBWurTU/dRHGUj2NmAVzjjY0yT3dMx3QDNiHt27E7UCjd X-Mailer: b4 0.12.3 Message-ID: <20230816-void-drivers-devfreq-event-exynos-ppmu-v1-1-3fac11083742@google.com> Subject: [PATCH] PM / devfreq: exynos-ppmu: fix clang -Wvoid-pointer-to-enum-cast warning From: Justin Stitt To: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Justin Stitt Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org When building with clang 18 I see the following warning: | drivers/devfreq/event/exynos-ppmu.c:530:21: warning: cast to smaller | integer type 'enum exynos_ppmu_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] | 530 | info->ppmu_type = (enum exynos_ppmu_type)of_id->data; This is due to the fact that `of_id->data` is a void* while `enum exynos_ppmu_type` has the size of an int. Cast `of_id->data` to a uintptr_t to silence the above warning for clang builds using W=1 Link: https://github.com/ClangBuiltLinux/linux/issues/1910 Reported-by: Nathan Chancellor Signed-off-by: Justin Stitt --- drivers/devfreq/event/exynos-ppmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421 change-id: 20230816-void-drivers-devfreq-event-exynos-ppmu-64ad102497f2 Best regards, -- Justin Stitt diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index 896a6cc93b00..f798e1d6994d 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -527,7 +527,7 @@ static int of_get_devfreq_events(struct device_node *np, of_id = of_match_device(exynos_ppmu_id_match, dev); if (of_id) - info->ppmu_type = (enum exynos_ppmu_type)of_id->data; + info->ppmu_type = (uintptr_t)of_id->data; else { of_node_put(events_np); return -EINVAL;