Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp392611pxj; Fri, 11 Jun 2021 01:40:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSQGqdOedoKkOipgbeE3YdDoNWEi1ePy+dYvOhCR3lD8454xzSm8hOA9pIoWntLZlR0sLH X-Received: by 2002:aa7:dc12:: with SMTP id b18mr2543676edu.52.1623400803797; Fri, 11 Jun 2021 01:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623400803; cv=none; d=google.com; s=arc-20160816; b=mFDioDP/PXYxVC3sLKSnyFSzhrmaG6Pkwho3h2ZgKuC7emFErhZTdn7rFcIuKu+IvI //omgA51NXTsvk1mZfOgkF1KvOOx+Re7zMLFuA0TYQGqZDR7YfS/kXb9uF9YDc01I/Tb geTyiCqw3RWbKP/wsRstMT8wANr4eAAzIK9f+kFs1TbMrNh5GByZMXQYkL9+6tHJW+we PpXEC4XKhDYkwSk0D7PUzFgkKLi00azOyE9SVHWIl+x5nUaQTFyPbwOGAV6A/RwKz8S8 TD+/5FcbgYb3i06dVALfj+N0+GilOj7mKY5sTGs6dloBkePH3o8JsGepPdNcUBfiVXRu N6hg== 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=gzvh2m9S9pj7XwIIPdU21NyMW1ruzueaF0VglYYhMsQ=; b=poK0Q+R2heYRY3nYmnq14ibwa3H7a9Z6629mZ9pQij2Q/nDliIr1RC9/XpfOC7vOee 3artOcep/llU47iVcpOHI1/2KjfyW2s7dLCBnzcHjRGcgBgUuDFGTyt4ymU8frFh5jP0 FCE4lDlDg/CggHHe7u3PVfrMx/QFCNpp3jzx0kGrvzg7ZqsC7Fjw0SrUcxlXCMhgQJSX 6WXLEM64Rq0lXpetZ2IkzkzDecqRzKrN8tFDcwFakUMInT1JlNcnx2t4SP4mod9a/BIC hH3Y14nQke1Ag/rizsrNjLdN0IJtj2hxtrbPQMqNop/fu+aV6xnqjlONf7BdshVZdM/2 1aUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lgh2+oH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 7si4073434ejk.640.2021.06.11.01.39.41; Fri, 11 Jun 2021 01:40:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lgh2+oH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231661AbhFKIhH (ORCPT + 99 others); Fri, 11 Jun 2021 04:37:07 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:43538 "EHLO mail-wr1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbhFKIg6 (ORCPT ); Fri, 11 Jun 2021 04:36:58 -0400 Received: by mail-wr1-f52.google.com with SMTP id r9so5098564wrz.10 for ; Fri, 11 Jun 2021 01:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gzvh2m9S9pj7XwIIPdU21NyMW1ruzueaF0VglYYhMsQ=; b=lgh2+oH7FaJwwRBiJ8A4mfwmPp4WOizOJf8xqUJk3mqictsCeQZLIOn4xWybDx+evw RvjTekLgzyXJkZTf+yHeaGctAoURuaXQcr+dHvJJwMCVAW2umjmejKG7a6NytItbJV+w h5pn+UH3jwIiwma85aYWcAjgEn4GFklEs6Y5CD3U/io9Vfiyccy/CrSEaR/gbfbLilL6 YDt6E6sRxl3bbkXDs5Z05kfwhxvYbn08sljzHwfIDatMsAKWdFMLY04+oW9U95GeY4m5 TF7sEmNOdL+Coojsm/YN3acmyeiMKSCV/qTdwkpMKSiiTQAMtyApwI8avQOYVryx7xbf ISmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gzvh2m9S9pj7XwIIPdU21NyMW1ruzueaF0VglYYhMsQ=; b=am7CMQyZulbALdUsTN5Q5EpzV92W2LaqK5oa+7xcHFSVnfdV6LPQAGYR2tbQRNiJG5 k8ZybjQg483wjPuIvlYqlc2pmUdcvcslDKBpFjXF+JCu6x2cwCVAkK2WtGbXw0u0J5Sz IpMIE60hr31szsGrNxc0r4i1BcG3FI2cFxoTrJvGaZAkXOlN0yKNKkgYqPzmZo5fSICY hUOhzKvnO5fo4Q1AMaNsqCGC75cdTFDPsKjxoXWwWXlsTj/ie44R0CpX5RGbcpqi+Ppy N8nuEvIUO2L3NdRAbN+JdVD4LLpXySxh3cR+NRQsebam4wOm2qjQdDTax7vVNgYFt5VW /MmA== X-Gm-Message-State: AOAM533AqIQj2uLsUc3R7BAHCJEf64SUhkOtlTpQ9JbIoBKFIomYuZ5C VS3r0EM+C2zW6lYt7Fdykod/mz7mjfBPUg== X-Received: by 2002:a05:6000:1b8d:: with SMTP id r13mr2671373wru.207.1623400440678; Fri, 11 Jun 2021 01:34:00 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id n42sm11547428wms.29.2021.06.11.01.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 01:34:00 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Srinivas Kandagatla Subject: [PATCH 8/9] nvmem: core: constify nvmem_cell_read_variable_common() return value Date: Fri, 11 Jun 2021 09:33:47 +0100 Message-Id: <20210611083348.20170-9-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210611083348.20170-1-srinivas.kandagatla@linaro.org> References: <20210611083348.20170-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Douglas Anderson The caller doesn't modify the memory pointed to by the pointer so it can be const. Suggested-by: Stephen Boyd Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index f9c9c9859919..4868aa876e1b 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1609,9 +1609,9 @@ int nvmem_cell_read_u64(struct device *dev, const char *cell_id, u64 *val) } EXPORT_SYMBOL_GPL(nvmem_cell_read_u64); -static void *nvmem_cell_read_variable_common(struct device *dev, - const char *cell_id, - size_t max_len, size_t *len) +static const void *nvmem_cell_read_variable_common(struct device *dev, + const char *cell_id, + size_t max_len, size_t *len) { struct nvmem_cell *cell; int nbits; @@ -1655,7 +1655,7 @@ int nvmem_cell_read_variable_le_u32(struct device *dev, const char *cell_id, u32 *val) { size_t len; - u8 *buf; + const u8 *buf; int i; buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len); @@ -1686,7 +1686,7 @@ int nvmem_cell_read_variable_le_u64(struct device *dev, const char *cell_id, u64 *val) { size_t len; - u8 *buf; + const u8 *buf; int i; buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len); -- 2.21.0