From patchwork Sat Oct 15 13:04:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 2936 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp634351wrs; Sat, 15 Oct 2022 06:10:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fGMWx+dTOomMB7u6uDD8hjtH9EsEJsjLnSNjygRP3yqYaUbKse1RRX6qsfPTIVB4KDXcH X-Received: by 2002:aa7:84c1:0:b0:563:d2c:c37c with SMTP id x1-20020aa784c1000000b005630d2cc37cmr2889721pfn.24.1665839426901; Sat, 15 Oct 2022 06:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665839426; cv=none; d=google.com; s=arc-20160816; b=Y1qeuM0puTnJAksZ7W9ExV46O9fPwPUJYpVvwqxU4psA9Y326+nqcb7rN2SnkfxykT 8e+gcAdH8l8vW3z013vNrTeH7aDT/opDcHS3mLe9zZr0y1+nZxlYpoQk5cZOYNcSwJxH 5yql/NPcYcfvT0P/viVcWKGrk81dR08/MGtKftHgwF244B6dxESjnYIo9jiWYLDvuO1c F/sA+DjPOzHtvMISmAa4rlYoYMlPuI7HJoD87zsmvfHEfDIkMdTbYYUoQxa8h+ntvnEZ PuqnJCkYtQReONWt614n1PnWwz07M8+0EleD2dWtX4zRZaLdGHqiHAxa2O/k+iub/nqt E2IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=M3YfUt++W8dDaqgtSWE1khIACcQPCyEYMQHXrvEQmhs=; b=D2uozKkQsG81xZogeNfbivkLS7vXoZwhXVBeqUQab71mGSkr9DEPah5GYmDHI+dreZ K0CRkzvaJUJ3kWug6DujTy4p1FIByV9sRSGVlNU+dbOJD49+1H2YkBxdo+YroAbwWXN1 o2+rHRqhMFmaI03eRuSZoQ0opsvIn4nfG0jQgOhk+3cN2KaOZOGLFs1La0gqFf+NIBFK ywBS95VWTjA6ngoMTfnPOnQVqWZX7+NpCHtQ0MC8SWV6cGB62RbtJ8ZtInoGaOisX0BN YnobHL9RH6jqRhyRDRtVaGzbjebhr7c+ocG30lFBZCcntJ7B7R33S81swcdo0khofdwi nrkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y4wbOjgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a056a00134900b00565eb80af7fsi5785972pfu.343.2022.10.15.06.10.14; Sat, 15 Oct 2022 06:10:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y4wbOjgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229769AbiJONEr (ORCPT + 99 others); Sat, 15 Oct 2022 09:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbiJONEo (ORCPT ); Sat, 15 Oct 2022 09:04:44 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C3413D64 for ; Sat, 15 Oct 2022 06:04:42 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id l14-20020a05600c1d0e00b003c6ecc94285so1393454wms.1 for ; Sat, 15 Oct 2022 06:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=M3YfUt++W8dDaqgtSWE1khIACcQPCyEYMQHXrvEQmhs=; b=Y4wbOjgx2lEWRAFVJ3dc7xv73XQApHAV+DYnGZ3iqL/BL4RdytNcTox/0ZvbdGiC0Z MTGU7zq3js0WGVaMIoB3g8iMnaYBUuz507VAFbttX8TVPaMjEwPclvCjsf4mF8fxZo94 J5ROzk0h+ykzWxTGS3ld6a06kDMuClfztt4hfdXpSheURLY7Pf/5UTVagqoy9AJj1iCp oPRSX3KKATin472tvlIHB9qGC2sPKF/OgAICsBpXZilaqZAzbzZGmLfqdQVG1hTGdsXk LaRGWd+4I1EZI4H15ZVj0UJhBuBKgpeU9k8L5YrSObzI6UaqolYZKIuzWtlEsreeHc1J 29cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M3YfUt++W8dDaqgtSWE1khIACcQPCyEYMQHXrvEQmhs=; b=er4SA41A3DwHSkeBY6jA6ptufnY+8SFVtPbOKAcr4Az5O0o+whu/tl0dlfonFKEw2C ShgbLAzRd7V9JAHxVVEfb9IB4sv9FLZiTRUi5bcnWpkvY7mkyAT4zURGQ7hJno9PP8Cu Zn8TXkoV4Ci0s8Y8aZZrma0r4K4j7DeD2vJJYDNMll+fvt9k2i+sgm1PQaCXbJfdYNvs LjDm9SONwaa8ZA9EsTvJwZj9R5Hz27JFe16vDjgpn/CJrJcUJAj0Z5abZZUG/fYOAQZO hiTo2P3FHvLjSMR9mTPrgXkWt4mdJcLVvs6mLk6W8NwSTin2uCBdp3sssLKZkoi6AbOs yZXw== X-Gm-Message-State: ACrzQf3aNPLm6lhHMGVQ8g9jGlm4kX0ysUzWGnd21M2knbBmtoCD0cWi 0zdp01aZ8UfJRiUbI+AqIJ0Tng== X-Received: by 2002:a05:600c:21c5:b0:3c6:ec59:5180 with SMTP id x5-20020a05600c21c500b003c6ec595180mr3717470wmj.130.1665839080533; Sat, 15 Oct 2022 06:04:40 -0700 (PDT) Received: from radium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id r12-20020adff10c000000b00225239d9265sm4151282wro.74.2022.10.15.06.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 06:04:40 -0700 (PDT) From: Fabien Parent To: ilia.lin@kernel.org, agross@kernel.org, andersson@kernel.org, rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Fabien Parent Subject: [PATCH v2 1/3] cpufreq: qcom: fix memory leak in error path Date: Sat, 15 Oct 2022 15:04:22 +0200 Message-Id: <20221015130424.1923706-1-fabien.parent@linaro.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746759099794084418?= X-GMAIL-MSGID: =?utf-8?q?1746759242756568101?= If for some reason the speedbin length is incorrect, then there is a memory leak in the error path because we never free the speedbin buffer. This commit fixes the error path to always free the speedbin buffer. Fixes: a8811ec764f9 ("cpufreq: qcom: Add support for krait based socs") Signed-off-by: Fabien Parent --- v2: Added missing "Fixes" tag drivers/cpufreq/qcom-cpufreq-nvmem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 863548f59c3e..3bd38acde4b9 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -213,6 +213,7 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, int speed = 0, pvs = 0, pvs_ver = 0; u8 *speedbin; size_t len; + int ret = 0; speedbin = nvmem_cell_read(speedbin_nvmem, &len); @@ -230,7 +231,8 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, break; default: dev_err(cpu_dev, "Unable to read nvmem data. Defaulting to 0!\n"); - return -ENODEV; + ret = -ENODEV; + goto len_error; } snprintf(*pvs_name, sizeof("speedXX-pvsXX-vXX"), "speed%d-pvs%d-v%d", @@ -238,8 +240,9 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, drv->versions = (1 << speed); +len_error: kfree(speedbin); - return 0; + return ret; } static const struct qcom_cpufreq_match_data match_data_kryo = { From patchwork Sat Oct 15 13:04:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 2937 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp634534wrs; Sat, 15 Oct 2022 06:10:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WY+oOVyVO006/ExQ5xKurqXOkc9LE8dIlUE12rRoY4HJR1cRifwLeLw1zjLJDt0W+EaEC X-Received: by 2002:a63:d241:0:b0:43c:474c:c6c6 with SMTP id t1-20020a63d241000000b0043c474cc6c6mr2505123pgi.523.1665839451894; Sat, 15 Oct 2022 06:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665839451; cv=none; d=google.com; s=arc-20160816; b=mpExZ1QXzg1mwEOXRDazv72NAdot67MC/UpjcKotaenz7mO2Ar/iPxzKnWLn8dqwOE hZ4B79p997aKlrdJ5ajGSRyx0Zgc8b+JV1+9uiVgwzZZKV3vhKVeA7VbvEW4vL6Ki7dX KLUMmtTDBCQngbafUuzwYc8jdBN52iJ2fzLJ6CrXVsCKwZTDSnTW52fGaGoO65Fz7UP3 HTB/NZwKHSCEGnOxwt2ceZMS1fTrx81W7R2H9NsswwMzeJ86ELl4V6SE8hQWGl8OGOhw P2WLyoACVHu5gN6SEMg1H/llappDoIDbAzcVwwzlIRciqE4pO00qif0xeFVj9i7jMFA+ 7ecg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v3o8F6Hzv4+9QpbVUjQpNY/Hm0jPjQUR08yEruJJQK4=; b=AG6jjVDx9MDM46mMCWwD2xaUMpaZJoD688aQ/NXuicK6bSJo1DUELkM9oe2gDJbI2P fimpOQVvqTOFeLHeezrHraOntT+zCm2ODC2wbMW+AwtAPMqM3SGLDBeBv1q7XIP2qxT0 NYPPN7+msA/pG0GrcqAJEmzGVwvBlIdDxGaE4+7aaVKtoVyiqjPe5D0fFTaE41cC38nj KdV0RrEYMwrmPsjy3o45QH/NQNw4J30vRPjFU3hy3kW/P9dOusIBW/BpsMoinBA03JkA F0XeRtEXnVK0ffZuxmTi0KMMJlOIgcicOd/uiMO8T1OkYaUKtjIMFN7vt5cOjygR+/23 fAlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OShDUJrY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v190-20020a6389c7000000b0046b30704f88si3289910pgd.5.2022.10.15.06.10.39; Sat, 15 Oct 2022 06:10:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OShDUJrY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229696AbiJONEu (ORCPT + 99 others); Sat, 15 Oct 2022 09:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbiJONEo (ORCPT ); Sat, 15 Oct 2022 09:04:44 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF7D13E23 for ; Sat, 15 Oct 2022 06:04:43 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id j7so11451983wrr.3 for ; Sat, 15 Oct 2022 06:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v3o8F6Hzv4+9QpbVUjQpNY/Hm0jPjQUR08yEruJJQK4=; b=OShDUJrY8x7Bxem/6fuook3QozFgTgEl8mMG4Okk1cfdPk7azgJuv4+IcnEgv6XHtw uKxUvazHxrkQIQYqYLerac0YhNXrKHmXlqwPQ1eGFfwLRYctRe47JyLrU8ZPMhdZ9X40 h4eOJsP4bGaRn86Jx4QRRIxxXsrRj5gPR2Xo6ag5d+1bjPflMp6jpipzvinWXUdp7UOS puOoeR8iszX+9KXCt/HQRdVdy6qVF2PNmtnWiJR09JzfG+LCJt0d57fNVaJw3O6fv2h8 7s96Y1LmG7fRYZ8522UGKBxS5OTQeFAFimm0jam2ZFvtZNg3q94XhwSVLKWHLYZJv7vU R0tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v3o8F6Hzv4+9QpbVUjQpNY/Hm0jPjQUR08yEruJJQK4=; b=WNGJ4Rvd3R925RBnOyiwz1AdfYCNT5Dx6BRn8WwZbimRoDdbydKIGJLsdFaCuscuNz aAt6fGCEwbNEqoh15aQadESecBFAN6AjMhA9EPJ47Q3QhdX0oZpWjgvLKnYoNN8VZ1Hm KCGhpIQ8nUoOJEOgAOYbjWmDANvKAJHsOXGQRlROxpjbiWypYzqbMTX0fcp3ub28VaqH s6zzyOdQtA9qfB19smt6rybhPKGPiD1C2JRp9Nt3O3jA/d1fpzN9BIZECHbGZapI/PGt fF8Hyfz3WhqbYJj3ijAnrBFcTRpDrpQ3hK1/a4gwiu8HfAvYoY+divd++OKCFFzBDtIW FALQ== X-Gm-Message-State: ACrzQf3ziBLp+66/Z5uJZn/SQzEjhLovz2SWvGsmpJ2JRPnyOOyNFpSG 0rn4JCGmjef6U/nBNjmy9b/odQ== X-Received: by 2002:a05:6000:144d:b0:231:5786:f763 with SMTP id v13-20020a056000144d00b002315786f763mr1441807wrx.313.1665839081533; Sat, 15 Oct 2022 06:04:41 -0700 (PDT) Received: from radium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id r12-20020adff10c000000b00225239d9265sm4151282wro.74.2022.10.15.06.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 06:04:41 -0700 (PDT) From: Fabien Parent To: ilia.lin@kernel.org, agross@kernel.org, andersson@kernel.org, rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Fabien Parent Subject: [PATCH v2 2/3] cpufreq: qcom: fix writes in read-only memory region Date: Sat, 15 Oct 2022 15:04:23 +0200 Message-Id: <20221015130424.1923706-2-fabien.parent@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221015130424.1923706-1-fabien.parent@linaro.org> References: <20221015130424.1923706-1-fabien.parent@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746759268995149832?= X-GMAIL-MSGID: =?utf-8?q?1746759268995149832?= This commit fixes a kernel oops because of a write in some read-only memory: [ 9.068287] Unable to handle kernel write to read-only memory at virtual address ffff800009240ad8 ..snip.. [ 9.138790] Internal error: Oops: 9600004f [#1] PREEMPT SMP ..snip.. [ 9.269161] Call trace: [ 9.276271] __memcpy+0x5c/0x230 [ 9.278531] snprintf+0x58/0x80 [ 9.282002] qcom_cpufreq_msm8939_name_version+0xb4/0x190 [ 9.284869] qcom_cpufreq_probe+0xc8/0x39c ..snip.. The following line defines a pointer that point to a char buffer stored in read-only memory: char *pvs_name = "speedXX-pvsXX-vXX"; This pointer is meant to hold a template "speedXX-pvsXX-vXX" where the XX values get overridden by the qcom_cpufreq_krait_name_version function. Since the template is actually stored in read-only memory, when the function executes the following call we get an oops: snprintf(*pvs_name, sizeof("speedXX-pvsXX-vXX"), "speed%d-pvs%d-v%d", speed, pvs, pvs_ver); To fix this issue, we instead store the template name onto the stack by using the following syntax: char pvs_name_buffer[] = "speedXX-pvsXX-vXX"; Because the `pvs_name` needs to be able to be assigned to NULL, the template buffer is stored in the pvs_name_buffer and not under the pvs_name variable. Fixes: a8811ec764f9 ("cpufreq: qcom: Add support for krait based socs") Signed-off-by: Fabien Parent --- v2: * Added missing "Fixes" tag * Rebased to not depend on another non-bug fix patch drivers/cpufreq/qcom-cpufreq-nvmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 3bd38acde4b9..82e0339d7722 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -265,7 +265,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) struct nvmem_cell *speedbin_nvmem; struct device_node *np; struct device *cpu_dev; - char *pvs_name = "speedXX-pvsXX-vXX"; + char pvs_name_buffer[] = "speedXX-pvsXX-vXX"; + char *pvs_name = pvs_name_buffer; unsigned cpu; const struct of_device_id *match; int ret; From patchwork Sat Oct 15 13:04:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 2938 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp634671wrs; Sat, 15 Oct 2022 06:11:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5aRzkaXoRCkwP2wM5T344IMVRYmnDyck6cnYE7ZYCj0TttkZqHT6Ls5HrpI7jJAuNe7OHs X-Received: by 2002:a05:6a00:32cb:b0:563:2d3b:5c8d with SMTP id cl11-20020a056a0032cb00b005632d3b5c8dmr3031426pfb.85.1665839470828; Sat, 15 Oct 2022 06:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665839470; cv=none; d=google.com; s=arc-20160816; b=NwcfcqkmLUZraYAHB9mniQIQ+tHLguJjvrbiKpiKFdg7EpWpAMnqUJH8uzGIbbrOfB OBDu/EepMa6tmi+gYRnuVXAETla5+TXr8pfw8QzuqA/aPmW88T39NLCkYj8+jMnAZ4bQ HVdJ7AwxUYv+o4nnzJ+5i7q32+t2jQJyh2zXUTkXkfp4G5kKFkbFPsybq1HC04/DQ4FL D0ElVfE48WZSxTzc7vBSMVN1OQUQog+2m4bzzI/IIQj8Q1AoLIQWHC3PLwGXpjFcKwlo oer0FfceAzW1ghaKu1rLRob6iRKonLX5oLG9AhTBenlqoIP/3H8PSx/MRQwhI1hvWU3W uHtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vmXoNNLDLDLD0P7pKCj+BHy21pHCA1aEV+oXYAOW2vk=; b=mV1Vlqc6de8J9rgmpIpcM+rmqGbG2izeKCUVdVT+saJtoSYPmgPRR+sJRHxyqyxnpk jBIXyfwzYozmOh3xpPEjpf/GH3xYOC19aMWRw1pNZjQlQzgVebcIHr53QzLFaZ5tRsCZ PSRKd7HMtB/nCeO4g6lpzD7tVoDJjr/yis04xBZTARnHVHR9itBUV9fJwtjndnptdEek idPHx3OifuJGsC5GqHFUmHND8IvN/BqhzitiCypkFi8bujH5kwT7gXfFbQeYiUFw0yFm fGMq+CFlyzJF39skj8558D/W77uWg/b9bT6mxuUB3BZKtmMoGoiLi3Uj4TuNl6AhVlVR Mp7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KD1l/z5J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020a170902ea8600b001853ad3944dsi5735376plb.480.2022.10.15.06.10.57; Sat, 15 Oct 2022 06:11:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KD1l/z5J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229811AbiJONE5 (ORCPT + 99 others); Sat, 15 Oct 2022 09:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbiJONEp (ORCPT ); Sat, 15 Oct 2022 09:04:45 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45D8D15A1A for ; Sat, 15 Oct 2022 06:04:44 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id az22-20020a05600c601600b003c6b72797fdso5698059wmb.5 for ; Sat, 15 Oct 2022 06:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vmXoNNLDLDLD0P7pKCj+BHy21pHCA1aEV+oXYAOW2vk=; b=KD1l/z5JxEtz6VLtNyfLQRz5xjiZkc3OHsZofFSBtslzVUOZsPgvt54LTkB4AcV/Co 7FnwYPJZxbnr/X3zoZcyV6GfZsbe1YZW88yyP/8uo064uQOH2NFMgXpiUCSTvNP5Iauf huN/oS9EO3pzWUQszcvZ1MODVNLMifR6DnN9AbluASxv1LMFA2wCxHp1taXME2PZYK6g Tf9SPdrLDzB74Adtj1pzy4IdnTp0DdJqc4MwuBzvoV6e6Jy8pFfnZFL4MGDD6sKRNtXi ofEmwPH7vhWHtAUTB63a9HnIkY8owgyWpvLxLw22djEpRsvqE1MzoMenTxAp1XqflmrX Yo2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vmXoNNLDLDLD0P7pKCj+BHy21pHCA1aEV+oXYAOW2vk=; b=2FtYT1pBLk54UrdXOGGCKd9E0aDAhmRNJokjHdUhYPt6Lr+QKEL6P2Da/+lFmM7EgQ 62zWicG9rxwrCrndkWGOYZ+YGGoiLWatsYE2DmTzSW/A5qIdaMDsWzWdXFLqrufOnW9e HqYcq97Jand+muGzkQnOHUiBjRi1k2l92ONaHfcpz9XhiAnTK8TLCCBGZ6c67CAGgMb/ dTDNTF/Lyv3EK3D574ZpzxgVqm7Cea9T8Op25eQpJVwwHDZDgOAgcy7cPWKwQs+JzciL 20zlugjpzq0cVFzsi6HUMwVrasa4IzyJxi9RyBlpQP9X6if9ANJM83YOp9y/ajg0mSwW ItUQ== X-Gm-Message-State: ACrzQf1QBkxsjTGJ1/QjxyckekiYq0P4/eUWwSjaMMiYunhmA+kPBN1R tCUCjitnYomcvd+lVKrmvJEA3Q== X-Received: by 2002:a05:600c:3844:b0:3b4:becc:e43 with SMTP id s4-20020a05600c384400b003b4becc0e43mr13653476wmr.33.1665839082742; Sat, 15 Oct 2022 06:04:42 -0700 (PDT) Received: from radium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id r12-20020adff10c000000b00225239d9265sm4151282wro.74.2022.10.15.06.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 06:04:42 -0700 (PDT) From: Fabien Parent To: ilia.lin@kernel.org, agross@kernel.org, andersson@kernel.org, rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Fabien Parent Subject: [PATCH v2 3/3] cpufreq: qcom: remove unused parameter in function definition Date: Sat, 15 Oct 2022 15:04:24 +0200 Message-Id: <20221015130424.1923706-3-fabien.parent@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221015130424.1923706-1-fabien.parent@linaro.org> References: <20221015130424.1923706-1-fabien.parent@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746759288788723338?= X-GMAIL-MSGID: =?utf-8?q?1746759288788723338?= The speedbin_nvmem parameter is not used for get_krait_bin_format_{a,b}. Let's remove the parameter to make the code cleaner. Signed-off-by: Fabien Parent --- V2: New patch drivers/cpufreq/qcom-cpufreq-nvmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 82e0339d7722..a154f03666fd 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -64,7 +64,7 @@ static struct platform_device *cpufreq_dt_pdev, *cpufreq_pdev; static void get_krait_bin_format_a(struct device *cpu_dev, int *speed, int *pvs, int *pvs_ver, - struct nvmem_cell *pvs_nvmem, u8 *buf) + u8 *buf) { u32 pte_efuse; @@ -95,7 +95,7 @@ static void get_krait_bin_format_a(struct device *cpu_dev, static void get_krait_bin_format_b(struct device *cpu_dev, int *speed, int *pvs, int *pvs_ver, - struct nvmem_cell *pvs_nvmem, u8 *buf) + u8 *buf) { u32 pte_efuse, redundant_sel; @@ -223,11 +223,11 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, switch (len) { case 4: get_krait_bin_format_a(cpu_dev, &speed, &pvs, &pvs_ver, - speedbin_nvmem, speedbin); + speedbin); break; case 8: get_krait_bin_format_b(cpu_dev, &speed, &pvs, &pvs_ver, - speedbin_nvmem, speedbin); + speedbin); break; default: dev_err(cpu_dev, "Unable to read nvmem data. Defaulting to 0!\n");