docstring stringlengths 22 576 | signature stringlengths 9 317 | prompt stringlengths 57 886 | code stringlengths 20 1.36k | repository stringclasses 49 values | language stringclasses 2 values | license stringclasses 9 values | stars int64 15 21.3k |
|---|---|---|---|---|---|---|---|
/* Scan swap_map from current position to next entry still in use. Recycle to start on reaching the end, returning 0 when empty. */ | static unsigned int find_next_to_unuse(struct swap_info_struct *si, unsigned int prev) | /* Scan swap_map from current position to next entry still in use. Recycle to start on reaching the end, returning 0 when empty. */
static unsigned int find_next_to_unuse(struct swap_info_struct *si, unsigned int prev) | {
unsigned int max = si->max;
unsigned int i = prev;
unsigned char count;
for (;;) {
if (++i >= max) {
if (!prev) {
i = 0;
break;
}
max = prev + 1;
prev = 0;
i = 1;
}
count = si->swap_map[i];
if (count && swap_count(count) != SWAP_MAP_BAD)
break;
}
return i;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns: errno code corresponding to the status code in @l3l4_hdr and a message in @strbuf describing the error. */ | int i2400m_msg_check_status(const struct i2400m_l3l4_hdr *l3l4_hdr, char *strbuf, size_t strbuf_size) | /* Returns: errno code corresponding to the status code in @l3l4_hdr and a message in @strbuf describing the error. */
int i2400m_msg_check_status(const struct i2400m_l3l4_hdr *l3l4_hdr, char *strbuf, size_t strbuf_size) | {
int result;
enum i2400m_ms status = le16_to_cpu(l3l4_hdr->status);
const char *str;
if (status == 0)
return 0;
if (status >= ARRAY_SIZE(ms_to_errno)) {
str = "unknown status code";
result = -EBADR;
} else {
str = ms_to_errno[status].msg;
result = ms_to_errno[status].errno;
}
if (strbuf)
snprintf(strbuf, strbuf_size, "%s (%d)", str, status);
return result;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Find a dhcp client node by mac address */ | static struct dhcp_client_node* dhcp_client_find_by_mac(struct dhcp_server *dhcpserver, const u8_t *chaddr, u8_t hlen) | /* Find a dhcp client node by mac address */
static struct dhcp_client_node* dhcp_client_find_by_mac(struct dhcp_server *dhcpserver, const u8_t *chaddr, u8_t hlen) | {
struct dhcp_client_node *node;
for (node = dhcpserver->node_list; node != NULL; node = node->next)
{
if (memcmp(node->chaddr, chaddr, hlen) == 0)
{
return node;
}
}
return NULL;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Note: The returned array/buffer is owned by callee. */ | PCI_SEGMENT_INFO* EFIAPI GetPciSegmentInfo(UINTN *Count) | /* Note: The returned array/buffer is owned by callee. */
PCI_SEGMENT_INFO* EFIAPI GetPciSegmentInfo(UINTN *Count) | {
EFI_HOB_GUID_TYPE *GuidHob;
ACPI_BOARD_INFO *AcpiBoardInfo;
ASSERT (Count != NULL);
if (Count == NULL) {
return NULL;
}
if (mPciSegment0.BaseAddress == 0) {
GuidHob = GetFirstGuidHob (&gUefiAcpiBoardInfoGuid);
ASSERT (GuidHob != NULL);
AcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);
mPciSegment0.BaseAddress = AcpiBoardInfo->PcieBaseAddress;
}
*Count = 1;
return &mPciSegment0;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Search SYST for the specified table with the signature in the key, and return the mapped table */ | struct sfi_table_header* sfi_get_table(struct sfi_table_key *key) | /* Search SYST for the specified table with the signature in the key, and return the mapped table */
struct sfi_table_header* sfi_get_table(struct sfi_table_key *key) | {
struct sfi_table_header *th;
u32 tbl_cnt, i;
tbl_cnt = SFI_GET_NUM_ENTRIES(syst_va, u64);
for (i = 0; i < tbl_cnt; i++) {
th = sfi_check_table(syst_va->pentry[i], key);
if (!IS_ERR(th) && th)
return th;
}
return NULL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Write 1 to this bit and write 0 to this bit immediately once and only once during the firmware initialization and do not write 1 again after initialization since IT83xx takes much power consumption if this bit is set as 1 */ | static void adc_accuracy_initialization(void) | /* Write 1 to this bit and write 0 to this bit immediately once and only once during the firmware initialization and do not write 1 again after initialization since IT83xx takes much power consumption if this bit is set as 1 */
static void adc_accuracy_initialization(void) | {
struct adc_it8xxx2_regs *const adc_regs = ADC_IT8XXX2_REG_BASE;
adc_regs->ADCSTS |= IT8XXX2_ADC_AINITB;
adc_regs->KDCTL |= IT8XXX2_ADC_AHCE;
adc_regs->ADCSTS &= ~IT8XXX2_ADC_AINITB;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Enables or disables the AHB1 peripheral clock during Low Power (Sleep) mode. */ | void RCC_AHB1PeriphClockLPModeCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState) | /* Enables or disables the AHB1 peripheral clock during Low Power (Sleep) mode. */
void RCC_AHB1PeriphClockLPModeCmd(uint32_t RCC_AHB1Periph, FunctionalState NewState) | {
assert_param(IS_RCC_AHB1_LPMODE_PERIPH(RCC_AHB1Periph));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
RCC->AHB1LPENR |= RCC_AHB1Periph;
}
else
{
RCC->AHB1LPENR &= ~RCC_AHB1Periph;
}
} | MaJerle/stm32f429 | C++ | null | 2,036 |
/* Returns first word of the unique device identifier (UID based on 96 bits) */ | uint32_t HAL_GetUIDw0(void) | /* Returns first word of the unique device identifier (UID based on 96 bits) */
uint32_t HAL_GetUIDw0(void) | {
return(READ_REG(*((uint32_t *)UID_BASE)));
} | ua1arn/hftrx | C++ | null | 69 |
/* Fills each SPI_InitStruct member with its default value. */ | void SPI_StructInit(SPI_InitTypeDef *SPI_InitStruct) | /* Fills each SPI_InitStruct member with its default value. */
void SPI_StructInit(SPI_InitTypeDef *SPI_InitStruct) | {
SPI_InitStruct->SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStruct->SPI_Mode = SPI_Mode_Slave;
SPI_InitStruct->SPI_DataSize = SPI_DataSize_8b;
SPI_InitStruct->SPI_CPOL = SPI_CPOL_Low;
SPI_InitStruct->SPI_CPHA = SPI_CPHA_1Edge;
SPI_InitStruct->SPI_NSS = SPI_NSS_Hard;
SPI_InitStruct->SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;
SPI_InitStruct->SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStruct->SPI_CRCPolynomial = 7;
} | gcallipo/RadioDSP-Stm32f103 | C++ | Common Creative - Attribution 3.0 | 51 |
/* libc/string/memchr.c Finds the first occurrence of a byte in a buffer */ | void* memchr(const void *s, int c, size_t n) | /* libc/string/memchr.c Finds the first occurrence of a byte in a buffer */
void* memchr(const void *s, int c, size_t n) | {
const unsigned char *p = s;
while (n-- != 0)
{
if ((unsigned char)c == *p++)
{
return (void *)(p - 1);
}
}
return NULL;
} | xboot/xboot | C++ | MIT License | 779 |
/* config the DP module, mainly to perform blending, CSC and gamma correction */ | void ipu_dp_config(uint32_t ipu_index, uint32_t csc_type, uint32_t dual_disp, uint32_t fg_xp, uint32_t fg_yp, uint32_t alpha) | /* config the DP module, mainly to perform blending, CSC and gamma correction */
void ipu_dp_config(uint32_t ipu_index, uint32_t csc_type, uint32_t dual_disp, uint32_t fg_xp, uint32_t fg_yp, uint32_t alpha) | {
ipu_dp_fg_config(ipu_index, dual_disp, fg_xp, fg_yp, alpha);
ipu_dp_csc_config(ipu_index, 0, csc_type);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function will register TLS protocol to the global TLS protocol. */ | struct sal_socket* sal_get_socket(int socket) | /* This function will register TLS protocol to the global TLS protocol. */
struct sal_socket* sal_get_socket(int socket) | {
struct sal_socket_table *st = &socket_table;
socket = socket - SAL_SOCKET_OFFSET;
if (socket < 0 || socket >= (int) st->max_socket)
{
return RT_NULL;
}
RT_ASSERT(st->sockets[socket]->magic == SAL_SOCKET_MAGIC);
return st->sockets[socket];
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* If this interface is not supported, then return FALSE. */ | BOOLEAN EFIAPI Sha512HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue) | /* If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI Sha512HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue) | {
INT32 Ret;
if (HashValue == NULL) {
return FALSE;
}
if ((Data == NULL) && (DataSize != 0)) {
return FALSE;
}
Ret = mbedtls_sha512_ret (Data, DataSize, HashValue, FALSE);
if (Ret != 0) {
return FALSE;
}
return TRUE;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* free an array of pointers of struct page */ | static void relay_free_page_array(struct page **array) | /* free an array of pointers of struct page */
static void relay_free_page_array(struct page **array) | {
if (is_vmalloc_addr(array))
vfree(array);
else
kfree(array);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Conversion function from the endian swap size to the bit encoding of the CCR */ | static INLINE unsigned XDmaPs_ToEndianSwapSizeBits(unsigned int EndianSwapSize) | /* Conversion function from the endian swap size to the bit encoding of the CCR */
static INLINE unsigned XDmaPs_ToEndianSwapSizeBits(unsigned int EndianSwapSize) | {
switch (EndianSwapSize) {
case 0:
case 8:
return 0;
case 16:
return 1;
case 32:
return 2;
case 64:
return 3;
case 128:
return 4;
default:
return 0;
}
} | ua1arn/hftrx | C++ | null | 69 |
/* This one is only used for pages with the global bit set so we don't care much about the ASID. */ | void local_flush_tlb_one(unsigned long page) | /* This one is only used for pages with the global bit set so we don't care much about the ASID. */
void local_flush_tlb_one(unsigned long page) | {
unsigned long flags;
int oldpid, idx;
ENTER_CRITICAL(flags);
oldpid = read_c0_entryhi();
page &= (PAGE_MASK << 1);
write_c0_entryhi(page);
mtc0_tlbw_hazard();
tlb_probe();
tlb_probe_hazard();
idx = read_c0_index();
write_c0_entrylo0(0);
write_c0_entrylo1(0);
if (idx >= 0) {
write_c0_entryhi(UNIQUE_ENTRYHI(idx));
mtc0_tlbw_hazard();
tlb_write_indexed();
tlbw_use_hazard();
}
write_c0_entryhi(oldpid);
FLUSH_ITLB;
EXIT_CRITICAL(flags);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Config the filter type for the MAC address. */ | void ETH_ConfigMACAddressFilter(ETH_MAC_ADDRESS_T macAddr, ETH_MAC_ADDRESSFILTER_T filter) | /* Config the filter type for the MAC address. */
void ETH_ConfigMACAddressFilter(ETH_MAC_ADDRESS_T macAddr, ETH_MAC_ADDRESSFILTER_T filter) | {
if(filter == ETH_MAC_ADDRESSFILTER_SA)
{
(*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + macAddr)) |= ETH_MAC_ADDRESSFILTER_SA;
}
else
{
(*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + macAddr)) |= ETH_MAC_ADDRESSFILTER_DA;
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Ensures that no later instruction will execute speculatively, until all prior instructions have completed. */ | VOID EFIAPI SpeculationBarrier(VOID) | /* Ensures that no later instruction will execute speculatively, until all prior instructions have completed. */
VOID EFIAPI SpeculationBarrier(VOID) | {
if (PcdGet8 (PcdSpeculationBarrierType) == 0x01) {
AsmLfence ();
} else if (PcdGet8 (PcdSpeculationBarrierType) == 0x02) {
AsmCpuid (0x01, NULL, NULL, NULL, NULL);
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Gets the Rx FIFO level at which interrupts are generated. */ | void UARTFIFOTriggerLevelGet(unsigned long ulBase, unsigned long *pulRxLevel) | /* Gets the Rx FIFO level at which interrupts are generated. */
void UARTFIFOTriggerLevelGet(unsigned long ulBase, unsigned long *pulRxLevel) | {
unsigned long ulTemp;
xASSERT(UARTBaseValid(ulBase));
ulTemp = xHWREG(ulBase + UART_FCR);
*pulRxLevel = ulTemp & UART_FCR_RFITL_M;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Enable Timer Capture/Compare Control Update with Trigger.
If the capture/compare control bits CCxE, CCxNE and OCxM are set to be preloaded, they are updated by software generating the COMG event ( */ | void timer_enable_compare_control_update_on_trigger(uint32_t timer_peripheral) | /* Enable Timer Capture/Compare Control Update with Trigger.
If the capture/compare control bits CCxE, CCxNE and OCxM are set to be preloaded, they are updated by software generating the COMG event ( */
void timer_enable_compare_control_update_on_trigger(uint32_t timer_peripheral) | {
TIM_CR2(timer_peripheral) |= TIM_CR2_CCUS;
} | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* This file is part of the TinyUSB stack. */ | void __attribute__((interrupt(IPL2AUTO), vector(_USB_VECTOR), no_fpu)) | /* This file is part of the TinyUSB stack. */
void __attribute__((interrupt(IPL2AUTO), vector(_USB_VECTOR), no_fpu)) | {
IFS4CLR = _IFS4_USBIF_MASK;
tud_int_handler(0);
} | prusa3d/Prusa-Firmware-Buddy | C++ | Other | 1,019 |
/* Returns 0 if successful, or a negative error code. */ | int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct, unsigned int verb, unsigned int parm) | /* Returns 0 if successful, or a negative error code. */
int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct, unsigned int verb, unsigned int parm) | {
unsigned int cmd = make_codec_cmd(codec, nid, direct, verb, parm);
unsigned int res;
return codec_exec_verb(codec, cmd,
codec->bus->sync_write ? &res : NULL);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* If 16-bit MMIO register operations are not supported, then ASSERT(). */ | UINT16 EFIAPI S3MmioAnd16(IN UINTN Address, IN UINT16 AndData) | /* If 16-bit MMIO register operations are not supported, then ASSERT(). */
UINT16 EFIAPI S3MmioAnd16(IN UINTN Address, IN UINT16 AndData) | {
return InternalSaveMmioWrite16ValueToBootScript (Address, MmioAnd16 (Address, AndData));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* General Purpose Input/Outputs Read a Group of Pins. */ | uint8_t gpio_get(uint32_t gpioport, uint8_t gpios) | /* General Purpose Input/Outputs Read a Group of Pins. */
uint8_t gpio_get(uint32_t gpioport, uint8_t gpios) | {
return (uint8_t)GPIO_DATA(gpioport)[gpios];
} | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* Set the specified data holding register value for DAC channel1. */ | void DAC_SetChData(uint32_t DAC_Align, uint16_t Data) | /* Set the specified data holding register value for DAC channel1. */
void DAC_SetChData(uint32_t DAC_Align, uint16_t Data) | {
__IO uint32_t tmp = 0;
assert_param(IS_DAC_ALIGN(DAC_Align));
assert_param(IS_DAC_DATA(Data));
tmp = (uint32_t)DAC_BASE;
tmp += DR12CH_OFFSET + DAC_Align;
*(__IO uint32_t*)tmp = Data;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Reads and returns the current value of DR0. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */ | UINTN EFIAPI AsmReadDr0(VOID) | /* Reads and returns the current value of DR0. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmReadDr0(VOID) | {
UINTN Data;
__asm__ __volatile__ (
"mov %%dr0, %0"
: "=r" (Data)
);
return Data;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* The allocated memory is filled with bytes of value zero. */ | void* mem_calloc(mem_size_t count, mem_size_t size) | /* The allocated memory is filled with bytes of value zero. */
void* mem_calloc(mem_size_t count, mem_size_t size) | {
void *p;
p = mem_malloc(count * size);
if (p) {
memset(p, 0, count * size);
}
return p;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* USBH_HID_GetASCIICode The function decode keyboard data into ASCII characters. */ | uint8_t USBH_HID_GetASCIICode(HID_KEYBD_Info_TypeDef *info) | /* USBH_HID_GetASCIICode The function decode keyboard data into ASCII characters. */
uint8_t USBH_HID_GetASCIICode(HID_KEYBD_Info_TypeDef *info) | {
uint8_t output;
if ((info->lshift != 0U) || (info->rshift != 0U))
{
output = HID_KEYBRD_ShiftKey[HID_KEYBRD_Codes[info->keys[0]]];
}
else
{
output = HID_KEYBRD_Key[HID_KEYBRD_Codes[info->keys[0]]];
}
return output;
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* draw a point with a given 8bit colour */ | arm_fsm_rt_t arm_2dp_c8bit_draw_point(arm_2d_op_drw_pt_t *ptOP, const arm_2d_tile_t *ptTarget, const arm_2d_location_t tLocation, uint_fast8_t chColour) | /* draw a point with a given 8bit colour */
arm_fsm_rt_t arm_2dp_c8bit_draw_point(arm_2d_op_drw_pt_t *ptOP, const arm_2d_tile_t *ptTarget, const arm_2d_location_t tLocation, uint_fast8_t chColour) | {
assert(NULL != ptTarget);
ARM_2D_IMPL(arm_2d_op_drw_pt_t, ptOP);
if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) {
return arm_fsm_rt_on_going;
}
arm_2d_region_t tPointRegion = {
.tLocation = tLocation,
.tSize = {1,1},
};
OP_CORE.ptOp = &ARM_2D_OP_DRAW_POINT_C8BIT;
OP_CORE.Preference.u2ACCMethods = ARM_2D_PREF_ACC_SW_ONLY;
this.Target.ptTile = ptTarget;
this.Target.ptRegion = &tPointRegion;
this.chColour = chColour;
return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis);
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Undo the override of setup_arg_pages() without this ia32_setup_arg_pages() will suffer infinite self recursion. */ | int ia32_setup_arg_pages(struct linux_binprm *bprm, int executable_stack) | /* Undo the override of setup_arg_pages() without this ia32_setup_arg_pages() will suffer infinite self recursion. */
int ia32_setup_arg_pages(struct linux_binprm *bprm, int executable_stack) | {
int ret;
ret = setup_arg_pages(bprm, IA32_STACK_TOP, executable_stack);
if (!ret) {
current->thread.ppl = ia32_init_pp_list();
}
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns a offset of next property from the given property. */ | INT32 EFIAPI FdtNextPropertyOffset(IN CONST VOID *Fdt, IN INT32 Offset) | /* Returns a offset of next property from the given property. */
INT32 EFIAPI FdtNextPropertyOffset(IN CONST VOID *Fdt, IN INT32 Offset) | {
return fdt_next_property_offset (Fdt, Offset);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Copy useful information when duplicating a server record */ | static void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *source) | /* Copy useful information when duplicating a server record */
static void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *source) | {
target->flags = source->flags;
target->acregmin = source->acregmin;
target->acregmax = source->acregmax;
target->acdirmin = source->acdirmin;
target->acdirmax = source->acdirmax;
target->caps = source->caps;
target->options = source->options;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* if the register index is invalid or unsupported in current APIC mode, then ASSERT. */ | VOID EFIAPI WriteLocalApicReg(IN UINTN MmioOffset, IN UINT32 Value) | /* if the register index is invalid or unsupported in current APIC mode, then ASSERT. */
VOID EFIAPI WriteLocalApicReg(IN UINTN MmioOffset, IN UINT32 Value) | {
ASSERT ((MmioOffset & 0xf) == 0);
ASSERT (GetApicMode () == LOCAL_APIC_MODE_XAPIC);
MmioWrite32 (GetLocalApicBaseAddress () + MmioOffset, Value);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Can't use the nice macro as I have also to initialise the USB subsystem: registering the usb-system */ | static int __init init_usbduxfast(void) | /* Can't use the nice macro as I have also to initialise the USB subsystem: registering the usb-system */
static int __init init_usbduxfast(void) | {
printk(KERN_INFO
KBUILD_MODNAME ": " DRIVER_VERSION ":" DRIVER_DESC "\n");
usb_register(&usbduxfastsub_driver);
comedi_driver_register(&driver_usbduxfast);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* pm8001_chip_phy_stop_req - start phy via PHY_STOP COMMAND @pm8001_ha: our hba card information. @num: the inbound queue number @phy_id: the phy id which we wanted to start up. */ | static int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) | /* pm8001_chip_phy_stop_req - start phy via PHY_STOP COMMAND @pm8001_ha: our hba card information. @num: the inbound queue number @phy_id: the phy id which we wanted to start up. */
static int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) | {
struct phy_stop_req payload;
struct inbound_queue_table *circularQ;
int ret;
u32 tag = 0x01;
u32 opcode = OPC_INB_PHYSTOP;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&payload, 0, sizeof(payload));
payload.tag = cpu_to_le32(tag);
payload.phy_id = cpu_to_le32(phy_id);
ret = mpi_build_cmd(pm8001_ha, circularQ, opcode, &payload);
return ret;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Adds the connector callback to the connector driver. */ | static int __init cn_proc_init(void) | /* Adds the connector callback to the connector driver. */
static int __init cn_proc_init(void) | {
int err;
if ((err = cn_add_callback(&cn_proc_event_id, "cn_proc",
&cn_proc_mcast_ctl))) {
printk(KERN_WARNING "cn_proc failed to register\n");
return err;
}
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Verify arguments are safe before heading to dma_memcpy(). */ | void* safe_dma_memcpy(void *dst, const void *src, size_t size) | /* Verify arguments are safe before heading to dma_memcpy(). */
void* safe_dma_memcpy(void *dst, const void *src, size_t size) | {
if (!access_ok(VERIFY_WRITE, dst, size))
return NULL;
if (!access_ok(VERIFY_READ, src, size))
return NULL;
return dma_memcpy(dst, src, size);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Calculate the new process capability sets from the capability sets attached to a file. */ | static int bprm_caps_from_vfs_caps(struct cpu_vfs_cap_data *caps, struct linux_binprm *bprm, bool *effective) | /* Calculate the new process capability sets from the capability sets attached to a file. */
static int bprm_caps_from_vfs_caps(struct cpu_vfs_cap_data *caps, struct linux_binprm *bprm, bool *effective) | {
struct cred *new = bprm->cred;
unsigned i;
int ret = 0;
if (caps->magic_etc & VFS_CAP_FLAGS_EFFECTIVE)
*effective = true;
CAP_FOR_EACH_U32(i) {
__u32 permitted = caps->permitted.cap[i];
__u32 inheritable = caps->inheritable.cap[i];
new->cap_permitted.cap[i] =
(new->cap_bset.cap[i] & permitted) |
(new->cap_inheritable.cap[i] & inheritable);
if (permitted & ~new->cap_permitted.cap[i])
ret = -EPERM;
}
return *effective ? ret : 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Return: 0 is there is no match(is unique); if there is a match(we dont have a unique name), return -EINVAL. */ | static int _rproc_name_is_unique(struct udevice *dev, struct dm_rproc_uclass_pdata *uc_pdata, const void *data) | /* Return: 0 is there is no match(is unique); if there is a match(we dont have a unique name), return -EINVAL. */
static int _rproc_name_is_unique(struct udevice *dev, struct dm_rproc_uclass_pdata *uc_pdata, const void *data) | {
const char *check_name = data;
if (!uc_pdata->name || !check_name)
return 0;
if (strlen(uc_pdata->name) != strlen(check_name))
return 0;
if (!strcmp(uc_pdata->name, check_name))
return -EINVAL;
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* get a big endian short (16bits) from a pointer
Caller should ensure parameters are valid. */ | uint16_t BytesGetBe16(const void *ptr) | /* get a big endian short (16bits) from a pointer
Caller should ensure parameters are valid. */
uint16_t BytesGetBe16(const void *ptr) | {
const uint8_t *p = (const uint8_t *)ptr;
return (p[0] << 8) | p[1];
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Enable the watch dog timer's Interrupt.
This function is to enable the watch dog interrupt. */ | void WDTimerIntEnable(void) | /* Enable the watch dog timer's Interrupt.
This function is to enable the watch dog interrupt. */
void WDTimerIntEnable(void) | {
xHWREG(WWDG_CFR) |= WWDG_CFR_EWI_EN;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* initialize any driver wide global data structures and register itself with the cxgb3 module */ | static int __init cxgb3i_init_module(void) | /* initialize any driver wide global data structures and register itself with the cxgb3 module */
static int __init cxgb3i_init_module(void) | {
int err;
err = cxgb3i_sdev_init(cxgb3i_cpl_handlers);
if (err < 0)
return err;
err = cxgb3i_iscsi_init();
if (err < 0)
return err;
err = cxgb3i_pdu_init();
if (err < 0)
return err;
cxgb3_register_client(&t3c_client);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Enumerate sensor range settings.
This routine returns the address of a table, if any, holding device-specific sensor range settings. The units of the settings are specific to the device and typically documented in the manufacturer's data sheets for the device. */ | bool sensor_enum_range(sensor_t *sensor, const sensor_range_t **table, size_t *count) | /* Enumerate sensor range settings.
This routine returns the address of a table, if any, holding device-specific sensor range settings. The units of the settings are specific to the device and typically documented in the manufacturer's data sheets for the device. */
bool sensor_enum_range(sensor_t *sensor, const sensor_range_t **table, size_t *count) | {
*table = sensor->drv->caps.range_table;
*count = sensor->drv->caps.range_count;
return (*count) ? true : false;
} | memfault/zero-to-main | C++ | null | 200 |
/* Managed ioremap_nocache(). Map is automatically unmapped on driver detach. */ | void __iomem* devm_ioremap_nocache(struct device *dev, resource_size_t offset, unsigned long size) | /* Managed ioremap_nocache(). Map is automatically unmapped on driver detach. */
void __iomem* devm_ioremap_nocache(struct device *dev, resource_size_t offset, unsigned long size) | {
void __iomem **ptr, *addr;
ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return NULL;
addr = ioremap_nocache(offset, size);
if (addr) {
*ptr = addr;
devres_add(dev, ptr);
} else
devres_free(ptr);
return addr;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Threshold for wakeup: 1 LSB weight depends on WAKE_THS_W in WAKE_UP_DUR.. */ | int32_t lsm6dso_wkup_threshold_set(stmdev_ctx_t *ctx, uint8_t val) | /* Threshold for wakeup: 1 LSB weight depends on WAKE_THS_W in WAKE_UP_DUR.. */
int32_t lsm6dso_wkup_threshold_set(stmdev_ctx_t *ctx, uint8_t val) | {
lsm6dso_wake_up_ths_t reg;
int32_t ret;
ret = lsm6dso_read_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
if (ret == 0) {
reg.wk_ths = val;
ret = lsm6dso_write_reg(ctx, LSM6DSO_WAKE_UP_THS, (uint8_t *)®, 1);
}
return ret;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* If 64-bit I/O port operations are not supported, then ASSERT(). */ | UINT64 EFIAPI S3IoWrite64(IN UINTN Port, IN UINT64 Value) | /* If 64-bit I/O port operations are not supported, then ASSERT(). */
UINT64 EFIAPI S3IoWrite64(IN UINTN Port, IN UINT64 Value) | {
return InternalSaveIoWrite64ValueToBootScript (Port, IoWrite64 (Port, Value));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Search an int array for a key value */ | static int array_search(int *array, int count, int key) | /* Search an int array for a key value */
static int array_search(int *array, int count, int key) | {
int i;
for (i = 0; i < count; i++) {
if (array[i] == key)
return i;
}
return -1;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Retrieves the current state of a pointer device. */ | EFI_STATUS EFIAPI GetMouseState(IN EFI_SIMPLE_POINTER_PROTOCOL *This, OUT EFI_SIMPLE_POINTER_STATE *MouseState) | /* Retrieves the current state of a pointer device. */
EFI_STATUS EFIAPI GetMouseState(IN EFI_SIMPLE_POINTER_PROTOCOL *This, OUT EFI_SIMPLE_POINTER_STATE *MouseState) | {
USB_MOUSE_DEV *MouseDev;
if (MouseState == NULL) {
return EFI_INVALID_PARAMETER;
}
MouseDev = USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This);
if (!MouseDev->StateChanged) {
return EFI_NOT_READY;
}
CopyMem (
MouseState,
&MouseDev->State,
sizeof (EFI_SIMPLE_POINTER_STATE)
);
MouseDev->State.RelativeMovementX = 0;
MouseDev->State.RelativeMovementY = 0;
MouseDev->State.RelativeMovementZ = 0;
MouseDev->StateChanged = FALSE;
return EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Function to read the GMAC IP Version and populates the same in device data structure. */ | s32 synopGMAC_read_version(synopGMACdevice *gmacdev) | /* Function to read the GMAC IP Version and populates the same in device data structure. */
s32 synopGMAC_read_version(synopGMACdevice *gmacdev) | {
u32 data = 0;
data = synopGMACReadReg(gmacdev->MacBase, GmacVersion );
gmacdev->Version = data;
return 0;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Copies device info back to user space, used by the create and info ioctls. */ | static int dev_status(struct dm_ioctl *param, size_t param_size) | /* Copies device info back to user space, used by the create and info ioctls. */
static int dev_status(struct dm_ioctl *param, size_t param_size) | {
int r;
struct mapped_device *md;
md = find_device(param);
if (!md)
return -ENXIO;
r = __dev_status(md, param);
dm_put(md);
return r;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Fills each init_struct member with its default value. */ | void TIM_OCStructInit(TIM_OCInitTypeDef *init_struct) | /* Fills each init_struct member with its default value. */
void TIM_OCStructInit(TIM_OCInitTypeDef *init_struct) | {
init_struct->TIM_OCMode = TIM_OCMode_Timing;
init_struct->TIM_OutputState = TIM_OutputState_Disable;
init_struct->TIM_OutputNState = TIM_OutputNState_Disable;
init_struct->TIM_Pulse = 0x00000000;
init_struct->TIM_OCPolarity = TIM_OCPolarity_High;
init_struct->TIM_OCNPolarity = TIM_OCNPolarity_High;
init_struct->TIM_OCIdleState = TIM_OCIdleState_Reset;
init_struct->TIM_OCNIdleState = TIM_OCNIdleState_Reset;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function creates a new icon button group, allocating required memory and properly initializing the object. If there is not enough memory, the function returns NULL. The icon button group will keep a reference count for its members, and will be automatically destroyed when the last member is destroyed. */ | struct wtk_icon_group* wtk_icon_group_create(void) | /* This function creates a new icon button group, allocating required memory and properly initializing the object. If there is not enough memory, the function returns NULL. The icon button group will keep a reference count for its members, and will be automatically destroyed when the last member is destroyed. */
struct wtk_icon_group* wtk_icon_group_create(void) | {
struct wtk_icon_group *icon_group
= membag_alloc(sizeof(struct wtk_icon_group));
if (!icon_group) {
goto outofmem_icon_group;
}
icon_group->num_references = 0;
icon_group->selected = NULL;
return icon_group;
outofmem_icon_group:
return NULL;
} | memfault/zero-to-main | C++ | null | 200 |
/* This function disables the RTC in the Hibernation module. After calling this function, the RTC features of the Hibernation module are not available. */ | void HibernateRTCDisable(void) | /* This function disables the RTC in the Hibernation module. After calling this function, the RTC features of the Hibernation module are not available. */
void HibernateRTCDisable(void) | {
HWREG(HIB_CTL) &= ~HIB_CTL_RTCEN;
HibernateWriteComplete();
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Set a given number of pixels to the same color.
Limits have to be set prior to calling this function, e.g.: */ | void ili9325_duplicate_pixel(const ili9325_color_t color, uint32_t count) | /* Set a given number of pixels to the same color.
Limits have to be set prior to calling this function, e.g.: */
void ili9325_duplicate_pixel(const ili9325_color_t color, uint32_t count) | {
Assert(count > 0);
LCD_IR(0);
LCD_IR(ILI9325_GRAM_DATA_REG);
while (count--) {
LCD_WD((color >> 16) & 0xFF);
LCD_WD((color >> 8) & 0xFF);
LCD_WD(color & 0xFF);
}
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Called from _init_clocks(). Populates the @oh _clk (main functional clock pointer) if a main_clk is present. Returns 0 on success or -EINVAL on error. */ | static int _init_main_clk(struct omap_hwmod *oh) | /* Called from _init_clocks(). Populates the @oh _clk (main functional clock pointer) if a main_clk is present. Returns 0 on success or -EINVAL on error. */
static int _init_main_clk(struct omap_hwmod *oh) | {
struct clk *c;
int ret = 0;
if (!oh->clkdev_con_id)
return 0;
c = clk_get_sys(oh->clkdev_dev_id, oh->clkdev_con_id);
WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s.%s\n",
oh->name, oh->clkdev_dev_id, oh->clkdev_con_id);
if (IS_ERR(c))
ret = -EINVAL;
oh->_clk = c;
WARN(!c->clkdm, "omap_hwmod: %s: missing clockdomain for %s.\n",
oh->clkdev_con_id, c->name);
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */ | BOOLEAN EFIAPI CryptoServiceSha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context) | /* If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI CryptoServiceSha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context) | {
return CALL_BASECRYPTLIB (Sha384.Services.Duplicate, Sha384Duplicate, (Sha384Context, NewSha384Context), FALSE);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* OTG_FS_IRQHandler This function handles USB-On-The-Go FS global interrupt request. requests. */ | void OTG_FS_IRQHandler(void) | /* OTG_FS_IRQHandler This function handles USB-On-The-Go FS global interrupt request. requests. */
void OTG_FS_IRQHandler(void) | {
HAL_PCD_IRQHandler(&hpcd);
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Initialize the memory management pool for the host controller. */ | USBHC_MEM_POOL* UsbHcInitMemPool(IN EFI_PCI_IO_PROTOCOL *PciIo) | /* Initialize the memory management pool for the host controller. */
USBHC_MEM_POOL* UsbHcInitMemPool(IN EFI_PCI_IO_PROTOCOL *PciIo) | {
USBHC_MEM_POOL *Pool;
Pool = AllocatePool (sizeof (USBHC_MEM_POOL));
if (Pool == NULL) {
return Pool;
}
Pool->PciIo = PciIo;
Pool->Head = UsbHcAllocMemBlock (Pool, USBHC_MEM_DEFAULT_PAGES);
if (Pool->Head == NULL) {
gBS->FreePool (Pool);
Pool = NULL;
}
return Pool;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Transfer AP to safe hlt-loop after it finished restore CPU features on S3 patch. */ | VOID TransferApToSafeState(IN UINTN ApHltLoopCode, IN UINTN TopOfStack, IN UINTN NumberToFinishAddress) | /* Transfer AP to safe hlt-loop after it finished restore CPU features on S3 patch. */
VOID TransferApToSafeState(IN UINTN ApHltLoopCode, IN UINTN TopOfStack, IN UINTN NumberToFinishAddress) | {
AsmDisablePaging64 (
GetProtectedModeCS (),
(UINT32)ApHltLoopCode,
(UINT32)NumberToFinishAddress,
0,
(UINT32)TopOfStack
);
ASSERT (FALSE);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This function returns zero in case of success and a negative error code in case of failure. */ | static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, unsigned char *buf) | /* This function returns zero in case of success and a negative error code in case of failure. */
static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, unsigned char *buf) | {
int err = 0, lnum, offs, total_read;
struct gluebi_device *gluebi;
if (len < 0 || from < 0 || from + len > mtd->size)
return -EINVAL;
gluebi = container_of(mtd, struct gluebi_device, mtd);
lnum = div_u64_rem(from, mtd->erasesize, &offs);
total_read = len;
while (total_read) {
size_t to_read = mtd->erasesize - offs;
if (to_read > total_read)
to_read = total_read;
err = ubi_read(gluebi->desc, lnum, buf, offs, to_read);
if (err)
break;
lnum += 1;
offs = 0;
total_read -= to_read;
buf += to_read;
}
*retlen = len - total_read;
return err;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Disable interrupts for a channel. Interrupts that are not specified by the interrupt mask are not affected. */ | void XAxiVdma_ChannelDisableIntr(XAxiVdma_Channel *Channel, u32 IntrType) | /* Disable interrupts for a channel. Interrupts that are not specified by the interrupt mask are not affected. */
void XAxiVdma_ChannelDisableIntr(XAxiVdma_Channel *Channel, u32 IntrType) | {
u32 CrBits;
u32 IrqBits;
if ((IntrType & XAXIVDMA_IXR_ALL_MASK) == 0) {
PRINTF(
"Disable intr with null intr mask value %x\r\n",
(unsigned int)IntrType);
return;
}
CrBits = XAxiVdma_ReadReg(Channel->ChanBase, XAXIVDMA_CR_OFFSET);
IrqBits = (CrBits & XAXIVDMA_IXR_ALL_MASK) &
~(IntrType & XAXIVDMA_IXR_ALL_MASK);
CrBits &= ~XAXIVDMA_IXR_ALL_MASK;
XAxiVdma_WriteReg(Channel->ChanBase, XAXIVDMA_CR_OFFSET,
CrBits | IrqBits);
return;
} | ua1arn/hftrx | C++ | null | 69 |
/* Fills each I2C_InitStruct member with its default value. */ | void I2C_StructInit(I2C_InitTypeDef *I2C_InitStruct) | /* Fills each I2C_InitStruct member with its default value. */
void I2C_StructInit(I2C_InitTypeDef *I2C_InitStruct) | {
I2C_InitStruct->I2C_Timing = 0;
I2C_InitStruct->I2C_AnalogFilter = I2C_AnalogFilter_Enable;
I2C_InitStruct->I2C_DigitalFilter = 0;
I2C_InitStruct->I2C_Mode = I2C_Mode_I2C;
I2C_InitStruct->I2C_OwnAddress1 = 0;
I2C_InitStruct->I2C_Ack = I2C_Ack_Disable;
I2C_InitStruct->I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
} | ajhc/demo-cortex-m3 | C++ | null | 38 |
/* Return value: number of bytes printed to buffer */ | static ssize_t ipr_show_adapter_handle(struct device *dev, struct device_attribute *attr, char *buf) | /* Return value: number of bytes printed to buffer */
static ssize_t ipr_show_adapter_handle(struct device *dev, struct device_attribute *attr, char *buf) | {
struct scsi_device *sdev = to_scsi_device(dev);
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata;
struct ipr_resource_entry *res;
unsigned long lock_flags = 0;
ssize_t len = -ENXIO;
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
res = (struct ipr_resource_entry *)sdev->hostdata;
if (res)
len = snprintf(buf, PAGE_SIZE, "%08X\n", res->cfgte.res_handle);
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
return len;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Main program entry point. This routine configures the hardware required by the application, then enters a loop to run the application tasks in sequence. */ | int main(void) | /* Main program entry point. This routine configures the hardware required by the application, then enters a loop to run the application tasks in sequence. */
int main(void) | {
XMC_GPIO_SetMode(LED1,XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
XMC_GPIO_SetMode(LED2,XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
USB_Init();
while (1)
{
HID_Device_USBTask(&Generic_HID_Interface);
}
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* This is a helper function that does minimal validation of EAP messages. The length field is verified to be large enough to include the header and not too large to go beyond the end of the buffer. */ | int eap_hdr_len_valid(const struct wpabuf *msg, size_t min_payload) | /* This is a helper function that does minimal validation of EAP messages. The length field is verified to be large enough to include the header and not too large to go beyond the end of the buffer. */
int eap_hdr_len_valid(const struct wpabuf *msg, size_t min_payload) | {
const struct eap_hdr *hdr;
size_t len;
if (msg == NULL)
return 0;
hdr = wpabuf_head(msg);
if (wpabuf_len(msg) < sizeof(*hdr)) {
wpa_printf(MSG_INFO, "EAP: Too short EAP frame");
return 0;
}
len = be_to_host16(hdr->length);
if (len < sizeof(*hdr) + min_payload || len > wpabuf_len(msg)) {
wpa_printf(MSG_INFO, "EAP: Invalid EAP length");
return 0;
}
return 1;
} | retro-esp32/RetroESP32 | C++ | Creative Commons Attribution Share Alike 4.0 International | 581 |
/* Returns the machine type from the PE/COFF image specified by Pe32Data. If Pe32Data is NULL, then ASSERT(). */ | UINT16 EFIAPI PeCoffLoaderGetMachineType(IN VOID *Pe32Data) | /* Returns the machine type from the PE/COFF image specified by Pe32Data. If Pe32Data is NULL, then ASSERT(). */
UINT16 EFIAPI PeCoffLoaderGetMachineType(IN VOID *Pe32Data) | {
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
EFI_IMAGE_DOS_HEADER *DosHdr;
ASSERT (Pe32Data != NULL);
DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + (UINTN)((DosHdr->e_lfanew) & 0x0ffff));
} else {
Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
}
if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
return Hdr.Te->Machine;
} else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
return Hdr.Pe32->FileHeader.Machine;
}
return 0x0000;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This routine supports chips which consume multiple I2C addresses. It computes the addressing information to be used for a given r/w request. Assumes that sanity checks for offset happened at sysfs-layer. */ | static struct i2c_client* at24_translate_offset(struct at24_data *at24, unsigned *offset) | /* This routine supports chips which consume multiple I2C addresses. It computes the addressing information to be used for a given r/w request. Assumes that sanity checks for offset happened at sysfs-layer. */
static struct i2c_client* at24_translate_offset(struct at24_data *at24, unsigned *offset) | {
unsigned i;
if (at24->chip.flags & AT24_FLAG_ADDR16) {
i = *offset >> 16;
*offset &= 0xffff;
} else {
i = *offset >> 8;
*offset &= 0xff;
}
return at24->client[i];
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Reset the WDT's counter. The "feed the dog" operation. Must be called periodically to avoid a timeout. Calling this also clears any WDT interrupts. */ | void wdt_reset(void) | /* Reset the WDT's counter. The "feed the dog" operation. Must be called periodically to avoid a timeout. Calling this also clears any WDT interrupts. */
void wdt_reset(void) | {
WDT_CRR = 0x76;
} | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* fill the length and offset of each urb descriptor. the fixed 12.13 frequency is passed as 16.16 through the pipe. */ | static int prepare_capture_sync_urb_hs(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *urb) | /* fill the length and offset of each urb descriptor. the fixed 12.13 frequency is passed as 16.16 through the pipe. */
static int prepare_capture_sync_urb_hs(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *urb) | {
unsigned char *cp = urb->transfer_buffer;
struct snd_urb_ctx *ctx = urb->context;
urb->dev = ctx->subs->dev;
urb->iso_frame_desc[0].length = 4;
urb->iso_frame_desc[0].offset = 0;
cp[0] = subs->freqn;
cp[1] = subs->freqn >> 8;
cp[2] = subs->freqn >> 16;
cp[3] = subs->freqn >> 24;
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* One notified function to stop the Host Controller at the end of PEI */ | EFI_STATUS EFIAPI EhcEndOfPei(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi) | /* One notified function to stop the Host Controller at the end of PEI */
EFI_STATUS EFIAPI EhcEndOfPei(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi) | {
PEI_USB2_HC_DEV *Ehc;
Ehc = PEI_RECOVERY_USB_EHC_DEV_FROM_THIS_NOTIFY (NotifyDescriptor);
EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
EhcFreeSched (Ehc);
return EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Bind a connection entry with the corresponding packet_xmit. Called by ip_vs_conn_new. */ | static void ip_vs_bind_xmit(struct ip_vs_conn *cp) | /* Bind a connection entry with the corresponding packet_xmit. Called by ip_vs_conn_new. */
static void ip_vs_bind_xmit(struct ip_vs_conn *cp) | {
switch (IP_VS_FWD_METHOD(cp)) {
case IP_VS_CONN_F_MASQ:
cp->packet_xmit = ip_vs_nat_xmit;
break;
case IP_VS_CONN_F_TUNNEL:
cp->packet_xmit = ip_vs_tunnel_xmit;
break;
case IP_VS_CONN_F_DROUTE:
cp->packet_xmit = ip_vs_dr_xmit;
break;
case IP_VS_CONN_F_LOCALNODE:
cp->packet_xmit = ip_vs_null_xmit;
break;
case IP_VS_CONN_F_BYPASS:
cp->packet_xmit = ip_vs_bypass_xmit;
break;
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Convert an integer from unsigned big-endian encoding to a sequence of 30-bit words in little-endian order. The final "partial" word is returned. */ | static uint32_t be8_to_le30(uint32_t *dst, const unsigned char *src, size_t len) | /* Convert an integer from unsigned big-endian encoding to a sequence of 30-bit words in little-endian order. The final "partial" word is returned. */
static uint32_t be8_to_le30(uint32_t *dst, const unsigned char *src, size_t len) | {
uint32_t acc;
int acc_len;
acc = 0;
acc_len = 0;
while (len -- > 0) {
uint32_t b;
b = src[len];
if (acc_len < 22) {
acc |= b << acc_len;
acc_len += 8;
} else {
*dst ++ = (acc | (b << acc_len)) & 0x3FFFFFFF;
acc = b >> (30 - acc_len);
acc_len -= 22;
}
}
return acc;
} | RavenSystem/esp-homekit-devices | C++ | Other | 2,577 |
/* This file is part of the Simba project. */ | int http_websocket_server_init(struct http_websocket_server_t *self_p, struct socket_t *socket_p) | /* This file is part of the Simba project. */
int http_websocket_server_init(struct http_websocket_server_t *self_p, struct socket_t *socket_p) | {
ASSERTN(self_p != NULL, EINVAL)
ASSERTN(socket_p != NULL, EINVAL)
self_p->socket_p = socket_p;
return (0);
} | eerimoq/simba | C++ | Other | 337 |
/* Stops the counter at current value. On the next call to hw_counter_start, the counter will start from the value at which it was stopped. */ | void hw_counter_stop(void) | /* Stops the counter at current value. On the next call to hw_counter_start, the counter will start from the value at which it was stopped. */
void hw_counter_stop(void) | {
counter_running = false;
hw_counter_timer = NSI_NEVER;
nsi_hws_find_next_event();
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* We can't address 8 and 16 bit words directly. Instead we have to read/write a 32bit word and mask/modify the data we actually want. */ | static int read_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 *val) | /* We can't address 8 and 16 bit words directly. Instead we have to read/write a 32bit word and mask/modify the data we actually want. */
static int read_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 *val) | {
unsigned int data = 0;
int err;
if (bus == NULL)
return -1;
err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, ~(1 << (where & 3)), &data);
switch (where & 0x03) {
case 0:
*val = (unsigned char)(data & 0x000000ff);
break;
case 1:
*val = (unsigned char)((data & 0x0000ff00) >> 8);
break;
case 2:
*val = (unsigned char)((data & 0x00ff0000) >> 16);
break;
case 3:
*val = (unsigned char)((data & 0xff000000) >> 24);
break;
}
return err;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Airpcap wrapper, used to set the fcs validation of an airpcap adapter */ | gboolean airpcap_if_set_fcs_validation(PAirpcapHandle ah, AirpcapValidationType val) | /* Airpcap wrapper, used to set the fcs validation of an airpcap adapter */
gboolean airpcap_if_set_fcs_validation(PAirpcapHandle ah, AirpcapValidationType val) | {
if (!AirpcapLoaded) return FALSE;
return g_PAirpcapSetFcsValidation(ah,val);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Display a single word SRC onto the VSP control panel. */ | void mf_display_src(u32 word) | /* Display a single word SRC onto the VSP control panel. */
void mf_display_src(u32 word) | {
u8 ce[12];
memset(ce, 0, sizeof(ce));
ce[3] = 0x4a;
ce[7] = 0x01;
ce[8] = word >> 24;
ce[9] = word >> 16;
ce[10] = word >> 8;
ce[11] = word;
signal_ce_msg(ce, NULL);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* send SPI special command which does not have address and data phase */ | void exmc_sqpipsram_write_cmd_send(void) | /* send SPI special command which does not have address and data phase */
void exmc_sqpipsram_write_cmd_send(void) | {
EXMC_SWCMD |= EXMC_SWCMD_SC;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Set interrupt pending bit from the given (unique) source (AT91C_ID_xxx). */ | void NVIC_SetPending(unsigned int source) | /* Set interrupt pending bit from the given (unique) source (AT91C_ID_xxx). */
void NVIC_SetPending(unsigned int source) | {
NVIC_SetPendingIRQ((IRQn_Type)source);
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Modify the interest event mask by dropping an event if the new mask has a match in the current file status. Must be called with "mtx" held. */ | static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_event *event) | /* Modify the interest event mask by dropping an event if the new mask has a match in the current file status. Must be called with "mtx" held. */
static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_event *event) | {
int pwake = 0;
unsigned int revents;
epi->event.events = event->events;
epi->event.data = event->data;
revents = epi->ffd.file->f_op->poll(epi->ffd.file, NULL);
if (revents & event->events) {
spin_lock_irq(&ep->lock);
if (!ep_is_linked(&epi->rdllink)) {
list_add_tail(&epi->rdllink, &ep->rdllist);
if (waitqueue_active(&ep->wq))
wake_up_locked(&ep->wq);
if (waitqueue_active(&ep->poll_wait))
pwake++;
}
spin_unlock_irq(&ep->lock);
}
if (pwake)
ep_poll_safewake(&ep->poll_wait);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Clears the designated bits in a 32-bit data word at a local CPU system address */ | void IPCRtoLClearBits(tIpcMessage *psMessage) | /* Clears the designated bits in a 32-bit data word at a local CPU system address */
void IPCRtoLClearBits(tIpcMessage *psMessage) | {
uint16_t usLength;
usLength = (uint16_t)psMessage->uldataw1;
if (usLength == IPC_LENGTH_16_BITS)
{
*(volatile uint16_t*)psMessage->uladdress &=
~((uint16_t) psMessage->uldataw2);
}
else if (usLength == IPC_LENGTH_32_BITS)
{
*(volatile unsigned long *)psMessage->uladdress &=
~(psMessage->uldataw2);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Reads the result of a CRC operation in the EC module. */ | uint32_t CRCResultRead(uint32_t ui32Base, bool bPPResult) | /* Reads the result of a CRC operation in the EC module. */
uint32_t CRCResultRead(uint32_t ui32Base, bool bPPResult) | {
ASSERT(ui32Base == CCM0_BASE);
if (bPPResult)
{
return (HWREG(ui32Base + CCM_O_CRCRSLTPP));
}
else
{
return (HWREG(ui32Base + CCM_O_CRCSEED));
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 16-bit boundary, then ASSERT(). If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */ | UINT16 EFIAPI PciBitFieldWrite16(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value) | /* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 16-bit boundary, then ASSERT(). If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */
UINT16 EFIAPI PciBitFieldWrite16(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value) | {
return PciExpressBitFieldWrite16 (Address, StartBit, EndBit, Value);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Clear the specified Signal Flags of an active thread. */ | int32_t osSignalClear(osThreadId thread_id, int32_t signals) | /* Clear the specified Signal Flags of an active thread. */
int32_t osSignalClear(osThreadId thread_id, int32_t signals) | {
int sig, key;
if (k_is_in_isr() || (thread_id == NULL) || (!signals) ||
(signals & 0x80000000) || (signals > MAX_VALID_SIGNAL_VAL)) {
return 0x80000000;
}
osThreadDef_t *thread_def =
(osThreadDef_t *)k_thread_other_custom_data_get(
(struct k_thread *)thread_id);
key = irq_lock();
sig = thread_def->signal_results;
thread_def->signal_results &= ~(signals);
irq_unlock(key);
return sig;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* This function delays for a number of milliseconds. */ | void sha204h_delay_ms(uint16_t delay) | /* This function delays for a number of milliseconds. */
void sha204h_delay_ms(uint16_t delay) | {
sha204h_start_timer(delay, true);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* CAN Initialize a 16bit Message ID List Filter. */ | void can_filter_id_list_16bit_init(uint32_t canport, uint32_t nr, uint16_t id1, uint16_t id2, uint16_t id3, uint16_t id4, uint32_t fifo, bool enable) | /* CAN Initialize a 16bit Message ID List Filter. */
void can_filter_id_list_16bit_init(uint32_t canport, uint32_t nr, uint16_t id1, uint16_t id2, uint16_t id3, uint16_t id4, uint32_t fifo, bool enable) | {
can_filter_init(canport, nr, false, true,
((uint32_t)id1 << 16) | (uint32_t)id2,
((uint32_t)id3 << 16) | (uint32_t)id4, fifo, enable);
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Configures the PLL clock source and DM DN factor. This function must be used only when the PLL is disabled. */ | void RCC_PLLDMDNConfig(u32 plldn, u32 plldm) | /* Configures the PLL clock source and DM DN factor. This function must be used only when the PLL is disabled. */
void RCC_PLLDMDNConfig(u32 plldn, u32 plldm) | {
MODIFY_REG(RCC->PLLCFGR, (RCC_PLLCFGR_PLL_DN | RCC_PLLCFGR_PLL_DP), ((plldn << RCC_PLLCFGR_PLL_DN_Pos) | (plldm << RCC_PLLCFGR_PLL_DP_Pos)));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Internal function. Moves any memory descriptors that are on the temporary descriptor stack to heap. */ | VOID CoreFreeMemoryMapStack(VOID) | /* Internal function. Moves any memory descriptors that are on the temporary descriptor stack to heap. */
VOID CoreFreeMemoryMapStack(VOID) | {
MEMORY_MAP *Entry;
if (mFreeMapStack != 0) {
ASSERT (FALSE);
return;
}
mFreeMapStack += 1;
while (mMapDepth != 0) {
Entry = AllocateMemoryMapEntry ();
ASSERT (Entry);
mMapDepth -= 1;
if (mMapStack[mMapDepth].Link.ForwardLink != NULL) {
CopyMem (Entry, &mMapStack[mMapDepth], sizeof (MEMORY_MAP));
Entry->FromStack = FALSE;
InsertTailList (&mMapStack[mMapDepth].Link, &Entry->Link);
RemoveEntryList (&mMapStack[mMapDepth].Link);
mMapStack[mMapDepth].Link.ForwardLink = NULL;
}
}
mFreeMapStack -= 1;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Enables or disables the discontinuous mode on regular group channel for the specified ADC. */ | void ADC_DiscModeCmd(ADC_TypeDef *ADCx, FunctionalState NewState) | /* Enables or disables the discontinuous mode on regular group channel for the specified ADC. */
void ADC_DiscModeCmd(ADC_TypeDef *ADCx, FunctionalState NewState) | {
assert_param(IS_ADC_ALL_PERIPH(ADCx));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
ADCx->CR1 |= CR1_DISCEN_Set;
}
else
{
ADCx->CR1 &= CR1_DISCEN_Reset;
}
} | gcallipo/RadioDSP-Stm32f103 | C++ | Common Creative - Attribution 3.0 | 51 |
/* atl1e_phy_config - Timer Call-back @data: pointer to netdev cast into an unsigned long */ | static void atl1e_phy_config(unsigned long data) | /* atl1e_phy_config - Timer Call-back @data: pointer to netdev cast into an unsigned long */
static void atl1e_phy_config(unsigned long data) | {
struct atl1e_adapter *adapter = (struct atl1e_adapter *) data;
struct atl1e_hw *hw = &adapter->hw;
unsigned long flags;
spin_lock_irqsave(&adapter->mdio_lock, flags);
atl1e_restart_autoneg(hw);
spin_unlock_irqrestore(&adapter->mdio_lock, flags);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Wait for output to drain. This sleeps uninterruptibly because there is nothing intelligent we can do if interrupted. This means the process will be delayed in responding to the signal. */ | static void pcm_write_sync(vwsnd_dev_t *devc) | /* Wait for output to drain. This sleeps uninterruptibly because there is nothing intelligent we can do if interrupted. This means the process will be delayed in responding to the signal. */
static void pcm_write_sync(vwsnd_dev_t *devc) | {
vwsnd_port_t *wport = &devc->wport;
DECLARE_WAITQUEUE(wait, current);
unsigned long flags;
vwsnd_port_hwstate_t hwstate;
DBGEV("(devc=0x%p)\n", devc);
add_wait_queue(&wport->queue, &wait);
while (1) {
set_current_state(TASK_UNINTERRUPTIBLE);
spin_lock_irqsave(&wport->lock, flags);
{
hwstate = wport->hwstate;
}
spin_unlock_irqrestore(&wport->lock, flags);
if (hwstate == HW_STOPPED)
break;
schedule();
}
current->state = TASK_RUNNING;
remove_wait_queue(&wport->queue, &wait);
DBGPV("swstate = %d, hwstate = %d\n", wport->swstate, wport->hwstate);
DBGRV();
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* #GZlibDecompressor is an implementation of #GConverter that decompresses data compressed with zlib. */ | static void g_zlib_decompressor_iface_init(GConverterIface *iface) | /* #GZlibDecompressor is an implementation of #GConverter that decompresses data compressed with zlib. */
static void g_zlib_decompressor_iface_init(GConverterIface *iface) | {
iface->convert = g_zlib_decompressor_convert;
iface->reset = g_zlib_decompressor_reset;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* onenand_default_bbt - Select a default bad block table for the device */ | int onenand_default_bbt(struct mtd_info *mtd) | /* onenand_default_bbt - Select a default bad block table for the device */
int onenand_default_bbt(struct mtd_info *mtd) | {
struct onenand_chip *this = mtd->priv;
struct bbm_info *bbm;
this->bbm = kzalloc(sizeof(struct bbm_info), GFP_KERNEL);
if (!this->bbm)
return -ENOMEM;
bbm = this->bbm;
if (!bbm->badblock_pattern)
bbm->badblock_pattern = &largepage_memorybased;
return onenand_scan_bbt(mtd, bbm->badblock_pattern);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function will run an usb class driver. */ | rt_err_t rt_usbh_class_driver_enable(ucd_t drv, void *args) | /* This function will run an usb class driver. */
rt_err_t rt_usbh_class_driver_enable(ucd_t drv, void *args) | {
RT_ASSERT(drv != RT_NULL);
if(drv->enable != RT_NULL)
drv->enable(args);
return RT_EOK;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* The function is used to enable extern function. */ | void SysCtlWakeUpPinEnable(xtBoolean bEnable) | /* The function is used to enable extern function. */
void SysCtlWakeUpPinEnable(xtBoolean bEnable) | {
if(bEnable)
{
xHWREG(PWRCU_BAKCR) |= PWRCU_BAKCR_WUPEN;
}
else
{
xHWREG(PWRCU_BAKCR) &= ~PWRCU_BAKCR_WUPEN;
}
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Enables or disables the USART's 8x oversampling mode. */ | void USART_OverSampling8Cmd(USART_TypeDef *USARTx, FunctionalState NewState) | /* Enables or disables the USART's 8x oversampling mode. */
void USART_OverSampling8Cmd(USART_TypeDef *USARTx, FunctionalState NewState) | {
assert_param(IS_USART_ALL_PERIPH(USARTx));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
USARTx->CR1 |= USART_CR1_OVER8;
}
else
{
USARTx->CR1 &= (uint32_t)~((uint32_t)USART_CR1_OVER8);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Returns 0 if the z/VM user ID @ipvmid is allowed to connection, otherwise non-zero. */ | static int hvc_iucv_filter_connreq(u8 ipvmid[8]) | /* Returns 0 if the z/VM user ID @ipvmid is allowed to connection, otherwise non-zero. */
static int hvc_iucv_filter_connreq(u8 ipvmid[8]) | {
size_t i;
if (!hvc_iucv_filter_size)
return 0;
for (i = 0; i < hvc_iucv_filter_size; i++)
if (0 == memcmp(ipvmid, hvc_iucv_filter + (8 * i), 8))
return 0;
return 1;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Deinitializes the COMP peripheral registers to their default reset values. */ | void COMP_DeInit(void) | /* Deinitializes the COMP peripheral registers to their default reset values. */
void COMP_DeInit(void) | {
RCC_EnableAPB1PeriphReset(RCC_APB1_PERIPH_COMP, ENABLE);
RCC_EnableAPB1PeriphReset(RCC_APB1_PERIPH_COMP, DISABLE);
RCC_EnableAPB1PeriphReset(RCC_APB1_PERIPH_COMP_FILT, ENABLE);
RCC_EnableAPB1PeriphReset(RCC_APB1_PERIPH_COMP_FILT, DISABLE);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* The ".." entry can not provide the "struct fat_slot_info" informations for inode. So, this function provide the some informations only. */ | int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh, struct msdos_dir_entry **de, loff_t *i_pos) | /* The ".." entry can not provide the "struct fat_slot_info" informations for inode. So, this function provide the some informations only. */
int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh, struct msdos_dir_entry **de, loff_t *i_pos) | {
loff_t offset;
offset = 0;
*bh = NULL;
while (fat_get_short_entry(dir, &offset, bh, de) >= 0) {
if (!strncmp((*de)->name, MSDOS_DOTDOT, MSDOS_NAME)) {
*i_pos = fat_make_i_pos(dir->i_sb, *bh, *de);
return 0;
}
}
return -ENOENT;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Description: Unmap a rq previously mapped by blk_rq_map_user(). The caller must supply the original rq->bio from the blk_rq_map_user() return, since the I/O completion may have changed rq->bio. */ | int blk_rq_unmap_user(struct bio *bio) | /* Description: Unmap a rq previously mapped by blk_rq_map_user(). The caller must supply the original rq->bio from the blk_rq_map_user() return, since the I/O completion may have changed rq->bio. */
int blk_rq_unmap_user(struct bio *bio) | {
struct bio *mapped_bio;
int ret = 0, ret2;
while (bio) {
mapped_bio = bio;
if (unlikely(bio_flagged(bio, BIO_BOUNCED)))
mapped_bio = bio->bi_private;
ret2 = __blk_rq_unmap_user(mapped_bio);
if (ret2 && !ret)
ret = ret2;
mapped_bio = bio;
bio = bio->bi_next;
bio_put(mapped_bio);
}
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.