From patchwork Wed Sep 30 12:35:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 54324 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 17BF722E23 for ; Wed, 30 Sep 2015 12:36:13 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf21747666wic.2 for ; Wed, 30 Sep 2015 05:36:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=piY5yQZDwgdvgk6G3V1r3M6FbOSRzMNzgwQb/ROih1M=; b=S2BPAq2SC3SrGy5BooqMg11vyXcr8Wjyv86ZMg55NYclWYGI3H5Z2tlqyKYUQf6rwL dsIORwBkB9xOpXX44HKBnkTEYcJz28Am7dEkhbRmJXJDEADdPDyzXBvHynFovCKJYL+S qJU7OiywLXT/3ILczSqcTZKunD5emC0V7jE8YSgD12Dy5poRTw4OCvgA/PrGfH+EorTJ 8uceLH0TedyDJP0tfr4bCEdMcvoQVjwJodUo+Wn7ZeHY1x+tRSGEdbvqrfF9GQiSN7eU cuZ71WlPnzSA6RHezBHikJYka8fGGhgQYrROfpcifaqTzJzzKAzBzMKbtSgUeqIzJAQZ AjAA== X-Gm-Message-State: ALoCoQlstOvWL/o5cxMK0lRe+LuIBTtQhwdRgezL8QzxfN/G/CfIqbA8Ye1KWYJ8Eo7rHnyAqjWm X-Received: by 10.180.12.170 with SMTP id z10mr614241wib.1.1443616572298; Wed, 30 Sep 2015 05:36:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.136 with SMTP id b8ls35621laa.85.gmail; Wed, 30 Sep 2015 05:36:12 -0700 (PDT) X-Received: by 10.25.153.147 with SMTP id b141mr727029lfe.59.1443616572105; Wed, 30 Sep 2015 05:36:12 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id th8si172964lbb.153.2015.09.30.05.36.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2015 05:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labzv5 with SMTP id zv5so44320773lab.1 for ; Wed, 30 Sep 2015 05:36:12 -0700 (PDT) X-Received: by 10.152.10.241 with SMTP id l17mr1107250lab.35.1443616571956; Wed, 30 Sep 2015 05:36:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2729163lbq; Wed, 30 Sep 2015 05:36:10 -0700 (PDT) X-Received: by 10.107.29.70 with SMTP id d67mr2222958iod.27.1443616570502; Wed, 30 Sep 2015 05:36:10 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o94si383003ioi.165.2015.09.30.05.36.09; Wed, 30 Sep 2015 05:36:10 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932502AbbI3MgH (ORCPT + 30 others); Wed, 30 Sep 2015 08:36:07 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:34852 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754547AbbI3MgF (ORCPT ); Wed, 30 Sep 2015 08:36:05 -0400 Received: by wicge5 with SMTP id ge5so194712918wic.0 for ; Wed, 30 Sep 2015 05:36:03 -0700 (PDT) X-Received: by 10.180.104.40 with SMTP id gb8mr31756322wib.17.1443616563783; Wed, 30 Sep 2015 05:36:03 -0700 (PDT) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id iw8sm461069wjb.5.2015.09.30.05.35.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Sep 2015 05:36:03 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, linux-arm-kernel@lists.infradead.org, Axel Lin Subject: [PATCH 2/4] nvmem: core: Handle shift bits in-place if cell->nbits is non-zero Date: Wed, 30 Sep 2015 13:35:15 +0100 Message-Id: <1443616515-17763-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443616298-17389-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1443616298-17389-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Axel Lin It's pointless to test (cell->bit_offset || cell->bit_offset). nvmem_shift_read_buffer_in_place() should be called when (cell->bit_offset || cell->nbits). Signed-off-by: Axel Lin Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index f4af8e5..676607c 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -825,7 +825,7 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem, return rc; /* shift bits in-place */ - if (cell->bit_offset || cell->bit_offset) + if (cell->bit_offset || cell->nbits) nvmem_shift_read_buffer_in_place(cell, buf); *len = cell->bytes;