bbt.c (95d002e0a34cb0f238abb39987f9980f325d8332) | bbt.c (fd0d8d85f7230052e638a56d1bfea170c488e6bc) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2017 Free Electrons 4 * 5 * Authors: 6 * Boris Brezillon <boris.brezillon@free-electrons.com> 7 * Peter Pan <peterpandong@micron.com> 8 */ --- 109 unchanged lines hidden (view full) --- 118 119 pos[0] &= ~GENMASK(offs + bits_per_block - 1, offs); 120 pos[0] |= val << offs; 121 122 if (bits_per_block + offs > BITS_PER_LONG) { 123 unsigned int rbits = bits_per_block + offs - BITS_PER_LONG; 124 125 pos[1] &= ~GENMASK(rbits - 1, 0); | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2017 Free Electrons 4 * 5 * Authors: 6 * Boris Brezillon <boris.brezillon@free-electrons.com> 7 * Peter Pan <peterpandong@micron.com> 8 */ --- 109 unchanged lines hidden (view full) --- 118 119 pos[0] &= ~GENMASK(offs + bits_per_block - 1, offs); 120 pos[0] |= val << offs; 121 122 if (bits_per_block + offs > BITS_PER_LONG) { 123 unsigned int rbits = bits_per_block + offs - BITS_PER_LONG; 124 125 pos[1] &= ~GENMASK(rbits - 1, 0); |
126 pos[1] |= val >> rbits; | 126 pos[1] |= val >> (bits_per_block - rbits); |
127 } 128 129 return 0; 130} 131EXPORT_SYMBOL_GPL(nanddev_bbt_set_block_status); | 127 } 128 129 return 0; 130} 131EXPORT_SYMBOL_GPL(nanddev_bbt_set_block_status); |