Thread (7 messages) 7 messages, 2 authors, 2015-10-04

[PATCH 2/4] nvmem: core: Handle shift bits in-place if cell->nbits is non-zero

flat view
STALE4025d

From: Srinivas Kandagatla <hidden>
Date: 2015-09-30 12:36:07
Also in: lkml
Subsystem: nvmem framework, the rest · Maintainers: Srinivas Kandagatla, Linus Torvalds

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v1
From: Axel Lin <redacted>

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 <redacted>
Signed-off-by: Srinivas Kandagatla <redacted>
---
 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;
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help