From patchwork Mon Sep 11 09:00:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 112173 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp5468873pji; Mon, 11 Sep 2017 02:00:37 -0700 (PDT) X-Received: by 10.99.186.69 with SMTP id l5mr11013163pgu.160.1505120437569; Mon, 11 Sep 2017 02:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505120437; cv=none; d=google.com; s=arc-20160816; b=jDDW+y5rIsY7mv1+bmSdRUK+J9Dlkgs6hs/InojWjhKDr5cVtmnfK5pOHh7S1f337V sL9zugqSF68WPM62dUypmindeCZ83cBtYRcx+WzbIcTWPbowKeOnWNEBdZiC4t9hosIq 7/ShWhzfEqBNX7zjlNelpG7WEgQPH6fN1MKKcSy1jqu0j/PzoJXOnHrxW6iFA8l4Pr13 HvPXme78XmV2wdmqVBRlXFw7vUWNc6pfNAszMkYJvswFpALPu8n3zX5fFVM5SzICJS2W mC+9wOWoDnY5ab8Ij5zqlwMiM7yoCVtadbReCFtLsVJO6rG5KSHse+ZrY2TEsKheXyOl psNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Fl+JdvX0/Kiplt78R/cZRIKfpI5lQd8kRL4PAfOWyY8=; b=STODooQErGsJ2nayG9fqgXyoz5DqEV808tD8jd3zTIq7bCrMI5YuXh/ZomkKfuKBmm aQw7Oxqvmddk1xuSosWL7oZbiGbD76gWhIiiwl+dwOrlTYFPSK9Sw001E+KqRjYOgqS4 b+3i1uKGorm1n8FmcPzllJIzXNZKDgj3sUgPUvBFRZk7VXyEC1+mX7XnMotr002HswdN X4g680FbXDJUhX4QjmNidwdv5VBY5nVx9o0pZVQoxqZEIBpgWhV+jv8Z2EqAw5IIl+eB 2fqLMUy5iD7wQiIQbEAN4xdHC/LA88IDQfZwrKj8/my+rlZXIgAFMN7cu1B9xHKB2caO 52oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WwhbQtXk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h185si5832268pfb.398.2017.09.11.02.00.37; Mon, 11 Sep 2017 02:00:37 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=WwhbQtXk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357AbdIKJAd (ORCPT + 26 others); Mon, 11 Sep 2017 05:00:33 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:43705 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbdIKJA3 (ORCPT ); Mon, 11 Sep 2017 05:00:29 -0400 Received: by mail-it0-f43.google.com with SMTP id g142so10795647ita.0 for ; Mon, 11 Sep 2017 02:00:28 -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; bh=Fl+JdvX0/Kiplt78R/cZRIKfpI5lQd8kRL4PAfOWyY8=; b=WwhbQtXk1bZEvl5xccxK3ealFMnZhBklx3Tk7S0UFkDXUwMqrjAqEFHLLI8YGf5cU6 Fn1olxTs0XO4AO3swsbdIgtTb4oe2Xl+oJ/XXYpbHaLr/lqS2rVt+uFCHmw3pyGeuA5M GfG/qsH+Wt/JcjQVLrnxlqNpQolrX9hJXlv6I= 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; bh=Fl+JdvX0/Kiplt78R/cZRIKfpI5lQd8kRL4PAfOWyY8=; b=pwF5DNZ0lvP4llk/neSikA1W/ZF38d402Jh4o7vzxa+ggz4koYpyVUSv95Fn7m+cJb RQPxe+u9t4ng0HEsAUVXLhv2xZTsGCdsI/fGOuXQbEUULK+Dur28vHNau4iVHY9UtOuv EYQdCiR4ykCcU1gSjUsgGck3r7rv2HohPZkyAso2AKfzmLYZVI/nzz73LVKIawyxr/JX AK6LeYMnDm3ELUjjWkzTMiXdIn61Qhe6NKKGQ/u9Pxv2Qxn0fQT/MZfA+hlF2/eAkwvy 0Lj08kriXpsKZfuom4B4qh6z4XGhe1USxJRun/2UFpvNgEKZ3tejQs9NSPpAPPE7IVq3 MDDw== X-Gm-Message-State: AHPjjUjW0kBXE6OzCr39lIV0NcH0uG8g/YXXLYUKW6/9cshYQ8jPX3Dn ZI3xMJmSpQHOsRZe X-Google-Smtp-Source: AOwi7QCpd8Z1S7Ntr9ERLLPVKmMTm9yyE7dI2bkoQ8vHneo7/zctH3uPJLNzFGslh0dy6cxd9ynC6A== X-Received: by 10.36.61.15 with SMTP id n15mr11251054itn.117.1505120428324; Mon, 11 Sep 2017 02:00:28 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id a189sm4344146itd.21.2017.09.11.02.00.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Sep 2017 02:00:27 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Guy Shapiro , linux-api@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 1/4] nvmem: core: return EFBIG on out-of-range write Date: Mon, 11 Sep 2017 11:00:11 +0200 Message-Id: <20170911090014.16806-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> References: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guy Shapiro When writing data that exceeds the nvmem size to a nvmem sysfs file using the sh redirection operator >, the shell hangs, trying to write the out-of-range bytes endlessly. Fix the problem by returning EFBIG described in man 2 write. Similar change was done for binary sysfs files on commit 0936896056365349afa867c16e9f9100a6707cbf Signed-off-by: Guy Shapiro Cc: linux-api@vger.kernel.org Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.3 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index de54c7f..3866117 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -135,7 +135,7 @@ static ssize_t bin_attr_nvmem_write(struct file *filp, struct kobject *kobj, /* Stop the user from writing */ if (pos >= nvmem->size) - return 0; + return -EFBIG; if (count < nvmem->word_size) return -EINVAL; From patchwork Mon Sep 11 09:00:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 112176 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp5469656pji; Mon, 11 Sep 2017 02:01:13 -0700 (PDT) X-Received: by 10.84.151.68 with SMTP id i62mr1730013pli.179.1505120473226; Mon, 11 Sep 2017 02:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505120473; cv=none; d=google.com; s=arc-20160816; b=mGKb71Zu8eXRX2Yh7m3doTBHrKJGJH4DKxX7+S/V+mR25Y6bTRSn/Lfzw27+KTM8xQ vhbV92lA95eiCjQ4wA5H45v6pru3AdnUAiD2nrRnK1p6ehLkOwp7cruSle3KJjO5czWs 8rbqh0BBJBprjUSc8r/GxPzKs2tg2WduL2lXvJ21kVricYpBjYDkCLxEuycWlcqAzDPs Akr3FGt3URj2ohmTtVfvW4D2PRgndtAm1oG5XTYGCJxxHynMQwjy33wMRSOaOkYM/nAX YApC2KqJnoj5WrmmcQcxbjtpMo+vy7yEJX0lx1yBdc/L0YO5HqktCBd8IJca+djEiTac io5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=86AiQkvAb4NLdajpeEhLn0PXP6ldiWMTuAwIKkzkLok=; b=f5liaSI3gbYDP0Ya8OBTdVXpJvQ9bMSPdIumdVhwXjzhln5QY0VYjQ+usFVlFKtSEH D6k08GRQWiB8YYWF7SCb2IGc2/jIT94zTAaJIcICke3v02FlGK92sDAxQDmy7JGj6dLs coTVhx9GFEUn9ijmGnM+eg8lbZZIZ6ZbstGgHbtwrtdMwd2nF8O9WgsDqe69pmzDtmP/ vHQqdJSAbNCvd6G9temcgOT7IsJAwki7IJJ1dkDi1RlSrkAuOYVtyUipQ4q9nDpKLEB4 TrLdflGOd6iz7DXi3T4swZjBJdltf9Umg7vWaXPPj6a3xR6eWz3HACmfLgxFB59b7xBX pSZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hgMnFN8u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si6610616plb.777.2017.09.11.02.01.12; Mon, 11 Sep 2017 02:01:13 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=hgMnFN8u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdIKJBL (ORCPT + 26 others); Mon, 11 Sep 2017 05:01:11 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:36802 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbdIKJAa (ORCPT ); Mon, 11 Sep 2017 05:00:30 -0400 Received: by mail-io0-f169.google.com with SMTP id d16so21842252ioj.3 for ; Mon, 11 Sep 2017 02:00:30 -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; bh=86AiQkvAb4NLdajpeEhLn0PXP6ldiWMTuAwIKkzkLok=; b=hgMnFN8uGJO3yFh73uKH2RRWKIbE369Heymb2N8efh2dYtbDZhQANlBgU2ncQXCuGR tZTDk59sMaqz17KDSLXyVd4FtljAz0u0zNGCDNyap1khTVO+eAvmvT22kh/D7GkvnIIx Kwyj6DugaPGIa/bIUPTt+c2VHGN5Anz0clDwA= 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; bh=86AiQkvAb4NLdajpeEhLn0PXP6ldiWMTuAwIKkzkLok=; b=M2nm0yCAX0RcBzk6Y/WDRdEWYjcbS5uavttzSIxBIeBOx4v0hbomssj2bh9/RhIKUP nd4z3xewX252SDtwogDmJUcY5oTkdlrzNxNYNINEWRwpYMgcfyrYXvhrlsnWVxovCjyt wDY/WCBmGsX2KBxLip7w5V2brGgx79R9o4QZ5Wc6wExInj/Nef5k7oNxG4V/KbaxyBYP otaYDYsxztct2HFE+0M5kZeZT7XSZqE4xklwT2ONoprkG6ddydX5yUKap0rbgj0VfhSF tSWSu3csZ4CZDbhFd9ep6GeSnxxpn/TVX9sGBwuYxAQJ2UT5DFqAIyJdzWvwqb3j2sVB MpVw== X-Gm-Message-State: AHPjjUjKTQZO8eVIHv2eWyi+STDI9KJHF55MEbg3NzPopwMQ4ICd5TzM YGmZw8BjvD2uWWAC X-Google-Smtp-Source: AOwi7QCu9u5HtoEAxainvBPJAxqLwNRexM/jZ2bJS5CSqGAIPc+M404BQkjF/6WJCgLvUrQ5PsmkcQ== X-Received: by 10.107.139.215 with SMTP id n206mr14277662iod.155.1505120430207; Mon, 11 Sep 2017 02:00:30 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id a189sm4344146itd.21.2017.09.11.02.00.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Sep 2017 02:00:29 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Srinivas Kandagatla Subject: [PATCH 2/4] nvmem: add missing of_node_put() in of_nvmem_cell_get() Date: Mon, 11 Sep 2017 11:00:12 +0200 Message-Id: <20170911090014.16806-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> References: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada of_get_next_parent() increments the refcount of the returned node. It should be put when done. Signed-off-by: Masahiro Yamada Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.3 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 3866117..d12e5de 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -789,6 +789,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, return ERR_PTR(-EINVAL); nvmem = __nvmem_device_get(nvmem_np, NULL, NULL); + of_node_put(nvmem_np); if (IS_ERR(nvmem)) return ERR_CAST(nvmem); From patchwork Mon Sep 11 09:00:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 112175 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp5469318pji; Mon, 11 Sep 2017 02:00:56 -0700 (PDT) X-Received: by 10.98.93.25 with SMTP id r25mr11113408pfb.252.1505120456829; Mon, 11 Sep 2017 02:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505120456; cv=none; d=google.com; s=arc-20160816; b=IXn3tn1eHv+fGJZ2Jao1m8vLz0GPNZtpLjGyNPQN6x83JtZpvyVyB5MUXZLWeXSPaN zn9qgbfSnnYfrYSh6AoJUVUOV9mFN+bgTjqB1Pdkj7HUa09smir3m3TBt+BKHnQ5oYM7 GQghTx/lQ6L5ZyYVybnbYFUt6EJG0AUeZYgpci+zMsl05HllT2wbYAo6aOU4KqXl1xf/ 5dDIfrhLNhlCOMaauMIXvdh6tjOGRoZxCkfJxvECsE3smoXhGfpLphP1LT6gza3ajgeD xmPtqWmHmnJ0yjiDnKzPx8ftd3XZPqxExL7E3xcmPOQot8U6hzNbs/7x7v6ir8g9uwPU 8m+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JsIrqwtbQ5UGBeKZO13toUbeImf5wB1IC7MmX1v1/vM=; b=1KW5WCtoHdMiga0AYCDiM5YlE73KiIX0TZT8YkeWlLaBzkFZcJA7bx8zP4aD8X9a/2 JswVkRcw+VTwYtQO2WsIeJKE8FMCXML1+Buf9OQNMuzGNtsBrFz67NDs7ssi2rfSvPnt WIYUpnz5ALgYfrO5eilQ/KzyLp5B+fq7YifhJbALwPDmUg2nL5p4NF4vZwjlFyy5ZMYR TItWk6somcFik8T6cYLnHIHQuLJOUrExPWgmMpS/AICtLozD8LgOVfZ1dVR+JeN6WyQv 84s9ReB+R3W2SYCXcWGiEr1RWK4FN0C7BqspV9WYa6IpSzLd7QBrZGOgPejRS1UN+nmo k/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X1yxMBUY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si6610616plb.777.2017.09.11.02.00.56; Mon, 11 Sep 2017 02:00:56 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=X1yxMBUY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751419AbdIKJAy (ORCPT + 26 others); Mon, 11 Sep 2017 05:00:54 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:38838 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbdIKJAc (ORCPT ); Mon, 11 Sep 2017 05:00:32 -0400 Received: by mail-io0-f175.google.com with SMTP id n69so20689898ioi.5 for ; Mon, 11 Sep 2017 02:00:32 -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; bh=JsIrqwtbQ5UGBeKZO13toUbeImf5wB1IC7MmX1v1/vM=; b=X1yxMBUYus19oUdkFfjifrUcUiJVQeMZZClsQI1Jy3n+s8E1egoNZG2YY5xTqWPqs1 ufNIPc6yCcPgwPyWbYkYSyY+9oo6X+Fdcgzt+es6V6XnrjcIh/51w56vlCa9dEqa6w+x mxTTM+kc28gSjr3CyHA1IzLtF767H98BHSXaE= 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; bh=JsIrqwtbQ5UGBeKZO13toUbeImf5wB1IC7MmX1v1/vM=; b=f5eZ/YKHNkIoipeonZHRiIebVduhFoNtMV2bEe6S2NBjHVJRvXrjsqjCQnSX5clmSl M0T9pMkoPM5poYEpKX3HY7Okbwnmcd2c53gNlpJDQ+li8a/Plmn9L5TEO0fIfs4SDg5z TaBBrdhCg9AlPoUbI6V8R5bz2AbzHYiHljFZtqg061Esqd/rXeimghuYR5I5ob/IaoKX 45CEpRLIgTqTAVUMGFeX1r/62BqRge2yjFK/IU1mfjBzKoZF+71FCgsUVRKqeAYT18Bm eWAvywzXdm/0YA8LY05RyZqVaoKaQqC0XGIwU+T8W/EufVBGb+QcacGNwvakmyAv9xQu qjsw== X-Gm-Message-State: AHPjjUhiwf8z+avj3UDD13FUqAj/WYZvymdLdBKTyHS9nk6/jCy87KSO MCMhmPQB0MR0jdAi X-Google-Smtp-Source: AOwi7QD7mV+RZrt25PMjKfeOkroU6ujhrR6cYRG1N9ZWTu1g18YjARjSrcWkeP2l0Ms1oEykNCaKnQ== X-Received: by 10.107.81.1 with SMTP id f1mr6155065iob.17.1505120431780; Mon, 11 Sep 2017 02:00:31 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id a189sm4344146itd.21.2017.09.11.02.00.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Sep 2017 02:00:31 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Srinivas Kandagatla Subject: [PATCH 3/4] nvmem: remove inline in drivers/nvmem/core.c Date: Mon, 11 Sep 2017 11:00:13 +0200 Message-Id: <20170911090014.16806-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> References: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada These two functions are defined in .c file, but called just once (at least for now). So, the compiler will fold them into their callers even without the "inline" markers. However, this kind of optimization should not be done by hand. It is compiler's judge after all. Signed-off-by: Masahiro Yamada Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.9.3 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index d12e5de..fdb8b7a 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -946,8 +946,7 @@ void nvmem_cell_put(struct nvmem_cell *cell) } EXPORT_SYMBOL_GPL(nvmem_cell_put); -static inline void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell, - void *buf) +static void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell, void *buf) { u8 *p, *b; int i, bit_offset = cell->bit_offset; @@ -1028,8 +1027,8 @@ void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) } EXPORT_SYMBOL_GPL(nvmem_cell_read); -static inline void *nvmem_cell_prepare_write_buffer(struct nvmem_cell *cell, - u8 *_buf, int len) +static void *nvmem_cell_prepare_write_buffer(struct nvmem_cell *cell, + u8 *_buf, int len) { struct nvmem_device *nvmem = cell->nvmem; int i, rc, nbits, bit_offset = cell->bit_offset; From patchwork Mon Sep 11 09:00:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 112174 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp5468929pji; Mon, 11 Sep 2017 02:00:40 -0700 (PDT) X-Received: by 10.99.124.30 with SMTP id x30mr11455778pgc.52.1505120440189; Mon, 11 Sep 2017 02:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505120440; cv=none; d=google.com; s=arc-20160816; b=UHCDksd4F9UdiddLOz9MyklPyO7fnO7VPMZz4XaveZrwdbdhNCgFosZ+RERJv9gcu4 lT5nAz3Pzfsb50XLEt/hUevxnUpOutMzIdvgN1D1da30TxsAP/L3PhAmjFVk1o0Bhgdg mGfmv31OZ3QFPRnm+ZA5qayp3p/K9TscHMd5ydKFtLYZAEZQV4qYpW1icmvf6z05CU4w 9XuOLOQP/mcO8KpuhzKPzt1uJ4uhX0Iljg6QBQSz0DeJStIVWpg5xZUzbAvEEEPNfdQ9 krLkDhtEKeq8UVvXI+M3Sa1WI3aXB4y2bu17qjIYep7KQHsFrEr01/TD88g6tqGUaCRi 9QXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=HSNmuq0s8o7KuV9t6O8SmzD9pTOj4Wygq4Z4I9PNtMQ=; b=Vh4KsWEQZNAviy5Mt6KFEbJFlW1E7K8KgEXDSX1Z4xvusrKBSJGosMQNH8954vFZe7 z9pmBv4YaHCeE4gMC2uDAl6FZq3G5XtH+k/JhPnuWyHbxbIGFgrJDtknh5Nhx810cu/e c9044sJjQzJLTTR02Da/blu2CQTjwU9j2sKBZ5HCaT3DLiTyWM2nO5DkllficE7j9LHU xZgazXywZGyiiskDUH5XM8cNr51IryitkN1tOaregKVyVBJc4Vtkm2/AbZP/Kd7rfBV0 Voi071WsRELHbBUgAcqqS0UzTPHX0ljZ92wVPslcfAi9Uq3F5EeGhX0FtCmWlMOmZXjL Yxuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KBbsbgr6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h185si5832268pfb.398.2017.09.11.02.00.39; Mon, 11 Sep 2017 02:00:40 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=KBbsbgr6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751393AbdIKJAh (ORCPT + 26 others); Mon, 11 Sep 2017 05:00:37 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:36857 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbdIKJAe (ORCPT ); Mon, 11 Sep 2017 05:00:34 -0400 Received: by mail-io0-f172.google.com with SMTP id d16so21843353ioj.3 for ; Mon, 11 Sep 2017 02:00:34 -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; bh=HSNmuq0s8o7KuV9t6O8SmzD9pTOj4Wygq4Z4I9PNtMQ=; b=KBbsbgr6rRVGRaT0vkUzVADpP5Z9V3OCvbKvQwfDYx6ydMOVYgHp6mkvBXlVYHRQwP N5kDXquyXko1m0PTPAb/QKGBK9fgeJXh6RmUK6BiI96t4ZubLKYVdrMRK2iEJ1Y2hFng HGv1YrxH+zQLcEucf8U4fiWG8DTNHt6wJGBnc= 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; bh=HSNmuq0s8o7KuV9t6O8SmzD9pTOj4Wygq4Z4I9PNtMQ=; b=CFpUgIg8CdFcji4kW+8S9szX2waf1QvsoDi1Ka4lh5EYmlHXefddwyw/q8Qcbl+4EN wcFdjTfoQ3mdqn9gxXCwlEuvsNhMOo+Cc9OpTtwl9U+81zogdok3SZXeCnMSM9BXHO4R hJvaJMnr5Sc9G+pk5xTOildziV/4UiY2YT4rX+PsSV3Yxpa4tS3Fzc97hKYbngKwzISN YIe1AB7Bhg73I8d0wd+aJ4DiUYzYJXM2tzsyknW7j0gAmuONpG0GlLqW10r3I3VeUzE5 Q/e3NhuvrthxzHEGBQ6VDYRJuXXyxKPy+8vzihcD5RWOnWP2L3cKA7UNLYnRZ4+ACw+q jKsg== X-Gm-Message-State: AHPjjUhkdLIfTHUASW6vAaZP8YRNJsweTaid4pggMxdpz01XC7aCdbHo znnFQfbAIZpTLm+2 X-Google-Smtp-Source: AOwi7QCS67hFPINCKqvtvpnZJUmGnvpu0/DhNreXoi6ePQrf4e04Zryvcx9t9TLEiHzjB9ts/ReThg== X-Received: by 10.107.166.206 with SMTP id p197mr2860647ioe.63.1505120433787; Mon, 11 Sep 2017 02:00:33 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id a189sm4344146itd.21.2017.09.11.02.00.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Sep 2017 02:00:32 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Srinivas Kandagatla Subject: [PATCH 4/4] nvmem: remove unneeded IS_ENABLED(CONFIG_NVMEM) conditional Date: Mon, 11 Sep 2017 11:00:14 +0200 Message-Id: <20170911090014.16806-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> References: <20170911090014.16806-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada As you see in drivers/nvmem/Makefile, this C file is compiled only when CONFIG_NVMEM is y or m. So, IS_ENABLED(CONFIG_NVMEM) is always evaluated to 1 in this file. Signed-off-by: Masahiro Yamada Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.3 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index fdb8b7a..8649045 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -615,7 +615,7 @@ static struct nvmem_device *nvmem_find(const char *name) return to_nvmem_device(d); } -#if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF) +#if IS_ENABLED(CONFIG_OF) /** * of_nvmem_device_get() - Get nvmem device from a given id * @@ -753,7 +753,7 @@ static struct nvmem_cell *nvmem_cell_get_from_list(const char *cell_id) return cell; } -#if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF) +#if IS_ENABLED(CONFIG_OF) /** * of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id *