本文整理汇总了C++中pr_devel函数的典型用法代码示例。如果您正苦于以下问题:C++ pr_devel函数的具体用法?C++ pr_devel怎么用?C++ pr_devel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pr_devel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strlen
/**
* x509_request_asymmetric_key - Request a key by X.509 certificate params.
* @keyring: The keys to search.
* @subject: The name of the subject to whom the key belongs.
* @key_id: The subject key ID as a hex string.
*
* Find a key in the given keyring by subject name and key ID. These might,
* for instance, be the issuer name and the authority key ID of an X.509
* certificate that needs to be verified.
*/
struct key *x509_request_asymmetric_key(struct key *keyring,
const char *subject,
const char *key_id)
{
key_ref_t key;
size_t subject_len = strlen(subject), key_id_len = strlen(key_id);
char *id;
/* Construct an identifier "<subjname>:<keyid>". */
id = kmalloc(subject_len + 2 + key_id_len + 1, GFP_KERNEL);
if (!id)
return ERR_PTR(-ENOMEM);
memcpy(id, subject, subject_len);
id[subject_len + 0] = ':';
id[subject_len + 1] = ' ';
memcpy(id + subject_len + 2, key_id, key_id_len);
id[subject_len + 2 + key_id_len] = 0;
pr_debug("Look up: \"%s\"\n", id);
key = keyring_search(make_key_ref(keyring, 1),
&key_type_asymmetric, id);
if (IS_ERR(key))
pr_debug("Request for key '%s' err %ld\n", id, PTR_ERR(key));
kfree(id);
if (IS_ERR(key)) {
switch (PTR_ERR(key)) {
/* Hide some search errors */
case -EACCES:
case -ENOTDIR:
case -EAGAIN:
return ERR_PTR(-ENOKEY);
default:
return ERR_CAST(key);
}
}
pr_devel("<==%s() = 0 [%x]\n", __func__,
key_serial(key_ref_to_ptr(key)));
return key_ref_to_ptr(key);
}
示例2: hvsi_check_packet
static int hvsi_check_packet(struct hvsi_priv *pv)
{
u8 len, type;
/* Check header validity. If it's invalid, we ditch
* the whole buffer and hope we eventually resync
*/
if (pv->inbuf[0] < 0xfc) {
pv->inbuf_len = pv->inbuf_pktlen = 0;
return 0;
}
type = pv->inbuf[0];
len = pv->inbuf[1];
/* Packet incomplete ? */
if (pv->inbuf_len < len)
return 0;
pr_devel("[email protected]%x: Got packet type %x len %d bytes:\n",
pv->termno, type, len);
/* We have a packet, yay ! Handle it */
switch(type) {
case VS_DATA_PACKET_HEADER:
pv->inbuf_pktlen = len - 4;
pv->inbuf_cur = 4;
return 1;
case VS_CONTROL_PACKET_HEADER:
hvsi_got_control(pv);
break;
case VS_QUERY_PACKET_HEADER:
hvsi_got_query(pv);
break;
case VS_QUERY_RESPONSE_PACKET_HEADER:
hvsi_got_response(pv);
break;
}
/* Swallow packet and retry */
pv->inbuf_len -= len;
memmove(pv->inbuf, &pv->inbuf[len], pv->inbuf_len);
return 1;
}
示例3: write_node
static int write_node(u64 n1, u64 n2, u64 n3, u64 n4, u64 v1, u64 v2)
{
int result;
result = create_node(n1, n2, n3, n4, v1, v2);
if (!result)
return 0;
result = lv1_write_repository_node(n1, n2, n3, n4, v1, v2);
if (result) {
pr_devel("%s:%d: lv1_write_repository_node failed: %s\n",
__func__, __LINE__, ps3_result(result));
return -ENOENT;
}
return 0;
}
示例4: ics_opal_set_affinity
static int ics_opal_set_affinity(struct irq_data *d,
const struct cpumask *cpumask,
bool force)
{
unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d);
int16_t server;
int8_t priority;
int64_t rc;
int wanted_server;
if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)
return -1;
rc = opal_get_xive(hw_irq, &server, &priority);
if (rc != OPAL_SUCCESS) {
pr_err("%s: opal_set_xive(irq=%d [hw 0x%x] server=%x)"
" error %lld\n",
__func__, d->irq, hw_irq, server, rc);
return -1;
}
wanted_server = xics_get_irq_server(d->irq, cpumask, 1);
if (wanted_server < 0) {
char cpulist[128];
cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask);
pr_warning("%s: No online cpus in the mask %s for irq %d\n",
__func__, cpulist, d->irq);
return -1;
}
server = ics_opal_mangle_server(wanted_server);
pr_devel("ics-hal: set-affinity irq %d [hw 0x%x] server: 0x%x/0x%x\n",
d->irq, hw_irq, wanted_server, server);
rc = opal_set_xive(hw_irq, server, priority);
if (rc != OPAL_SUCCESS) {
pr_err("%s: opal_set_xive(irq=%d [hw 0x%x] server=%x)"
" error %lld\n",
__func__, d->irq, hw_irq, server, rc);
return -1;
}
return 0;
}
示例5: pkcs7_note_signed_info
/*
* Note a signature information block
*/
int pkcs7_note_signed_info(void *context, size_t hdrlen,
unsigned char tag,
const void *value, size_t vlen)
{
struct pkcs7_parse_context *ctx = context;
struct pkcs7_signed_info *sinfo = ctx->sinfo;
struct asymmetric_key_id *kid;
if (ctx->msg->data_type == OID_msIndirectData && !sinfo->authattrs) {
pr_warn("Authenticode requires AuthAttrs\n");
return -EBADMSG;
}
/* Generate cert issuer + serial number key ID */
if (!ctx->expect_skid) {
kid = asymmetric_key_generate_id(ctx->raw_serial,
ctx->raw_serial_size,
ctx->raw_issuer,
ctx->raw_issuer_size);
} else {
kid = asymmetric_key_generate_id(ctx->raw_skid,
ctx->raw_skid_size,
"", 0);
}
if (IS_ERR(kid))
return PTR_ERR(kid);
pr_devel("SINFO KID: %u [%*phN]\n", kid->len, kid->len, kid->data);
sinfo->sig->auth_ids[0] = kid;
sinfo->index = ++ctx->sinfo_index;
*ctx->ppsinfo = sinfo;
ctx->ppsinfo = &sinfo->next;
ctx->sinfo = kzalloc(sizeof(struct pkcs7_signed_info), GFP_KERNEL);
if (!ctx->sinfo)
return -ENOMEM;
ctx->sinfo->sig = kzalloc(sizeof(struct public_key_signature),
GFP_KERNEL);
if (!ctx->sinfo->sig)
return -ENOMEM;
return 0;
}
示例6: hvsi_cd_change
static void hvsi_cd_change(struct hvsi_priv *pv, int cd)
{
if (cd)
pv->mctrl |= TIOCM_CD;
else {
pv->mctrl &= ~TIOCM_CD;
/* We copy the existing hvsi driver semantics
* here which are to trigger a hangup when
* we get a carrier loss.
* Closing our connection to the server will
* do just that.
*/
if (!pv->is_console && pv->opened) {
pr_devel("[email protected]%x Carrier lost, hanging up !\n",
pv->termno);
hvsi_send_close(pv);
}
}
}
示例7: ignore_mar_store
static ssize_t ignore_mar_store(struct device *dev, struct device_attribute *attr, const char *buf,
size_t size) {
unsigned int data;
if(sscanf(buf, "%u\n", &data) == 1) {
pr_devel("%s: %u \n", __FUNCTION__, data);
if (data == 1) {
ignore_margin = true;
} else if (data == 0) {
ignore_margin = false;
} else {
pr_info("%s: invalid input range %u\n", __FUNCTION__, data);
}
} else {
pr_info("%s: invalid input\n", __FUNCTION__);
}
return size;
}
示例8: rmnet_check_fifo
static void rmnet_check_fifo(struct net_device *dev)
{
#if fcENABLE_FLOW_CTRL
if (bRmnetFifoFull)
{
struct rmnet_private *p = netdev_priv(dev);
int iAvail = smd_write_avail(p->ch);
if (iAvail > (smd_total_fifo_size(p->ch) / 2))
{
pr_devel(LOG_TAG1 "%[email protected]%d: tx resumed\n", __func__, __LINE__);
if (netif_carrier_ok(dev))
netif_wake_queue(dev);
else
pr_err(LOG_TAG1 "%[email protected]%d: no netif_carrier_ok\n", __func__, __LINE__);
bRmnetFifoFull = 0;
}
}
#endif
}
示例9: pfq_computation_init
int
pfq_computation_init(struct pfq_computation_tree *comp)
{
size_t n;
for (n = 0; n < comp->size; n++)
{
if (comp->node[n].init) {
pr_devel("[PFQ] %zu: initializing computation %pF...\n", n, comp->node[n].init);
if (comp->node[n].init( &comp->node[n].fun ) < 0) {
printk(KERN_INFO "[PFQ] computation_init: error in function (%zu)!\n", n);
return -EPERM;
}
comp->node[n].initialized = true;
}
}
return 0;
}
示例10: pfq_free_sk_filter
void
pfq_free_sk_filter(struct sk_filter *filter)
{
struct sock sk;
int rv;
sock_init_data(NULL, &sk);
sk.sk_filter = NULL;
atomic_set(&sk.sk_omem_alloc, 0);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
sock_reset_flag(&sk, SOCK_FILTER_LOCKED);
#endif
sk.sk_filter = filter;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,8) && LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0))
if ((rv = __sk_detach_filter(&sk, sock_owned_by_user(&sk))))
#else
if ((rv = sk_detach_filter(&sk)))
#endif
pr_devel("[PFQ] BPF: sk_detach_filter error: (%d)!\n", rv);
}
示例11: ics_opal_unmask_irq
static void ics_opal_unmask_irq(struct irq_data *d)
{
unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d);
int64_t rc;
int server;
pr_devel("ics-hal: unmask virq %d [hw 0x%x]\n", d->irq, hw_irq);
if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)
return;
server = xics_get_irq_server(d->irq, d->affinity, 0);
server = ics_opal_mangle_server(server);
rc = opal_set_xive(hw_irq, server, DEFAULT_PRIORITY);
if (rc != OPAL_SUCCESS)
pr_err("%s: opal_set_xive(irq=%d [hw 0x%x] server=%x)"
" error %lld\n",
__func__, d->irq, hw_irq, server, rc);
}
示例12: ncp6335b_parse_dt
static int ncp6335b_parse_dt(struct device *dev,
struct ncp6335b_platform_data *pdata)
{
struct device_node *np = dev->of_node;
char *str = NULL;
int ret;
ret = of_property_read_string(np, "ncp6335b,dev_name", (const char **)&str);
if (ret) {
pr_err("ncp6335b: fail to read, ncp6335b_parse_dt\n");
return -ENODEV;
}
if (str)
pr_devel("ncp6335b: DT dev name = %s\n", str);
dev->platform_data = pdata;
return 0;
}
示例13: kvmppc_xive_native_cleanup_vcpu
void kvmppc_xive_native_cleanup_vcpu(struct kvm_vcpu *vcpu)
{
struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
int i;
if (!kvmppc_xive_enabled(vcpu))
return;
if (!xc)
return;
pr_devel("native_cleanup_vcpu(cpu=%d)\n", xc->server_num);
/* Ensure no interrupt is still routed to that VP */
xc->valid = false;
kvmppc_xive_disable_vcpu_interrupts(vcpu);
/* Disable the VP */
xive_native_disable_vp(xc->vp_id);
/* Free the queues & associated interrupts */
for (i = 0; i < KVMPPC_XIVE_Q_COUNT; i++) {
/* Free the escalation irq */
if (xc->esc_virq[i]) {
free_irq(xc->esc_virq[i], vcpu);
irq_dispose_mapping(xc->esc_virq[i]);
kfree(xc->esc_virq_names[i]);
xc->esc_virq[i] = 0;
}
/* Free the queue */
kvmppc_xive_native_cleanup_queue(vcpu, i);
}
/* Free the VP */
kfree(xc);
/* Cleanup the vcpu */
vcpu->arch.irq_type = KVMPPC_IRQ_DEFAULT;
vcpu->arch.xive_vcpu = NULL;
}
示例14: pnv_smp_kick_cpu
int __devinit pnv_smp_kick_cpu(int nr)
{
unsigned int pcpu = get_hard_smp_processor_id(nr);
unsigned long start_here = __pa(*((unsigned long *)
generic_secondary_smp_init));
long rc;
BUG_ON(nr < 0 || nr >= NR_CPUS);
/* On OPAL v2 the CPU are still spinning inside OPAL itself,
* get them back now
*/
if (firmware_has_feature(FW_FEATURE_OPALv2)) {
pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n", nr, pcpu);
rc = opal_start_cpu(pcpu, start_here);
if (rc != OPAL_SUCCESS)
pr_warn("OPAL Error %ld starting CPU %d\n",
rc, nr);
}
return smp_generic_kick_cpu(nr);
}
示例15: sbecom_proc_get_brdinfo
static void sbecom_proc_get_brdinfo(ci_t *ci, struct sbe_brd_info *bip)
{
hdw_info_t *hi = &hdw_info[ci->brdno];
u_int8_t *bsn = 0;
switch (hi->promfmt)
{
case PROM_FORMAT_TYPE1:
bsn = (u_int8_t *) hi->mfg_info.pft1.Serial;
break;
case PROM_FORMAT_TYPE2:
bsn = (u_int8_t *) hi->mfg_info.pft2.Serial;
break;
}
sbecom_get_brdinfo (ci, bip, bsn);
pr_devel(">> sbecom_get_brdinfo: returned, first_if %p <%s> last_if %p <%s>\n",
bip->first_iname, bip->first_iname,
bip->last_iname, bip->last_iname);
}