nvram_64.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) nvram_64.c (b711531641038f3ff3723914f3d5ba79848d347e)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * c 2001 PPC 64 Team, IBM Corp
4 *
5 * /dev/nvram driver for PPC64
6 */
7
8#include <linux/types.h>

--- 840 unchanged lines hidden (view full) ---

849 static char nv_init_vals[16];
850 loff_t tmp_index;
851 long size = 0;
852 int rc;
853
854 BUILD_BUG_ON(NVRAM_BLOCK_LEN != 16);
855
856 /* Convert sizes from bytes to blocks */
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * c 2001 PPC 64 Team, IBM Corp
4 *
5 * /dev/nvram driver for PPC64
6 */
7
8#include <linux/types.h>

--- 840 unchanged lines hidden (view full) ---

849 static char nv_init_vals[16];
850 loff_t tmp_index;
851 long size = 0;
852 int rc;
853
854 BUILD_BUG_ON(NVRAM_BLOCK_LEN != 16);
855
856 /* Convert sizes from bytes to blocks */
857 req_size = _ALIGN_UP(req_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
858 min_size = _ALIGN_UP(min_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
857 req_size = ALIGN(req_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
858 min_size = ALIGN(min_size, NVRAM_BLOCK_LEN) / NVRAM_BLOCK_LEN;
859
860 /* If no minimum size specified, make it the same as the
861 * requested size
862 */
863 if (min_size == 0)
864 min_size = req_size;
865 if (min_size > req_size)
866 return -EINVAL;

--- 189 unchanged lines hidden ---
859
860 /* If no minimum size specified, make it the same as the
861 * requested size
862 */
863 if (min_size == 0)
864 min_size = req_size;
865 if (min_size > req_size)
866 return -EINVAL;

--- 189 unchanged lines hidden ---