| /kernel/linux/linux-5.10/ipc/ |
| D | msgutil.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 42 #define DATALEN_MSG ((size_t)PAGE_SIZE-sizeof(struct msg_msg)) 43 #define DATALEN_SEG ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg)) 46 static struct msg_msg *alloc_msg(size_t len) in alloc_msg() argument 52 alen = min(len, DATALEN_MSG); in alloc_msg() 57 msg->next = NULL; in alloc_msg() 58 msg->security = NULL; in alloc_msg() 60 len -= alen; in alloc_msg() 61 pseg = &msg->next; in alloc_msg() 62 while (len > 0) { in alloc_msg() [all …]
|
| /kernel/linux/linux-6.6/ipc/ |
| D | msgutil.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 42 #define DATALEN_MSG ((size_t)PAGE_SIZE-sizeof(struct msg_msg)) 43 #define DATALEN_SEG ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg)) 46 static struct msg_msg *alloc_msg(size_t len) in alloc_msg() argument 52 alen = min(len, DATALEN_MSG); in alloc_msg() 57 msg->next = NULL; in alloc_msg() 58 msg->security = NULL; in alloc_msg() 60 len -= alen; in alloc_msg() 61 pseg = &msg->next; in alloc_msg() 62 while (len > 0) { in alloc_msg() [all …]
|
| /kernel/linux/linux-6.6/include/linux/ |
| D | minmax.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 11 * min()/max()/clamp() macros must accomplish three things: 13 * - Avoid multiple evaluations of the arguments (so side-effects like 14 * "x++" happen only once) when non-constant. 15 * - Retain result as a constant expressions when called with only 18 * - Perform signed v unsigned type-checking (to generate compile 20 * - Unsigned char/short are always promoted to signed int and can be 22 * - Unsigned arguments can be compared against non-negative signed constants. 23 * - Comparison of a signed argument against an unsigned constant fails 34 /* True for a non-negative signed int constant */ [all …]
|
| /kernel/linux/linux-6.6/lib/zlib_inflate/ |
| D | inftrees.c | 1 /* inftrees.c -- generate Huffman trees for efficient decoding 2 * Copyright (C) 1995-2005 Mark Adler 13 The code lengths are lens[0..codes-1]. The result starts at *table, 14 whose indices are 0..2^bits-1. work is a writable array of at least 17 -1 is an invalid code, and +1 means that ENOUGH isn't enough. table 26 unsigned len; /* a code's length in bits */ in zlib_inflate_table() local 28 unsigned min, max; /* minimum and maximum code lengths */ in zlib_inflate_table() local 31 unsigned drop; /* code bits to drop for sub-table */ in zlib_inflate_table() 63 code lengths are lens[0..codes-1]. Each length corresponds to the in zlib_inflate_table() 64 symbols 0..codes-1. The Huffman code is generated by first sorting the in zlib_inflate_table() [all …]
|
| /kernel/linux/linux-5.10/lib/zlib_inflate/ |
| D | inftrees.c | 1 /* inftrees.c -- generate Huffman trees for efficient decoding 2 * Copyright (C) 1995-2005 Mark Adler 13 The code lengths are lens[0..codes-1]. The result starts at *table, 14 whose indices are 0..2^bits-1. work is a writable array of at least 17 -1 is an invalid code, and +1 means that ENOUGH isn't enough. table 26 unsigned len; /* a code's length in bits */ in zlib_inflate_table() local 28 unsigned min, max; /* minimum and maximum code lengths */ in zlib_inflate_table() local 31 unsigned drop; /* code bits to drop for sub-table */ in zlib_inflate_table() 63 code lengths are lens[0..codes-1]. Each length corresponds to the in zlib_inflate_table() 64 symbols 0..codes-1. The Huffman code is generated by first sorting the in zlib_inflate_table() [all …]
|
| /kernel/linux/linux-5.10/tools/power/cpupower/lib/ |
| D | cpufreq.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * (C) 2004-2009 Dominik Brodowski <linux@dominikbrodowski.de> 37 const char *value, size_t len) in sysfs_cpufreq_write_file() argument 47 if (fd == -1) in sysfs_cpufreq_write_file() 50 numwrite = write(fd, value, len); in sysfs_cpufreq_write_file() 91 unsigned int len; in sysfs_cpufreq_get_one_value() local 98 len = sysfs_cpufreq_read_file(cpu, cpufreq_value_files[which], in sysfs_cpufreq_get_one_value() 101 if (len == 0) in sysfs_cpufreq_get_one_value() 131 unsigned int len; in sysfs_cpufreq_get_one_string() local 136 len = sysfs_cpufreq_read_file(cpu, cpufreq_string_files[which], in sysfs_cpufreq_get_one_string() [all …]
|
| /kernel/linux/linux-6.6/tools/power/cpupower/lib/ |
| D | cpufreq.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * (C) 2004-2009 Dominik Brodowski <linux@dominikbrodowski.de> 37 const char *value, size_t len) in sysfs_cpufreq_write_file() argument 47 if (fd == -1) in sysfs_cpufreq_write_file() 50 numwrite = write(fd, value, len); in sysfs_cpufreq_write_file() 92 unsigned int len; in cpufreq_get_sysfs_value_from_table() local 99 len = sysfs_cpufreq_read_file(cpu, table[index], linebuf, in cpufreq_get_sysfs_value_from_table() 102 if (len == 0) in cpufreq_get_sysfs_value_from_table() 140 unsigned int len; in sysfs_cpufreq_get_one_string() local 145 len = sysfs_cpufreq_read_file(cpu, cpufreq_string_files[which], in sysfs_cpufreq_get_one_string() [all …]
|
| /kernel/linux/linux-6.6/lib/ |
| D | nlattr.c | 1 // SPDX-License-Identifier: GPL-2.0 60 static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, 72 return -EINVAL; in validate_nla_bitfield32() 75 if (bf->selector & ~valid_flags_mask) in validate_nla_bitfield32() 76 return -EINVAL; in validate_nla_bitfield32() 79 if (bf->value & ~valid_flags_mask) in validate_nla_bitfield32() 80 return -EINVAL; in validate_nla_bitfield32() 83 if (bf->value & ~bf->selector) in validate_nla_bitfield32() 84 return -EINVAL; in validate_nla_bitfield32() 89 static int nla_validate_array(const struct nlattr *head, int len, int maxtype, in nla_validate_array() argument [all …]
|
| D | iov_iter.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 #include <linux/fault-inject-usercopy.h> 18 #define iterate_buf(i, n, base, len, off, __p, STEP) { \ argument 20 len = n; \ 21 base = __p + i->iov_offset; \ 22 len -= (STEP); \ 23 i->iov_offset += len; \ 24 n = len; \ 28 #define iterate_iovec(i, n, base, len, off, __p, STEP) { \ argument 30 size_t skip = i->iov_offset; \ [all …]
|
| /kernel/linux/linux-5.10/lib/ |
| D | nlattr.c | 1 // SPDX-License-Identifier: GPL-2.0 56 static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, 68 return -EINVAL; in validate_nla_bitfield32() 71 if (bf->selector & ~valid_flags_mask) in validate_nla_bitfield32() 72 return -EINVAL; in validate_nla_bitfield32() 75 if (bf->value & ~valid_flags_mask) in validate_nla_bitfield32() 76 return -EINVAL; in validate_nla_bitfield32() 79 if (bf->value & ~bf->selector) in validate_nla_bitfield32() 80 return -EINVAL; in validate_nla_bitfield32() 85 static int nla_validate_array(const struct nlattr *head, int len, int maxtype, in nla_validate_array() argument [all …]
|
| /kernel/linux/linux-6.6/fs/xfs/libxfs/ |
| D | xfs_types.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. 48 if (agno >= mp->m_sb.sb_agcount) in xfs_verify_fsbno() 61 xfs_fsblock_t len) in xfs_verify_fsbext() argument 63 if (fsbno + len <= fsbno) in xfs_verify_fsbext() 69 if (!xfs_verify_fsbno(mp, fsbno + len - 1)) in xfs_verify_fsbext() 73 XFS_FSB_TO_AGNO(mp, fsbno + len - 1); in xfs_verify_fsbext() 105 if (agno >= mp->m_sb.sb_agcount) in xfs_verify_ino() 118 return ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || in xfs_internal_inum() 120 xfs_is_quota_inode(&mp->m_sb, ino)); in xfs_internal_inum() [all …]
|
| /kernel/linux/linux-5.10/fs/unicode/ |
| D | utf8-core.c | 1 /* SPDX-License-Identifier: GPL-2.0 */ 15 const struct utf8data *data = utf8nfdi(um->version); in utf8_validate() 17 if (utf8nlen(data, str->name, str->len) < 0) in utf8_validate() 18 return -1; in utf8_validate() 26 const struct utf8data *data = utf8nfdi(um->version); in utf8_strncmp() 30 if (utf8ncursor(&cur1, data, s1->name, s1->len) < 0) in utf8_strncmp() 31 return -EINVAL; in utf8_strncmp() 33 if (utf8ncursor(&cur2, data, s2->name, s2->len) < 0) in utf8_strncmp() 34 return -EINVAL; in utf8_strncmp() 41 return -EINVAL; in utf8_strncmp() [all …]
|
| /kernel/linux/linux-6.6/drivers/pnp/ |
| D | support.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * support.c - standard functions for the use of pnp protocol drivers 6 * Copyright (C) 2008 Hewlett-Packard Development Company, L.P. 16 * pnp_is_active - Determines if a device is active based on its current 24 * only clears out auto-assigned resources. in pnp_is_active() 28 pnp_irq(dev, 0) == -1 && pnp_dma(dev, 0) == -1) in pnp_is_active() 44 * According to the specs, the first three characters are five-bit in pnp_eisa_id_to_string() 45 * compressed ASCII, and the left-over high order bit should be zero. in pnp_eisa_id_to_string() 51 str[0] = 'A' + ((id >> 26) & 0x3f) - 1; in pnp_eisa_id_to_string() 52 str[1] = 'A' + ((id >> 21) & 0x1f) - 1; in pnp_eisa_id_to_string() [all …]
|
| /kernel/linux/linux-5.10/drivers/pnp/ |
| D | support.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * support.c - standard functions for the use of pnp protocol drivers 6 * Copyright (C) 2008 Hewlett-Packard Development Company, L.P. 16 * pnp_is_active - Determines if a device is active based on its current 24 * only clears out auto-assigned resources. in pnp_is_active() 28 pnp_irq(dev, 0) == -1 && pnp_dma(dev, 0) == -1) in pnp_is_active() 45 * According to the specs, the first three characters are five-bit in pnp_eisa_id_to_string() 46 * compressed ASCII, and the left-over high order bit should be zero. in pnp_eisa_id_to_string() 52 str[0] = 'A' + ((id >> 26) & 0x3f) - 1; in pnp_eisa_id_to_string() 53 str[1] = 'A' + ((id >> 21) & 0x1f) - 1; in pnp_eisa_id_to_string() [all …]
|
| /kernel/linux/linux-6.6/drivers/gpu/drm/nouveau/nvkm/subdev/volt/ |
| D | base.c | 36 if (volt->func->volt_get) in nvkm_volt_get() 37 return volt->func->volt_get(volt); in nvkm_volt_get() 39 ret = volt->func->vid_get(volt); in nvkm_volt_get() 41 for (i = 0; i < volt->vid_nr; i++) { in nvkm_volt_get() 42 if (volt->vid[i].vid == ret) in nvkm_volt_get() 43 return volt->vid[i].uv; in nvkm_volt_get() 45 ret = -EINVAL; in nvkm_volt_get() 53 struct nvkm_subdev *subdev = &volt->subdev; in nvkm_volt_set() 54 int i, ret = -EINVAL, best_err = volt->max_uv, best = -1; in nvkm_volt_set() 56 if (volt->func->volt_set) in nvkm_volt_set() [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/nvkm/subdev/volt/ |
| D | base.c | 36 if (volt->func->volt_get) in nvkm_volt_get() 37 return volt->func->volt_get(volt); in nvkm_volt_get() 39 ret = volt->func->vid_get(volt); in nvkm_volt_get() 41 for (i = 0; i < volt->vid_nr; i++) { in nvkm_volt_get() 42 if (volt->vid[i].vid == ret) in nvkm_volt_get() 43 return volt->vid[i].uv; in nvkm_volt_get() 45 ret = -EINVAL; in nvkm_volt_get() 53 struct nvkm_subdev *subdev = &volt->subdev; in nvkm_volt_set() 54 int i, ret = -EINVAL, best_err = volt->max_uv, best = -1; in nvkm_volt_set() 56 if (volt->func->volt_set) in nvkm_volt_set() [all …]
|
| /kernel/linux/linux-6.6/virt/kvm/ |
| D | binary_stats.c | 1 // SPDX-License-Identifier: GPL-2.0-only 14 * kvm_stats_read() - Common function to read from the binary statistics 28 * +-------------+ 30 * +-------------+ 32 * +-------------+ 34 * +-------------+ 36 * +-------------+ 41 * and some other necessary information. This is a one-time work for the 43 * 2. Read id string from its offset. This is a one-time work for the lifecycle 46 * descriptors. This is a one-time work for the lifecycle of the [all …]
|
| /kernel/linux/linux-5.10/drivers/pnp/pnpbios/ |
| D | rsparser.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * rsparser.c - parses and encodes pnpbios resource data streams 45 * end tag -> 47 * end tag -> 49 * final end tag -> 57 int start, int len) in pnpbios_parse_allocated_ioresource() argument 60 int end = start + len - 1; in pnpbios_parse_allocated_ioresource() 62 if (len <= 0 || end >= 0x10003) in pnpbios_parse_allocated_ioresource() 69 int start, int len) in pnpbios_parse_allocated_memresource() argument 72 int end = start + len - 1; in pnpbios_parse_allocated_memresource() [all …]
|
| /kernel/linux/linux-6.6/drivers/pnp/pnpbios/ |
| D | rsparser.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * rsparser.c - parses and encodes pnpbios resource data streams 45 * end tag -> 47 * end tag -> 49 * final end tag -> 57 int start, int len) in pnpbios_parse_allocated_ioresource() argument 60 int end = start + len - 1; in pnpbios_parse_allocated_ioresource() 62 if (len <= 0 || end >= 0x10003) in pnpbios_parse_allocated_ioresource() 69 int start, int len) in pnpbios_parse_allocated_memresource() argument 72 int end = start + len - 1; in pnpbios_parse_allocated_memresource() [all …]
|
| /kernel/linux/linux-6.6/kernel/ |
| D | sysctl.c | 1 // SPDX-License-Identifier: GPL-2.0-only 7 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas. 9 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver. 11 * Added kswapd-interval, ctrl-alt-del, printk stuff, 1/8/97, Chris Horn. 85 const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 }; 106 * enum sysctl_writes_mode - supported sysctl write modes 125 SYSCTL_WRITES_LEGACY = -1, 149 size_t len; in _proc_do_string() local 160 len = strlen(data); in _proc_do_string() 161 if (len > maxlen - 1) in _proc_do_string() [all …]
|
| /kernel/linux/linux-5.10/arch/s390/kernel/ |
| D | crash_dump.c | 1 // SPDX-License-Identifier: GPL-2.0 18 #include <asm/asm-offsets.h> 25 #define PTR_SUB(x, y) (((char *) (x)) - ((unsigned long) (y))) 26 #define PTR_DIFF(x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y)))) 68 list_add(&sa->list, &dump_save_areas); in save_area_alloc() 70 list_add_tail(&sa->list, &dump_save_areas); in save_area_alloc() 89 lc = (struct lowcore *)(regs - __LC_FPREGS_SAVE_AREA); in save_area_add_regs() 90 memcpy(&sa->psw, &lc->psw_save_area, sizeof(sa->psw)); in save_area_add_regs() 91 memcpy(&sa->ctrs, &lc->cregs_save_area, sizeof(sa->ctrs)); in save_area_add_regs() 92 memcpy(&sa->gprs, &lc->gpregs_save_area, sizeof(sa->gprs)); in save_area_add_regs() [all …]
|
| /kernel/linux/linux-6.6/drivers/infiniband/ulp/rtrs/ |
| D | rtrs-clt-sysfs.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights reserved. 6 * Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights reserved. 7 * Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved. 12 #include "rtrs-pri.h" 13 #include "rtrs-clt.h" 14 #include "rtrs-log.h" 16 #define MIN_MAX_RECONN_ATT -1 39 free_percpu(stats->pcpu_stats); in rtrs_clt_path_stats_release() 73 attr->attr.name, buf); in max_reconnect_attempts_store() [all …]
|
| /kernel/linux/linux-6.6/scripts/kconfig/ |
| D | nconf.gui.c | 1 // SPDX-License-Identifier: GPL-2.0 35 #define COLOR_DEFAULT -1 106 for (; p->attr; p++) { in set_colors() 107 int attr = p->highlight; in set_colors() 109 if (p->has_color) { in set_colors() 111 init_pair(pair, p->color_fg, p->color_bg); in set_colors() 115 *p->attr = attr; in set_colors() 123 mvwprintw(win, y, (width - strlen(str)) / 2, "%s", str); in print_in_middle() 173 total_lines = min(total_lines, y); in fill_window() 177 int len = get_line_length(line); in fill_window() local [all …]
|
| /kernel/linux/linux-5.10/drivers/spi/ |
| D | spi-mxs.c | 1 // SPDX-License-Identifier: GPL-2.0+ 15 // Based on code from U-Boot bootloader by: 18 // Based on spi-stmp.c, which is: 28 #include <linux/dma-mapping.h> 40 #include <linux/spi/mxs-spi.h> 43 #define DRIVER_NAME "mxs-spi" 55 #define TXRX_DEASSERT_CS (1<<1) /* De-assert CS at end of txrx */ 66 struct mxs_spi *spi = spi_master_get_devdata(dev->master); in mxs_spi_setup_transfer() 67 struct mxs_ssp *ssp = &spi->ssp; in mxs_spi_setup_transfer() 68 const unsigned int hz = min(dev->max_speed_hz, t->speed_hz); in mxs_spi_setup_transfer() [all …]
|
| /kernel/linux/linux-6.6/drivers/spi/ |
| D | spi-mxs.c | 1 // SPDX-License-Identifier: GPL-2.0+ 15 // Based on code from U-Boot bootloader by: 18 // Based on spi-stmp.c, which is: 28 #include <linux/dma-mapping.h> 40 #include <linux/spi/mxs-spi.h> 42 #include <linux/dma/mxs-dma.h> 44 #define DRIVER_NAME "mxs-spi" 56 #define TXRX_DEASSERT_CS (1<<1) /* De-assert CS at end of txrx */ 67 struct mxs_spi *spi = spi_master_get_devdata(dev->master); in mxs_spi_setup_transfer() 68 struct mxs_ssp *ssp = &spi->ssp; in mxs_spi_setup_transfer() [all …]
|