unique_id
int64
13
189k
target
int64
0
1
code
stringlengths
20
241k
__index_level_0__
int64
0
18.9k
29,820
0
cifs_match_super(struct super_block *sb, void *data) { struct cifs_mnt_data *mnt_data = (struct cifs_mnt_data *)data; struct smb_vol *volume_info; struct cifs_sb_info *cifs_sb; struct TCP_Server_Info *tcp_srv; struct cifs_ses *ses; struct cifs_tcon *tcon; struct tcon_link *tlink; int rc = 0; spin_lock(&cifs_tcp_ses_lock); cifs_sb = CIFS_SB(sb); tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb)); if (IS_ERR(tlink)) { spin_unlock(&cifs_tcp_ses_lock); return rc; } tcon = tlink_tcon(tlink); ses = tcon->ses; tcp_srv = ses->server; volume_info = mnt_data->vol; if (!match_server(tcp_srv, volume_info) || !match_session(ses, volume_info) || !match_tcon(tcon, volume_info->UNC)) { rc = 0; goto out; } rc = compare_mount_options(sb, mnt_data); out: spin_unlock(&cifs_tcp_ses_lock); cifs_put_tlink(tlink); return rc; }
4,500
90,397
0
static inline void megasas_remove_scsi_device(struct scsi_device *sdev) { sdev_printk(KERN_INFO, sdev, "SCSI device is removed\n"); scsi_remove_device(sdev); scsi_device_put(sdev); }
4,501
171,987
0
void handle_rc_features() { btrc_remote_features_t rc_features = BTRC_FEAT_NONE; bt_bdaddr_t rc_addr; bdcpy(rc_addr.address, btif_rc_cb.rc_addr); if (btif_rc_cb.rc_features & BTA_AV_FEAT_BROWSE) { rc_features |= BTRC_FEAT_BROWSE; } if ( (btif_rc_cb.rc_features & BTA_AV_FEAT_ADV_CTRL) && (btif_rc_cb.rc_features & BTA_AV_FEAT_RCTG)) { rc_features |= BTRC_FEAT_ABSOLUTE_VOLUME; } if (btif_rc_cb.rc_features & BTA_AV_FEAT_METADATA) { rc_features |= BTRC_FEAT_METADATA; } BTIF_TRACE_DEBUG("%s: rc_features=0x%x", __FUNCTION__, rc_features); HAL_CBACK(bt_rc_callbacks, remote_features_cb, &rc_addr, rc_features) #if (AVRC_ADV_CTRL_INCLUDED == TRUE) BTIF_TRACE_DEBUG("Checking for feature flags in btif_rc_handler with label %d", btif_rc_cb.rc_vol_label); if(btif_rc_cb.rc_features & BTA_AV_FEAT_ADV_CTRL && btif_rc_cb.rc_features & BTA_AV_FEAT_RCTG) { rc_transaction_t *p_transaction=NULL; bt_status_t status = BT_STATUS_NOT_READY; if(MAX_LABEL==btif_rc_cb.rc_vol_label) { status=get_transaction(&p_transaction); } else { p_transaction=get_transaction_by_lbl(btif_rc_cb.rc_vol_label); if(NULL!=p_transaction) { BTIF_TRACE_DEBUG("register_volumechange already in progress for label %d", btif_rc_cb.rc_vol_label); return; } else status=get_transaction(&p_transaction); } if(BT_STATUS_SUCCESS == status && NULL!=p_transaction) { btif_rc_cb.rc_vol_label=p_transaction->lbl; register_volumechange(btif_rc_cb.rc_vol_label); } } #endif }
4,502
143,642
0
void RenderWidgetHostImpl::GetWebScreenInfo(blink::WebScreenInfo* result) { TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::GetWebScreenInfo"); if (view_) view_->GetScreenInfo(result); else RenderWidgetHostViewBase::GetDefaultScreenInfo(result); latency_tracker_.set_device_scale_factor(result->deviceScaleFactor); if (scale_input_to_viewport_) input_router_->SetDeviceScaleFactor(result->deviceScaleFactor); }
4,503
31,007
0
static int do_set_master(struct net_device *dev, int ifindex) { struct net_device *upper_dev = netdev_master_upper_dev_get(dev); const struct net_device_ops *ops; int err; if (upper_dev) { if (upper_dev->ifindex == ifindex) return 0; ops = upper_dev->netdev_ops; if (ops->ndo_del_slave) { err = ops->ndo_del_slave(upper_dev, dev); if (err) return err; } else { return -EOPNOTSUPP; } } if (ifindex) { upper_dev = __dev_get_by_index(dev_net(dev), ifindex); if (!upper_dev) return -EINVAL; ops = upper_dev->netdev_ops; if (ops->ndo_add_slave) { err = ops->ndo_add_slave(upper_dev, dev); if (err) return err; } else { return -EOPNOTSUPP; } } return 0; }
4,504
69,950
0
void asyncCloseClientOnOutputBufferLimitReached(client *c) { serverAssert(c->reply_bytes < SIZE_MAX-(1024*64)); if (c->reply_bytes == 0 || c->flags & CLIENT_CLOSE_ASAP) return; if (checkClientOutputBufferLimits(c)) { sds client = catClientInfoString(sdsempty(),c); freeClientAsync(c); serverLog(LL_WARNING,"Client %s scheduled to be closed ASAP for overcoming of output buffer limits.", client); sdsfree(client); } }
4,505
181,360
1
static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port) { struct usb_serial *serial = port->serial; struct usb_serial_port *wport; wport = serial->port[1]; tty_port_tty_set(&wport->port, tty); return usb_serial_generic_open(tty, port); }
4,506
151,954
0
void RenderFrameHostImpl::GetAudioContextManager( blink::mojom::AudioContextManagerRequest request) { AudioContextManagerImpl::Create(this, std::move(request)); }
4,507
82,797
0
static void agraph_print_edge_dot(RANode *from, RANode *to, void *user) { r_cons_printf ("\"%s\" -> \"%s\"\n", from->title, to->title); }
4,508
126,001
0
void AllViewsStoppedLoadingObserver::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { if (!automation_) { delete this; return; } if (type == content::NOTIFICATION_LOAD_STOP) { CheckIfNoMorePendingLoads(); } else if (type == chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN) { AutomationJSONReply(automation_, reply_message_.release()).SendSuccess(NULL); delete this; } }
4,509
102,865
0
Color RenderMenuList::itemBackgroundColor(unsigned listIndex) const { const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems(); if (listIndex >= listItems.size()) return style()->visitedDependentColor(CSSPropertyBackgroundColor); HTMLElement* element = listItems[listIndex]; Color backgroundColor; if (element->renderStyle()) backgroundColor = element->renderStyle()->visitedDependentColor(CSSPropertyBackgroundColor); if (!backgroundColor.hasAlpha()) return backgroundColor; backgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor).blend(backgroundColor); if (!backgroundColor.hasAlpha()) return backgroundColor; return Color(Color::white).blend(backgroundColor); }
4,510
110,009
0
void HTMLSelectElement::dispatchBlurEvent(PassRefPtr<Node> newFocusedNode) { if (usesMenuList()) dispatchChangeEventForMenuList(); HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedNode); }
4,511
136,184
0
void Document::updateLayoutTree(StyleRecalcChange change) { ASSERT(isMainThread()); ScriptForbiddenScope forbidScript; if (!view() || !isActive()) return; if (change != Force && !needsLayoutTreeUpdate()) return; if (inStyleRecalc()) return; RELEASE_ASSERT(!view()->isInPerformLayout()); RELEASE_ASSERT(!view()->isPainting()); RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); TRACE_EVENT_BEGIN1("blink,devtools.timeline", "UpdateLayoutTree", "beginData", InspectorRecalculateStylesEvent::data(frame())); TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateLayoutTree"); m_styleRecalcElementCounter = 0; InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRecalculateStyle(this); DocumentAnimations::updateAnimationTimingIfNeeded(*this); evaluateMediaQueryListIfNeeded(); updateUseShadowTreesIfNeeded(); updateDistribution(); updateStyleInvalidationIfNeeded(); updateStyle(change); notifyLayoutTreeOfSubtreeChanges(); if (hoverNode() && !hoverNode()->layoutObject() && frame()) frame()->eventHandler().dispatchFakeMouseMoveEventSoon(); if (m_focusedElement && !m_focusedElement->isFocusable()) clearFocusedElementSoon(); layoutView()->clearHitTestCache(); ASSERT(!DocumentAnimations::needsAnimationTimingUpdate(*this)); TRACE_EVENT_END1("blink,devtools.timeline", "UpdateLayoutTree", "elementCount", m_styleRecalcElementCounter); InspectorInstrumentation::didRecalculateStyle(cookie, m_styleRecalcElementCounter); #if ENABLE(ASSERT) assertLayoutTreeUpdated(*this); #endif }
4,512
109,634
0
void Document::didAssociateFormControl(Element* element) { if (!frame() || !frame()->page()) return; m_associatedFormControls.add(element); if (!m_didAssociateFormControlsTimer.isActive()) m_didAssociateFormControlsTimer.startOneShot(0); }
4,513
176,761
0
status_t Parcel::readStrongBinder(sp<IBinder>* val) const { return unflatten_binder(ProcessState::self(), *this, val); }
4,514
151,918
0
void RenderFrameHostImpl::DidChangeName(const std::string& name, const std::string& unique_name) { if (GetParent() != nullptr) { DCHECK(!unique_name.empty()); } TRACE_EVENT2("navigation", "RenderFrameHostImpl::OnDidChangeName", "frame_tree_node", frame_tree_node_->frame_tree_node_id(), "name length", name.length()); std::string old_name = frame_tree_node()->frame_name(); frame_tree_node()->SetFrameName(name, unique_name); if (old_name.empty() && !name.empty()) frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame(); delegate_->DidChangeName(this, name); }
4,515
179,355
1
static int l2tp_ip6_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)uaddr; struct sock *sk = sock->sk; struct ipv6_pinfo *np = inet6_sk(sk); struct l2tp_ip6_sock *lsk = l2tp_ip6_sk(sk); lsa->l2tp_family = AF_INET6; lsa->l2tp_flowinfo = 0; lsa->l2tp_scope_id = 0; if (peer) { if (!lsk->peer_conn_id) return -ENOTCONN; lsa->l2tp_conn_id = lsk->peer_conn_id; lsa->l2tp_addr = np->daddr; if (np->sndflow) lsa->l2tp_flowinfo = np->flow_label; } else { if (ipv6_addr_any(&np->rcv_saddr)) lsa->l2tp_addr = np->saddr; else lsa->l2tp_addr = np->rcv_saddr; lsa->l2tp_conn_id = lsk->conn_id; } if (ipv6_addr_type(&lsa->l2tp_addr) & IPV6_ADDR_LINKLOCAL) lsa->l2tp_scope_id = sk->sk_bound_dev_if; *uaddr_len = sizeof(*lsa); return 0; }
4,516
144,553
0
gfx::Rect WebContentsImpl::GetViewBounds() { return view_->GetViewBounds(); }
4,517
113,939
0
void RegistrationManager::DoRegisterId(const invalidation::ObjectId& id) { DCHECK(CalledOnValidThread()); invalidation_client_->Register(id); RegistrationStatusMap::const_iterator it = registration_statuses_.find(id); if (it == registration_statuses_.end()) { DLOG(FATAL) << "DoRegisterId called on " << ObjectIdToString(id) << " which is not in the registration map"; return; } it->second->state = invalidation::InvalidationListener::REGISTERED; it->second->last_registration_request = base::Time::Now(); }
4,518
44,153
0
void pipe_unlock(struct pipe_inode_info *pipe) { if (pipe->files) mutex_unlock(&pipe->mutex); }
4,519
112,985
0
DownloadFileManager::DownloadFileManager(DownloadFileFactory* factory) : download_file_factory_(factory) { if (download_file_factory_ == NULL) download_file_factory_.reset(new DownloadFileFactoryImpl); }
4,520
42,471
0
static void md_start_sync(struct work_struct *ws) { struct mddev *mddev = container_of(ws, struct mddev, del_work); mddev->sync_thread = md_register_thread(md_do_sync, mddev, "resync"); if (!mddev->sync_thread) { printk(KERN_ERR "%s: could not start resync" " thread...\n", mdname(mddev)); /* leave the spares where they are, it shouldn't hurt */ clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); wake_up(&resync_wait); if (test_and_clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery)) if (mddev->sysfs_action) sysfs_notify_dirent_safe(mddev->sysfs_action); } else md_wakeup_thread(mddev->sync_thread); sysfs_notify_dirent_safe(mddev->sysfs_action); md_new_event(mddev); }
4,521
147,594
0
void V8TestObject::NullableLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_nullableLongMethod"); test_object_v8_internal::NullableLongMethodMethod(info); }
4,522
94,518
0
static void l2cap_sock_cleanup_listen(struct sock *parent) { struct sock *sk; BT_DBG("parent %p", parent); /* Close not yet accepted channels */ while ((sk = bt_accept_dequeue(parent, NULL))) { struct l2cap_chan *chan = l2cap_pi(sk)->chan; l2cap_chan_lock(chan); __clear_chan_timer(chan); l2cap_chan_close(chan, ECONNRESET); l2cap_chan_unlock(chan); l2cap_sock_kill(sk); } }
4,523
108,045
0
void CreateProgramInfo(GLuint client_id, GLuint service_id) { program_manager()->CreateProgramInfo(client_id, service_id); }
4,524
132,942
0
void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type, InputEventAckState ack_result) { if (touch_editing_client_) touch_editing_client_->GestureEventAck(gesture_event_type); }
4,525
158,836
0
void Browser::OnDidBlockFramebust(content::WebContents* web_contents, const GURL& url) { TabSpecificContentSettings* content_settings = TabSpecificContentSettings::FromWebContents(web_contents); DCHECK(content_settings); content_settings->OnFramebustBlocked( url, FramebustBlockTabHelper::ClickCallback()); }
4,526
158,011
0
blink::WebView* RenderViewImpl::webview() { return webview_; }
4,527
22,993
0
static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) { __be32 *p; int status = 0; *res = 1024; if (unlikely(bitmap[0] & (FATTR4_WORD0_MAXREAD - 1U))) return -EIO; if (likely(bitmap[0] & FATTR4_WORD0_MAXREAD)) { uint64_t maxread; READ_BUF(8); READ64(maxread); if (maxread > 0x7FFFFFFF) maxread = 0x7FFFFFFF; *res = (uint32_t)maxread; bitmap[0] &= ~FATTR4_WORD0_MAXREAD; } dprintk("%s: maxread=%lu\n", __func__, (unsigned long)*res); return status; }
4,528
92,520
0
static inline u64 default_cfs_period(void) { return 100000000ULL; }
4,529
116,993
0
void GestureSequence::AppendClickGestureEvent(const GesturePoint& point, Gestures* gestures) { gestures->push_back(linked_ptr<GestureEvent>(new GestureEvent( ui::ET_GESTURE_TAP, point.first_touch_position().x(), point.first_touch_position().y(), flags_, base::Time::FromDoubleT(point.last_touch_time()), 0.f, 0.f))); }
4,530
174,331
0
void IPCThreadState::restoreCallingIdentity(int64_t token) { mCallingUid = (int)(token>>32); mCallingPid = (int)token; }
4,531
116,947
0
void IndexedDBDispatcher::OnSuccessStringList( int32 thread_id, int32 response_id, const std::vector<string16>& value) { DCHECK_EQ(thread_id, CurrentWorkerId()); WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); if (!callbacks) return; WebDOMStringList string_list; for (std::vector<string16>::const_iterator it = value.begin(); it != value.end(); ++it) string_list.append(*it); callbacks->onSuccess(string_list); pending_callbacks_.Remove(response_id); }
4,532
142,194
0
explicit LocalTestVolume(const std::string& name) : TestVolume(name) {}
4,533
165,365
0
void StoragePartitionImpl::QuotaManagedDataDeletionHelper::ClearDataOnIOThread( const scoped_refptr<storage::QuotaManager>& quota_manager, const base::Time begin, const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy, const StoragePartition::OriginMatcherFunction& origin_matcher, bool perform_storage_cleanup) { IncrementTaskCountOnIO(); base::RepeatingClosure decrement_callback = base::BindRepeating( &QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO, base::Unretained(this)); if (quota_storage_remove_mask_ & QUOTA_MANAGED_STORAGE_MASK_PERSISTENT) { IncrementTaskCountOnIO(); quota_manager->GetOriginsModifiedSince( blink::mojom::StorageType::kPersistent, begin, base::BindOnce(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, base::Unretained(this), base::RetainedRef(quota_manager), special_storage_policy, origin_matcher, perform_storage_cleanup, decrement_callback)); } if (quota_storage_remove_mask_ & QUOTA_MANAGED_STORAGE_MASK_TEMPORARY) { IncrementTaskCountOnIO(); quota_manager->GetOriginsModifiedSince( blink::mojom::StorageType::kTemporary, begin, base::BindOnce(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, base::Unretained(this), base::RetainedRef(quota_manager), special_storage_policy, origin_matcher, perform_storage_cleanup, decrement_callback)); } if (quota_storage_remove_mask_ & QUOTA_MANAGED_STORAGE_MASK_SYNCABLE) { IncrementTaskCountOnIO(); quota_manager->GetOriginsModifiedSince( blink::mojom::StorageType::kSyncable, begin, base::BindOnce(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, base::Unretained(this), base::RetainedRef(quota_manager), special_storage_policy, origin_matcher, perform_storage_cleanup, decrement_callback)); } DecrementTaskCountOnIO(); }
4,534
157,009
0
void WebMediaPlayerMS::SetSinkId( const blink::WebString& sink_id, blink::WebSetSinkIdCallbacks* web_callback) { DVLOG(1) << __func__; DCHECK(thread_checker_.CalledOnValidThread()); const media::OutputDeviceStatusCB callback = media::ConvertToOutputDeviceStatusCB(web_callback); if (audio_renderer_) { audio_renderer_->SwitchOutputDevice(sink_id.Utf8(), callback); } else { callback.Run(media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL); } }
4,535
95,269
0
static int xconvfetch_lookup(struct conversations_state *statep, conversation_id_t cid, modseq_t ifchangedsince, hash_table *wanted_cids, strarray_t *folder_list) { const char *key = conversation_id_encode(cid); conversation_t *conv = NULL; conv_folder_t *folder; int r; r = conversation_load(statep, cid, &conv); if (r) return r; if (!conv) goto out; if (!conv->exists) goto out; /* output the metadata for this conversation */ { struct dlist *dl = dlist_newlist(NULL, ""); dlist_setatom(dl, "", "MODSEQ"); do_one_xconvmeta(statep, cid, conv, dl); dlist_free(&dl); } if (ifchangedsince >= conv->modseq) goto out; hash_insert(key, (void *)1, wanted_cids); for (folder = conv->folders; folder; folder = folder->next) { /* no contents */ if (!folder->exists) continue; /* finally, something worth looking at */ strarray_add(folder_list, strarray_nth(statep->folder_names, folder->number)); } out: conversation_free(conv); return 0; }
4,536
113,407
0
void WebProcessProxy::pagePreferencesChanged(WebKit::WebPageProxy *page) { #if PLATFORM(MAC) if (pageIsProcessSuppressible(page)) m_processSuppressiblePages.add(page->pageID()); else m_processSuppressiblePages.remove(page->pageID()); updateProcessSuppressionState(); #else UNUSED_PARAM(page); #endif }
4,537
158,800
0
HTMLImportsController::HTMLImportsController(Document& master) : root_(HTMLImportTreeRoot::Create(&master)) {}
4,538
157,789
0
ukm::SourceId WebContentsImpl::GetUkmSourceIdForLastCommittedSource() const { return last_committed_source_id_; }
4,539
170,042
0
xsltRegisterPersistRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT) { if ((ctxt == NULL) || (RVT == NULL)) return(-1); RVT->next = (xmlNodePtr) ctxt->persistRVT; if (ctxt->persistRVT != NULL) ctxt->persistRVT->prev = (xmlNodePtr) RVT; ctxt->persistRVT = RVT; return(0); }
4,540
17,788
0
ProcCreateCursor(ClientPtr client) { CursorPtr pCursor; PixmapPtr src; PixmapPtr msk; unsigned char *srcbits; unsigned char *mskbits; unsigned short width, height; long n; CursorMetricRec cm; int rc; REQUEST(xCreateCursorReq); REQUEST_SIZE_MATCH(xCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); rc = dixLookupResourceByType((void **) &src, stuff->source, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->source; return rc; } if (src->drawable.depth != 1) return (BadMatch); /* Find and validate cursor mask pixmap, if one is provided */ if (stuff->mask != None) { rc = dixLookupResourceByType((void **) &msk, stuff->mask, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->mask; return rc; } if (src->drawable.width != msk->drawable.width || src->drawable.height != msk->drawable.height || src->drawable.depth != 1 || msk->drawable.depth != 1) return BadMatch; } else msk = NULL; width = src->drawable.width; height = src->drawable.height; if (stuff->x > width || stuff->y > height) return BadMatch; srcbits = calloc(BitmapBytePad(width), height); if (!srcbits) return BadAlloc; n = BitmapBytePad(width) * height; mskbits = malloc(n); if (!mskbits) { free(srcbits); return BadAlloc; } (*src->drawable.pScreen->GetImage) ((DrawablePtr) src, 0, 0, width, height, XYPixmap, 1, (void *) srcbits); if (msk == (PixmapPtr) NULL) { unsigned char *bits = mskbits; while (--n >= 0) *bits++ = ~0; } else { /* zeroing the (pad) bits helps some ddx cursor handling */ memset((char *) mskbits, 0, n); (*msk->drawable.pScreen->GetImage) ((DrawablePtr) msk, 0, 0, width, height, XYPixmap, 1, (void *) mskbits); } cm.width = width; cm.height = height; cm.xhot = stuff->x; cm.yhot = stuff->y; rc = AllocARGBCursor(srcbits, mskbits, NULL, &cm, stuff->foreRed, stuff->foreGreen, stuff->foreBlue, stuff->backRed, stuff->backGreen, stuff->backBlue, &pCursor, client, stuff->cid); if (rc != Success) goto bail; if (!AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) { rc = BadAlloc; goto bail; } return Success; bail: free(srcbits); free(mskbits); return rc; }
4,541
96,540
0
void mbedtls_ecdsa_init( mbedtls_ecdsa_context *ctx ) { mbedtls_ecp_keypair_init( ctx ); }
4,542
44,671
0
bool file_exists(const char *f) { struct stat statbuf; return stat(f, &statbuf) == 0; }
4,543
34,015
0
static void xen_netbk_rx_action(struct xen_netbk *netbk) { struct xenvif *vif = NULL, *tmp; s8 status; u16 irq, flags; struct xen_netif_rx_response *resp; struct sk_buff_head rxq; struct sk_buff *skb; LIST_HEAD(notify); int ret; int nr_frags; int count; unsigned long offset; struct skb_cb_overlay *sco; struct netrx_pending_operations npo = { .copy = netbk->grant_copy_op, .meta = netbk->meta, }; skb_queue_head_init(&rxq); count = 0; while ((skb = skb_dequeue(&netbk->rx_queue)) != NULL) { vif = netdev_priv(skb->dev); nr_frags = skb_shinfo(skb)->nr_frags; sco = (struct skb_cb_overlay *)skb->cb; sco->meta_slots_used = netbk_gop_skb(skb, &npo); count += nr_frags + 1; __skb_queue_tail(&rxq, skb); /* Filled the batch queue? */ if (count + MAX_SKB_FRAGS >= XEN_NETIF_RX_RING_SIZE) break; } BUG_ON(npo.meta_prod > ARRAY_SIZE(netbk->meta)); if (!npo.copy_prod) return; BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op)); gnttab_batch_copy(netbk->grant_copy_op, npo.copy_prod); while ((skb = __skb_dequeue(&rxq)) != NULL) { sco = (struct skb_cb_overlay *)skb->cb; vif = netdev_priv(skb->dev); if (netbk->meta[npo.meta_cons].gso_size && vif->gso_prefix) { resp = RING_GET_RESPONSE(&vif->rx, vif->rx.rsp_prod_pvt++); resp->flags = XEN_NETRXF_gso_prefix | XEN_NETRXF_more_data; resp->offset = netbk->meta[npo.meta_cons].gso_size; resp->id = netbk->meta[npo.meta_cons].id; resp->status = sco->meta_slots_used; npo.meta_cons++; sco->meta_slots_used--; } vif->dev->stats.tx_bytes += skb->len; vif->dev->stats.tx_packets++; status = netbk_check_gop(vif, sco->meta_slots_used, &npo); if (sco->meta_slots_used == 1) flags = 0; else flags = XEN_NETRXF_more_data; if (skb->ip_summed == CHECKSUM_PARTIAL) /* local packet? */ flags |= XEN_NETRXF_csum_blank | XEN_NETRXF_data_validated; else if (skb->ip_summed == CHECKSUM_UNNECESSARY) /* remote but checksummed. */ flags |= XEN_NETRXF_data_validated; offset = 0; resp = make_rx_response(vif, netbk->meta[npo.meta_cons].id, status, offset, netbk->meta[npo.meta_cons].size, flags); if (netbk->meta[npo.meta_cons].gso_size && !vif->gso_prefix) { struct xen_netif_extra_info *gso = (struct xen_netif_extra_info *) RING_GET_RESPONSE(&vif->rx, vif->rx.rsp_prod_pvt++); resp->flags |= XEN_NETRXF_extra_info; gso->u.gso.size = netbk->meta[npo.meta_cons].gso_size; gso->u.gso.type = XEN_NETIF_GSO_TYPE_TCPV4; gso->u.gso.pad = 0; gso->u.gso.features = 0; gso->type = XEN_NETIF_EXTRA_TYPE_GSO; gso->flags = 0; } netbk_add_frag_responses(vif, status, netbk->meta + npo.meta_cons + 1, sco->meta_slots_used); RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&vif->rx, ret); irq = vif->irq; if (ret && list_empty(&vif->notify_list)) list_add_tail(&vif->notify_list, &notify); xenvif_notify_tx_completion(vif); xenvif_put(vif); npo.meta_cons += sco->meta_slots_used; dev_kfree_skb(skb); } list_for_each_entry_safe(vif, tmp, &notify, notify_list) { notify_remote_via_irq(vif->irq); list_del_init(&vif->notify_list); } /* More work to do? */ if (!skb_queue_empty(&netbk->rx_queue) && !timer_pending(&netbk->net_timer)) xen_netbk_kick_thread(netbk); }
4,544
72,005
0
static double GetOpacityPixel(PolygonInfo *polygon_info,const double mid, const MagickBooleanType fill,const FillRule fill_rule,const ssize_t x, const ssize_t y,double *stroke_opacity) { double alpha, beta, distance, subpath_opacity; PointInfo delta; register EdgeInfo *p; register const PointInfo *q; register ssize_t i; ssize_t j, winding_number; /* Compute fill & stroke opacity for this (x,y) point. */ *stroke_opacity=0.0; subpath_opacity=0.0; p=polygon_info->edges; for (j=0; j < (ssize_t) polygon_info->number_edges; j++, p++) { if ((double) y <= (p->bounds.y1-mid-0.5)) break; if ((double) y > (p->bounds.y2+mid+0.5)) { (void) DestroyEdge(polygon_info,(size_t) j); continue; } if (((double) x <= (p->bounds.x1-mid-0.5)) || ((double) x > (p->bounds.x2+mid+0.5))) continue; i=(ssize_t) MagickMax((double) p->highwater,1.0); for ( ; i < (ssize_t) p->number_points; i++) { if ((double) y <= (p->points[i-1].y-mid-0.5)) break; if ((double) y > (p->points[i].y+mid+0.5)) continue; if (p->scanline != (double) y) { p->scanline=(double) y; p->highwater=(size_t) i; } /* Compute distance between a point and an edge. */ q=p->points+i-1; delta.x=(q+1)->x-q->x; delta.y=(q+1)->y-q->y; beta=delta.x*(x-q->x)+delta.y*(y-q->y); if (beta < 0.0) { delta.x=(double) x-q->x; delta.y=(double) y-q->y; distance=delta.x*delta.x+delta.y*delta.y; } else { alpha=delta.x*delta.x+delta.y*delta.y; if (beta > alpha) { delta.x=(double) x-(q+1)->x; delta.y=(double) y-(q+1)->y; distance=delta.x*delta.x+delta.y*delta.y; } else { alpha=1.0/alpha; beta=delta.x*(y-q->y)-delta.y*(x-q->x); distance=alpha*beta*beta; } } /* Compute stroke & subpath opacity. */ beta=0.0; if (p->ghostline == MagickFalse) { alpha=mid+0.5; if ((*stroke_opacity < 1.0) && (distance <= ((alpha+0.25)*(alpha+0.25)))) { alpha=mid-0.5; if (distance <= ((alpha+0.25)*(alpha+0.25))) *stroke_opacity=1.0; else { beta=1.0; if (fabs(distance-1.0) >= DrawEpsilon) beta=sqrt((double) distance); alpha=beta-mid-0.5; if (*stroke_opacity < ((alpha-0.25)*(alpha-0.25))) *stroke_opacity=(alpha-0.25)*(alpha-0.25); } } } if ((fill == MagickFalse) || (distance > 1.0) || (subpath_opacity >= 1.0)) continue; if (distance <= 0.0) { subpath_opacity=1.0; continue; } if (distance > 1.0) continue; if (fabs(beta) < DrawEpsilon) { beta=1.0; if (fabs(distance-1.0) >= DrawEpsilon) beta=sqrt(distance); } alpha=beta-1.0; if (subpath_opacity < (alpha*alpha)) subpath_opacity=alpha*alpha; } } /* Compute fill opacity. */ if (fill == MagickFalse) return(0.0); if (subpath_opacity >= 1.0) return(1.0); /* Determine winding number. */ winding_number=0; p=polygon_info->edges; for (j=0; j < (ssize_t) polygon_info->number_edges; j++, p++) { if ((double) y <= p->bounds.y1) break; if (((double) y > p->bounds.y2) || ((double) x <= p->bounds.x1)) continue; if ((double) x > p->bounds.x2) { winding_number+=p->direction ? 1 : -1; continue; } i=(ssize_t) MagickMax((double) p->highwater,1.0); for ( ; i < (ssize_t) p->number_points; i++) if ((double) y <= p->points[i].y) break; q=p->points+i-1; if ((((q+1)->x-q->x)*(y-q->y)) <= (((q+1)->y-q->y)*(x-q->x))) winding_number+=p->direction ? 1 : -1; } if (fill_rule != NonZeroRule) { if ((MagickAbsoluteValue(winding_number) & 0x01) != 0) return(1.0); } else if (MagickAbsoluteValue(winding_number) != 0) return(1.0); return(subpath_opacity); }
4,545
186,543
1
void CreateOAuth2ServiceDelegate( signin::AccountConsistencyMethod account_consistency) { oauth2_service_delegate_.reset(new MutableProfileOAuth2TokenServiceDelegate( client_.get(), &signin_error_controller_, &account_tracker_service_, token_web_data_, account_consistency, revoke_all_tokens_on_load_, true /* can_revoke_credantials */)); // Make sure PO2TS has a chance to load itself before continuing. base::RunLoop().RunUntilIdle(); oauth2_service_delegate_->AddObserver(this); }
4,546
105,282
0
DOMPatchSupport::DOMPatchSupport(DOMEditor* domEditor, Document* document) : m_domEditor(domEditor) , m_document(document) { }
4,547
41,049
0
static int mk_security_check_url(mk_ptr_t url) { int n; struct mk_list *head; struct mk_secure_url_t *entry; mk_list_foreach(head, &mk_secure_url) { entry = mk_list_entry(head, struct mk_secure_url_t, _head); n = mk_api->str_search_n(url.data, entry->criteria, MK_STR_INSENSITIVE, url.len); if (n >= 0) { return -1; } } return 0; }
4,548
10,492
0
iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status, void *command_data, void *opaque) { IscsiAIOCB *acb = opaque; g_free(acb->buf); acb->buf = NULL; acb->status = 0; if (status < 0) { error_report("Failed to ioctl(SG_IO) to iSCSI lun. %s", iscsi_get_error(iscsi)); acb->status = iscsi_translate_sense(&acb->task->sense); } acb->ioh->driver_status = 0; acb->ioh->host_status = 0; acb->ioh->resid = 0; acb->ioh->status = status; #define SG_ERR_DRIVER_SENSE 0x08 if (status == SCSI_STATUS_CHECK_CONDITION && acb->task->datain.size >= 2) { int ss; acb->ioh->driver_status |= SG_ERR_DRIVER_SENSE; acb->ioh->sb_len_wr = acb->task->datain.size - 2; ss = (acb->ioh->mx_sb_len >= acb->ioh->sb_len_wr) ? acb->ioh->mx_sb_len : acb->ioh->sb_len_wr; memcpy(acb->ioh->sbp, &acb->task->datain.data[2], ss); } iscsi_schedule_bh(acb); }
4,549
49,099
0
brcmf_notify_sched_scan_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e, void *data) { struct brcmf_cfg80211_info *cfg = ifp->drvr->config; struct brcmf_pno_net_info_le *netinfo, *netinfo_start; struct cfg80211_scan_request *request = NULL; struct cfg80211_ssid *ssid = NULL; struct ieee80211_channel *channel = NULL; struct wiphy *wiphy = cfg_to_wiphy(cfg); int err = 0; int channel_req = 0; int band = 0; struct brcmf_pno_scanresults_le *pfn_result; u32 result_count; u32 status; brcmf_dbg(SCAN, "Enter\n"); if (e->datalen < (sizeof(*pfn_result) + sizeof(*netinfo))) { brcmf_dbg(SCAN, "Event data to small. Ignore\n"); return 0; } if (e->event_code == BRCMF_E_PFN_NET_LOST) { brcmf_dbg(SCAN, "PFN NET LOST event. Do Nothing\n"); return 0; } pfn_result = (struct brcmf_pno_scanresults_le *)data; result_count = le32_to_cpu(pfn_result->count); status = le32_to_cpu(pfn_result->status); /* PFN event is limited to fit 512 bytes so we may get * multiple NET_FOUND events. For now place a warning here. */ WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE); brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count); if (result_count > 0) { int i; request = kzalloc(sizeof(*request), GFP_KERNEL); ssid = kcalloc(result_count, sizeof(*ssid), GFP_KERNEL); channel = kcalloc(result_count, sizeof(*channel), GFP_KERNEL); if (!request || !ssid || !channel) { err = -ENOMEM; goto out_err; } request->wiphy = wiphy; data += sizeof(struct brcmf_pno_scanresults_le); netinfo_start = (struct brcmf_pno_net_info_le *)data; for (i = 0; i < result_count; i++) { netinfo = &netinfo_start[i]; if (!netinfo) { brcmf_err("Invalid netinfo ptr. index: %d\n", i); err = -EINVAL; goto out_err; } brcmf_dbg(SCAN, "SSID:%s Channel:%d\n", netinfo->SSID, netinfo->channel); memcpy(ssid[i].ssid, netinfo->SSID, netinfo->SSID_len); ssid[i].ssid_len = netinfo->SSID_len; request->n_ssids++; channel_req = netinfo->channel; if (channel_req <= CH_MAX_2G_CHANNEL) band = NL80211_BAND_2GHZ; else band = NL80211_BAND_5GHZ; channel[i].center_freq = ieee80211_channel_to_frequency(channel_req, band); channel[i].band = band; channel[i].flags |= IEEE80211_CHAN_NO_HT40; request->channels[i] = &channel[i]; request->n_channels++; } /* assign parsed ssid array */ if (request->n_ssids) request->ssids = &ssid[0]; if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { /* Abort any on-going scan */ brcmf_abort_scanning(cfg); } set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status); cfg->escan_info.run = brcmf_run_escan; err = brcmf_do_escan(cfg, wiphy, ifp, request); if (err) { clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status); goto out_err; } cfg->sched_escan = true; cfg->scan_request = request; } else { brcmf_err("FALSE PNO Event. (pfn_count == 0)\n"); goto out_err; } kfree(ssid); kfree(channel); kfree(request); return 0; out_err: kfree(ssid); kfree(channel); kfree(request); cfg80211_sched_scan_stopped(wiphy); return err; }
4,550
30,972
0
static int iscsi_check_value(struct iscsi_param *param, char *value) { char *comma_ptr = NULL; if (!strcmp(value, REJECT)) { if (!strcmp(param->name, IFMARKINT) || !strcmp(param->name, OFMARKINT)) { /* * Reject is not fatal for [I,O]FMarkInt, and causes * [I,O]FMarker to be reset to No. (See iSCSI v20 A.3.2) */ SET_PSTATE_REJECT(param); return 0; } pr_err("Received %s=%s\n", param->name, value); return -1; } if (!strcmp(value, IRRELEVANT)) { pr_debug("Received %s=%s\n", param->name, value); SET_PSTATE_IRRELEVANT(param); return 0; } if (!strcmp(value, NOTUNDERSTOOD)) { if (!IS_PSTATE_PROPOSER(param)) { pr_err("Received illegal offer %s=%s\n", param->name, value); return -1; } /* #warning FIXME: Add check for X-ExtensionKey here */ pr_err("Standard iSCSI key \"%s\" cannot be answered" " with \"%s\", protocol error.\n", param->name, value); return -1; } do { comma_ptr = NULL; comma_ptr = strchr(value, ','); if (comma_ptr && !IS_TYPE_VALUE_LIST(param)) { pr_err("Detected value separator \",\", but" " key \"%s\" does not allow a value list," " protocol error.\n", param->name); return -1; } if (comma_ptr) *comma_ptr = '\0'; if (strlen(value) > VALUE_MAXLEN) { pr_err("Value for key \"%s\" exceeds %d," " protocol error.\n", param->name, VALUE_MAXLEN); return -1; } if (IS_TYPE_BOOL_AND(param) || IS_TYPE_BOOL_OR(param)) { if (iscsi_check_boolean_value(param, value) < 0) return -1; } else if (IS_TYPE_NUMBER(param)) { if (iscsi_check_numerical_value(param, value) < 0) return -1; } else if (IS_TYPE_NUMBER_RANGE(param)) { if (iscsi_check_numerical_range_value(param, value) < 0) return -1; } else if (IS_TYPE_STRING(param) || IS_TYPE_VALUE_LIST(param)) { if (iscsi_check_string_or_list_value(param, value) < 0) return -1; } else { pr_err("Huh? 0x%02x\n", param->type); return -1; } if (comma_ptr) *comma_ptr++ = ','; value = comma_ptr; } while (value); return 0; }
4,551
42,963
0
static void free_unused_bufs(struct virtnet_info *vi) { void *buf; int i; for (i = 0; i < vi->max_queue_pairs; i++) { struct virtqueue *vq = vi->sq[i].vq; while ((buf = virtqueue_detach_unused_buf(vq)) != NULL) dev_kfree_skb(buf); } for (i = 0; i < vi->max_queue_pairs; i++) { struct virtqueue *vq = vi->rq[i].vq; while ((buf = virtqueue_detach_unused_buf(vq)) != NULL) { if (vi->mergeable_rx_bufs) { unsigned long ctx = (unsigned long)buf; void *base = mergeable_ctx_to_buf_address(ctx); put_page(virt_to_head_page(base)); } else if (vi->big_packets) { give_pages(&vi->rq[i], buf); } else { dev_kfree_skb(buf); } } } }
4,552
138,641
0
RenderFrameHostImpl::BrowserPluginInstanceIDToAXTreeID(int instance_id) { RenderFrameHostImpl* guest = static_cast<RenderFrameHostImpl*>( delegate()->GetGuestByInstanceID(this, instance_id)); if (!guest) return ui::AXTreeIDRegistry::kNoAXTreeID; guest->set_browser_plugin_embedder_ax_tree_id(GetAXTreeID()); guest->UpdateAXTreeData(); return guest->GetAXTreeID(); }
4,553
169,878
0
xsltRegisterExtFunction(xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI, xmlXPathFunction function) { int ret; if ((ctxt == NULL) || (name == NULL) || (URI == NULL) || (function == NULL)) return (-1); if (ctxt->xpathCtxt != NULL) { xmlXPathRegisterFuncNS(ctxt->xpathCtxt, name, URI, function); } if (ctxt->extFunctions == NULL) ctxt->extFunctions = xmlHashCreate(10); if (ctxt->extFunctions == NULL) return (-1); ret = xmlHashAddEntry2(ctxt->extFunctions, name, URI, XML_CAST_FPTR(function)); return(ret); }
4,554
119,477
0
void ScriptController::disableEval(const String& errorMessage) { if (!m_windowShell->isContextInitialized()) return; v8::HandleScope handleScope(m_isolate); v8::Local<v8::Context> v8Context = m_windowShell->context(); v8Context->AllowCodeGenerationFromStrings(false); v8Context->SetErrorMessageForCodeGenerationFromStrings(v8String(errorMessage, m_isolate)); }
4,555
59,904
0
static int uas_post_reset(struct usb_interface *intf) { struct Scsi_Host *shost = usb_get_intfdata(intf); struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata; unsigned long flags; int err; if (devinfo->shutdown) return 0; err = uas_configure_endpoints(devinfo); if (err) { shost_printk(KERN_ERR, shost, "%s: alloc streams error %d after reset", __func__, err); return 1; } spin_lock_irqsave(shost->host_lock, flags); scsi_report_bus_reset(shost, 0); spin_unlock_irqrestore(shost->host_lock, flags); scsi_unblock_requests(shost); return 0; }
4,556
99,600
0
InterstitialPage::InterstitialPage(TabContents* tab, bool new_navigation, const GURL& url) : tab_(tab), url_(url), new_navigation_(new_navigation), should_discard_pending_nav_entry_(new_navigation), enabled_(true), action_taken_(NO_ACTION), render_view_host_(NULL), original_child_id_(tab->render_view_host()->process()->id()), original_rvh_id_(tab->render_view_host()->routing_id()), should_revert_tab_title_(false), resource_dispatcher_host_notified_(false), ALLOW_THIS_IN_INITIALIZER_LIST(rvh_view_delegate_( new InterstitialPageRVHViewDelegate(this))) { renderer_preferences_util::UpdateFromSystemSettings( &renderer_preferences_, tab_->profile()); InitInterstitialPageMap(); DCHECK(new_navigation || !tab->controller().pending_entry()); }
4,557
111,468
0
int32_t InputHandler::finishComposition() { if (!isActiveTextEdit()) return -1; if (!compositionActive()) return 0; removeAttributedTextMarker(); InputLog(LogLevelInfo, "InputHandler::finishComposition completed"); return 0; }
4,558
129,503
0
bool GLES2DecoderImpl::SetVertexAttribValue( const char* function_name, GLuint index, const GLfloat* value) { if (index >= state_.attrib_values.size()) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "index out of range"); return false; } Vec4& v = state_.attrib_values[index]; v.v[0] = value[0]; v.v[1] = value[1]; v.v[2] = value[2]; v.v[3] = value[3]; return true; }
4,559
88,788
0
static void compose_addr(struct sockaddr_in *sin, char *group, int port) { memset(sin, 0, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_port = htons(port); sin->sin_addr.s_addr = inet_addr(group); }
4,560
83,052
0
void mp_buf_free(lua_State *L, mp_buf *buf) { mp_realloc(L, buf->b, buf->len + buf->free, 0); /* realloc to 0 = free */ mp_realloc(L, buf, sizeof(*buf), 0); }
4,561
159,091
0
bool DownloadItemImpl::CanShowInFolder() { return CanOpenDownload() && !GetFullPath().empty(); }
4,562
83,782
0
static inline void hwsim_check_chanctx_magic(struct ieee80211_chanctx_conf *c) { struct hwsim_chanctx_priv *cp = (void *)c->drv_priv; WARN_ON(cp->magic != HWSIM_CHANCTX_MAGIC); }
4,563
42,056
0
static void *sysvipc_proc_start(struct seq_file *s, loff_t *pos) { struct ipc_proc_iter *iter = s->private; struct ipc_proc_iface *iface = iter->iface; struct ipc_ids *ids; ids = &iter->ns->ids[iface->ids]; /* * Take the lock - this will be released by the corresponding * call to stop(). */ down_read(&ids->rwsem); /* pos < 0 is invalid */ if (*pos < 0) return NULL; /* pos == 0 means header */ if (*pos == 0) return SEQ_START_TOKEN; /* Find the (pos-1)th ipc */ return sysvipc_find_ipc(ids, *pos - 1, pos); }
4,564
47,918
0
static int ioapic_service(struct kvm_ioapic *ioapic, int irq, bool line_status) { union kvm_ioapic_redirect_entry *entry = &ioapic->redirtbl[irq]; struct kvm_lapic_irq irqe; int ret; if (entry->fields.mask) return -1; ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x " "vector=%x trig_mode=%x\n", entry->fields.dest_id, entry->fields.dest_mode, entry->fields.delivery_mode, entry->fields.vector, entry->fields.trig_mode); irqe.dest_id = entry->fields.dest_id; irqe.vector = entry->fields.vector; irqe.dest_mode = entry->fields.dest_mode; irqe.trig_mode = entry->fields.trig_mode; irqe.delivery_mode = entry->fields.delivery_mode << 8; irqe.level = 1; irqe.shorthand = 0; irqe.msi_redir_hint = false; if (irqe.trig_mode == IOAPIC_EDGE_TRIG) ioapic->irr_delivered |= 1 << irq; if (irq == RTC_GSI && line_status) { /* * pending_eoi cannot ever become negative (see * rtc_status_pending_eoi_check_valid) and the caller * ensures that it is only called if it is >= zero, namely * if rtc_irq_check_coalesced returns false). */ BUG_ON(ioapic->rtc_status.pending_eoi != 0); ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe, &ioapic->rtc_status.dest_map); ioapic->rtc_status.pending_eoi = (ret < 0 ? 0 : ret); } else ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe, NULL); if (ret && irqe.trig_mode == IOAPIC_LEVEL_TRIG) entry->fields.remote_irr = 1; return ret; }
4,565
43,097
0
static u8 vhost_scsi_get_fabric_proto_ident(struct se_portal_group *se_tpg) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport = tpg->tport; switch (tport->tport_proto_id) { case SCSI_PROTOCOL_SAS: return sas_get_fabric_proto_ident(se_tpg); case SCSI_PROTOCOL_FCP: return fc_get_fabric_proto_ident(se_tpg); case SCSI_PROTOCOL_ISCSI: return iscsi_get_fabric_proto_ident(se_tpg); default: pr_err("Unknown tport_proto_id: 0x%02x, using" " SAS emulation\n", tport->tport_proto_id); break; } return sas_get_fabric_proto_ident(se_tpg); }
4,566
180,776
1
void* sspi_SecureHandleGetLowerPointer(SecHandle* handle) { void* pointer; if (!handle) return NULL; pointer = (void*) ~((size_t) handle->dwLower); return pointer; }
4,567
145,695
0
void ImageInputType::setUseFallbackContent() { if (m_useFallbackContent) return; m_useFallbackContent = true; if (element().document().inStyleRecalc()) return; if (ShadowRoot* root = element().userAgentShadowRoot()) root->removeChildren(); createShadowSubtree(); }
4,568
56,177
0
static int rfcomm_sock_setsockopt_old(struct socket *sock, int optname, char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; int err = 0; u32 opt; BT_DBG("sk %p", sk); lock_sock(sk); switch (optname) { case RFCOMM_LM: if (get_user(opt, (u32 __user *) optval)) { err = -EFAULT; break; } if (opt & RFCOMM_LM_FIPS) { err = -EINVAL; break; } if (opt & RFCOMM_LM_AUTH) rfcomm_pi(sk)->sec_level = BT_SECURITY_LOW; if (opt & RFCOMM_LM_ENCRYPT) rfcomm_pi(sk)->sec_level = BT_SECURITY_MEDIUM; if (opt & RFCOMM_LM_SECURE) rfcomm_pi(sk)->sec_level = BT_SECURITY_HIGH; rfcomm_pi(sk)->role_switch = (opt & RFCOMM_LM_MASTER); break; default: err = -ENOPROTOOPT; break; } release_sock(sk); return err; }
4,569
54,180
0
static int digi_write_room(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct digi_port *priv = usb_get_serial_port_data(port); int room; unsigned long flags = 0; spin_lock_irqsave(&priv->dp_port_lock, flags); if (priv->dp_write_urb_in_use) room = 0; else room = port->bulk_out_size - 2 - priv->dp_out_buf_len; spin_unlock_irqrestore(&priv->dp_port_lock, flags); dev_dbg(&port->dev, "digi_write_room: port=%d, room=%d\n", priv->dp_port_num, room); return room; }
4,570
94,573
0
void __d_drop(struct dentry *dentry) { if (!d_unhashed(dentry)) { struct hlist_bl_head *b; /* * Hashed dentries are normally on the dentry hashtable, * with the exception of those newly allocated by * d_obtain_alias, which are always IS_ROOT: */ if (unlikely(IS_ROOT(dentry))) b = &dentry->d_sb->s_anon; else b = d_hash(dentry->d_parent, dentry->d_name.hash); hlist_bl_lock(b); __hlist_bl_del(&dentry->d_hash); dentry->d_hash.pprev = NULL; hlist_bl_unlock(b); dentry_rcuwalk_invalidate(dentry); } }
4,571
58,456
0
server_read_child (GIOChannel *source, GIOCondition condition, server *serv) { session *sess = serv->server_session; char tbuf[128]; char outbuf[512]; char host[100]; char ip[100]; #ifdef USE_MSPROXY char *p; #endif waitline2 (source, tbuf, sizeof tbuf); switch (tbuf[0]) { case '0': /* print some text */ waitline2 (source, tbuf, sizeof tbuf); PrintText (serv->server_session, tbuf); break; case '1': /* unknown host */ server_stopconnecting (serv); closesocket (serv->sok4); if (serv->proxy_sok4 != -1) closesocket (serv->proxy_sok4); #ifdef USE_IPV6 if (serv->sok6 != -1) closesocket (serv->sok6); if (serv->proxy_sok6 != -1) closesocket (serv->proxy_sok6); #endif EMIT_SIGNAL (XP_TE_UKNHOST, sess, NULL, NULL, NULL, NULL, 0); if (!servlist_cycle (serv)) if (prefs.hex_net_auto_reconnectonfail) auto_reconnect (serv, FALSE, -1); break; case '2': /* connection failed */ waitline2 (source, tbuf, sizeof tbuf); server_stopconnecting (serv); closesocket (serv->sok4); if (serv->proxy_sok4 != -1) closesocket (serv->proxy_sok4); #ifdef USE_IPV6 if (serv->sok6 != -1) closesocket (serv->sok6); if (serv->proxy_sok6 != -1) closesocket (serv->proxy_sok6); #endif EMIT_SIGNAL (XP_TE_CONNFAIL, sess, errorstring (atoi (tbuf)), NULL, NULL, NULL, 0); if (!servlist_cycle (serv)) if (prefs.hex_net_auto_reconnectonfail) auto_reconnect (serv, FALSE, -1); break; case '3': /* gethostbyname finished */ waitline2 (source, host, sizeof host); waitline2 (source, ip, sizeof ip); waitline2 (source, outbuf, sizeof outbuf); EMIT_SIGNAL (XP_TE_CONNECT, sess, host, ip, outbuf, NULL, 0); #ifdef WIN32 if (prefs.hex_identd) { if (serv->network && ((ircnet *)serv->network)->user) { identd_start (((ircnet *)serv->network)->user); } else { identd_start (prefs.hex_irc_user_name); } } #else snprintf (outbuf, sizeof (outbuf), "%s/auth/xchat_auth", g_get_home_dir ()); if (access (outbuf, X_OK) == 0) { snprintf (outbuf, sizeof (outbuf), "exec -d %s/auth/xchat_auth %s", g_get_home_dir (), prefs.hex_irc_user_name); handle_command (serv->server_session, outbuf, FALSE); } #endif break; case '4': /* success */ waitline2 (source, tbuf, sizeof (tbuf)); #ifdef USE_MSPROXY serv->sok = strtol (tbuf, &p, 10); if (*p++ == ' ') { serv->proxy_sok = strtol (p, &p, 10); serv->msp_state.clientid = strtol (++p, &p, 10); serv->msp_state.serverid = strtol (++p, &p, 10); serv->msp_state.seq_sent = atoi (++p); } else serv->proxy_sok = -1; #ifdef DEBUG_MSPROXY printf ("Parent got main socket: %d, proxy socket: %d\n", serv->sok, serv->proxy_sok); printf ("Client ID 0x%08x server ID 0x%08x seq_sent %d\n", serv->msp_state.clientid, serv->msp_state.serverid, serv->msp_state.seq_sent); #endif #else serv->sok = atoi (tbuf); #endif #ifdef USE_IPV6 /* close the one we didn't end up using */ if (serv->sok == serv->sok4) closesocket (serv->sok6); else closesocket (serv->sok4); if (serv->proxy_sok != -1) { if (serv->proxy_sok == serv->proxy_sok4) closesocket (serv->proxy_sok6); else closesocket (serv->proxy_sok4); } #endif server_connect_success (serv); break; case '5': /* prefs ip discovered */ waitline2 (source, tbuf, sizeof tbuf); prefs.local_ip = inet_addr (tbuf); break; case '7': /* gethostbyname (prefs.hex_net_bind_host) failed */ sprintf (outbuf, _("Cannot resolve hostname %s\nCheck your IP Settings!\n"), prefs.hex_net_bind_host); PrintText (sess, outbuf); break; case '8': PrintText (sess, _("Proxy traversal failed.\n")); server_disconnect (sess, FALSE, -1); break; case '9': waitline2 (source, tbuf, sizeof tbuf); EMIT_SIGNAL (XP_TE_SERVERLOOKUP, sess, tbuf, NULL, NULL, NULL, 0); break; } return TRUE; }
4,572
117,864
0
static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& args) { INC_STATS("DOM.TestObj.removeEventListener()"); RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly); if (listener) { V8TestObj::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue()); removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex); } return v8::Undefined(); }
4,573
136,844
0
BarProp* LocalDOMWindow::statusbar() const { if (!statusbar_) statusbar_ = BarProp::Create(GetFrame(), BarProp::kStatusbar); return statusbar_.Get(); }
4,574
79,069
0
int arch_prctl_spec_ctrl_set(struct task_struct *task, unsigned long which, unsigned long ctrl) { switch (which) { case PR_SPEC_STORE_BYPASS: return ssb_prctl_set(task, ctrl); default: return -ENODEV; } }
4,575
132,792
0
const VideoPacket* packet() const { return packet_.get(); }
4,576
138,779
0
RenderFrameHostImpl::PassNavigationHandleOwnership() { DCHECK(!IsBrowserSideNavigationEnabled()); if (navigation_handle_) navigation_handle_->set_is_transferring(true); return std::move(navigation_handle_); }
4,577
35,642
0
file_regcomp(file_regex_t *rx, const char *pat, int flags) { #ifdef USE_C_LOCALE rx->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0); assert(rx->c_lc_ctype != NULL); rx->old_lc_ctype = uselocale(rx->c_lc_ctype); assert(rx->old_lc_ctype != NULL); #endif rx->pat = pat; return rx->rc = regcomp(&rx->rx, pat, flags); }
4,578
54,707
0
static int snd_seq_ioctl_get_queue_tempo(struct snd_seq_client *client, void __user *arg) { struct snd_seq_queue_tempo tempo; struct snd_seq_queue *queue; struct snd_seq_timer *tmr; if (copy_from_user(&tempo, arg, sizeof(tempo))) return -EFAULT; queue = queueptr(tempo.queue); if (queue == NULL) return -EINVAL; memset(&tempo, 0, sizeof(tempo)); tempo.queue = queue->queue; tmr = queue->timer; tempo.tempo = tmr->tempo; tempo.ppq = tmr->ppq; tempo.skew_value = tmr->skew; tempo.skew_base = tmr->skew_base; queuefree(queue); if (copy_to_user(arg, &tempo, sizeof(tempo))) return -EFAULT; return 0; }
4,579
171,786
0
bt_status_t btif_dm_start_discovery(void) { tBTA_DM_INQ inq_params; tBTA_SERVICE_MASK services = 0; tBTA_DM_BLE_PF_FILT_PARAMS adv_filt_param; BTIF_TRACE_EVENT("%s", __FUNCTION__); #if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) memset(&adv_filt_param, 0, sizeof(tBTA_DM_BLE_PF_FILT_PARAMS)); /* Cleanup anything remaining on index 0 */ BTA_DmBleScanFilterSetup(BTA_DM_BLE_SCAN_COND_DELETE, 0, &adv_filt_param, NULL, bte_scan_filt_param_cfg_evt, 0); /* Add an allow-all filter on index 0*/ adv_filt_param.dely_mode = IMMEDIATE_DELY_MODE; adv_filt_param.feat_seln = ALLOW_ALL_FILTER; adv_filt_param.filt_logic_type = BTA_DM_BLE_PF_FILT_LOGIC_OR; adv_filt_param.list_logic_type = BTA_DM_BLE_PF_LIST_LOGIC_OR; adv_filt_param.rssi_low_thres = LOWEST_RSSI_VALUE; adv_filt_param.rssi_high_thres = LOWEST_RSSI_VALUE; BTA_DmBleScanFilterSetup(BTA_DM_BLE_SCAN_COND_ADD, 0, &adv_filt_param, NULL, bte_scan_filt_param_cfg_evt, 0); /* TODO: Do we need to handle multiple inquiries at the same time? */ /* Set inquiry params and call API */ inq_params.mode = BTA_DM_GENERAL_INQUIRY|BTA_BLE_GENERAL_INQUIRY; #if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) inq_params.intl_duration[0]= BTIF_DM_INTERLEAVE_DURATION_BR_ONE; inq_params.intl_duration[1]= BTIF_DM_INTERLEAVE_DURATION_LE_ONE; inq_params.intl_duration[2]= BTIF_DM_INTERLEAVE_DURATION_BR_TWO; inq_params.intl_duration[3]= BTIF_DM_INTERLEAVE_DURATION_LE_TWO; #endif #else inq_params.mode = BTA_DM_GENERAL_INQUIRY; #endif inq_params.duration = BTIF_DM_DEFAULT_INQ_MAX_DURATION; inq_params.max_resps = BTIF_DM_DEFAULT_INQ_MAX_RESULTS; inq_params.report_dup = TRUE; inq_params.filter_type = BTA_DM_INQ_CLR; /* TODO: Filter device by BDA needs to be implemented here */ /* Will be enabled to TRUE once inquiry busy level has been received */ btif_dm_inquiry_in_progress = FALSE; /* find nearby devices */ BTA_DmSearch(&inq_params, services, bte_search_devices_evt); return BT_STATUS_SUCCESS; }
4,580
119,740
0
ColorChooserWin* ColorChooserWin::Open(content::WebContents* web_contents, SkColor initial_color) { if (!current_color_chooser_) current_color_chooser_ = new ColorChooserWin(web_contents, initial_color); return current_color_chooser_; }
4,581
142,574
0
void ShelfWidget::DelegateView::UpdateBackgroundBlur() { const bool should_blur_background = opaque_background_.visible() && shelf_widget_->shelf_layout_manager()->ShouldBlurShelfBackground(); if (should_blur_background == background_is_currently_blurred_) return; opaque_background_.SetBackgroundBlur(should_blur_background ? kShelfBlurRadius : 0); opaque_background_.SetBackdropFilterQuality(kShelfBlurQuality); background_is_currently_blurred_ = should_blur_background; }
4,582
173,161
0
init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette, int do_tRNS) { store_palette_entry *ppal = make_standard_palette(ps, npalette, do_tRNS); { int i; png_color palette[256]; /* Set all entries to detect overread errors. */ for (i=0; i<npalette; ++i) { palette[i].red = ppal[i].red; palette[i].green = ppal[i].green; palette[i].blue = ppal[i].blue; } /* Just in case fill in the rest with detectable values: */ for (; i<256; ++i) palette[i].red = palette[i].green = palette[i].blue = 42; png_set_PLTE(pp, pi, palette, npalette); } if (do_tRNS) { int i, j; png_byte tRNS[256]; /* Set all the entries, but skip trailing opaque entries */ for (i=j=0; i<npalette; ++i) if ((tRNS[i] = ppal[i].alpha) < 255) j = i+1; /* Fill in the remainder with a detectable value: */ for (; i<256; ++i) tRNS[i] = 24; # ifdef PNG_WRITE_tRNS_SUPPORTED if (j > 0) png_set_tRNS(pp, pi, tRNS, j, 0/*color*/); # endif } }
4,583
29,322
0
static int kvm_device_release(struct inode *inode, struct file *filp) { struct kvm_device *dev = filp->private_data; struct kvm *kvm = dev->kvm; kvm_put_kvm(kvm); return 0; }
4,584
174,351
0
bool Backtrace::VerifyReadWordArgs(uintptr_t ptr, word_t* out_value) { if (ptr & (sizeof(word_t)-1)) { BACK_LOGW("invalid pointer %p", reinterpret_cast<void*>(ptr)); *out_value = static_cast<word_t>(-1); return false; } return true; }
4,585
116,363
0
static void PreserveRequestHeaders_Handler( const net::HttpRequestInfo* request, std::string* response_status, std::string* response_headers, std::string* response_data) { EXPECT_TRUE(request->extra_headers.HasHeader(kExtraHeaderKey)); }
4,586
110,379
0
bool PluginModule::InitAsInternalPlugin(const EntryPoints& entry_points) { if (InitializeModule(entry_points)) { entry_points_ = entry_points; return true; } return false; }
4,587
82,335
0
NO_INLINE bool jspeParseFunctionCallBrackets() { assert(!JSP_SHOULD_EXECUTE); JSP_MATCH('('); while (!JSP_SHOULDNT_PARSE && lex->tk != ')') { jsvUnLock(jspeAssignmentExpression()); #ifndef SAVE_ON_FLASH if (lex->tk==LEX_ARROW_FUNCTION) { jsvUnLock(jspeArrowFunction(0, 0)); } #endif if (lex->tk!=')') JSP_MATCH(','); } if (!JSP_SHOULDNT_PARSE) JSP_MATCH(')'); return 0; }
4,588
1,070
0
void GfxPatternColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) { rgb->r = rgb->g = rgb->b = 0; }
4,589
75,432
0
static int oples(RAsm *a, ut8* data, const Opcode *op) { int l = 0; int offset = 0; int mod = 0; if (op->operands[1].type & OT_MEMORY) { data[l++] = 0xc4; if (op->operands[1].type & OT_GPREG) { offset = op->operands[1].offset * op->operands[1].offset_sign; if (offset) { mod = 1; if (offset > 128 || offset < -128) { mod = 2; } } data[l++] = mod << 6 | op->operands[0].reg << 3 | op->operands[1].regs[0]; if (mod) { data[l++] = offset; if (mod > 1) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } } else { offset = op->operands[1].offset * op->operands[1].offset_sign; data[l++] = 0x05; data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } return l; }
4,590
31,528
0
rad_auth_open(void) { struct rad_handle *h; h = (struct rad_handle *)malloc(sizeof(struct rad_handle)); if (h != NULL) { TSRMLS_FETCH(); php_srand(time(NULL) * getpid() * (unsigned long) (php_combined_lcg(TSRMLS_C) * 10000.0) TSRMLS_CC); h->fd = -1; h->num_servers = 0; h->ident = php_rand(TSRMLS_C); h->errmsg[0] = '\0'; memset(h->pass, 0, sizeof h->pass); h->pass_len = 0; h->pass_pos = 0; h->chap_pass = 0; h->type = RADIUS_AUTH; h->request_created = 0; } return h; }
4,591
103,338
0
P2PSocketHost* P2PSocketDispatcherHost::LookupSocket( int32 routing_id, int socket_id) { SocketsMap::iterator it = sockets_.find( ExtendedSocketId(routing_id, socket_id)); if (it == sockets_.end()) return NULL; else return it->second; }
4,592
181,125
1
llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, const struct lladdr_info *src, const struct lladdr_info *dst) { uint8_t dsap_field, dsap, ssap_field, ssap; uint16_t control; int hdrlen; int is_u; if (caplen < 3) { ND_PRINT((ndo, "[|llc]")); ND_DEFAULTPRINT((const u_char *)p, caplen); return (caplen); } if (length < 3) { ND_PRINT((ndo, "[|llc]")); ND_DEFAULTPRINT((const u_char *)p, caplen); return (length); } dsap_field = *p; ssap_field = *(p + 1); /* * OK, what type of LLC frame is this? The length * of the control field depends on that - I frames * have a two-byte control field, and U frames have * a one-byte control field. */ control = *(p + 2); if ((control & LLC_U_FMT) == LLC_U_FMT) { /* * U frame. */ is_u = 1; hdrlen = 3; /* DSAP, SSAP, 1-byte control field */ } else { /* * The control field in I and S frames is * 2 bytes... */ if (caplen < 4) { ND_PRINT((ndo, "[|llc]")); ND_DEFAULTPRINT((const u_char *)p, caplen); return (caplen); } if (length < 4) { ND_PRINT((ndo, "[|llc]")); ND_DEFAULTPRINT((const u_char *)p, caplen); return (length); } /* * ...and is little-endian. */ control = EXTRACT_LE_16BITS(p + 2); is_u = 0; hdrlen = 4; /* DSAP, SSAP, 2-byte control field */ } if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) { /* * This is an Ethernet_802.3 IPX frame; it has an * 802.3 header (i.e., an Ethernet header where the * type/length field is <= ETHERMTU, i.e. it's a length * field, not a type field), but has no 802.2 header - * the IPX packet starts right after the Ethernet header, * with a signature of two bytes of 0xFF (which is * LLCSAP_GLOBAL). * * (It might also have been an Ethernet_802.3 IPX at * one time, but got bridged onto another network, * such as an 802.11 network; this has appeared in at * least one capture file.) */ if (ndo->ndo_eflag) ND_PRINT((ndo, "IPX 802.3: ")); ipx_print(ndo, p, length); return (0); /* no LLC header */ } dsap = dsap_field & ~LLC_IG; ssap = ssap_field & ~LLC_GSAP; if (ndo->ndo_eflag) { ND_PRINT((ndo, "LLC, dsap %s (0x%02x) %s, ssap %s (0x%02x) %s", tok2str(llc_values, "Unknown", dsap), dsap, tok2str(llc_ig_flag_values, "Unknown", dsap_field & LLC_IG), tok2str(llc_values, "Unknown", ssap), ssap, tok2str(llc_flag_values, "Unknown", ssap_field & LLC_GSAP))); if (is_u) { ND_PRINT((ndo, ", ctrl 0x%02x: ", control)); } else { ND_PRINT((ndo, ", ctrl 0x%04x: ", control)); } } /* * Skip LLC header. */ p += hdrlen; length -= hdrlen; caplen -= hdrlen; if (ssap == LLCSAP_SNAP && dsap == LLCSAP_SNAP && control == LLC_UI) { /* * XXX - what *is* the right bridge pad value here? * Does anybody ever bridge one form of LAN traffic * over a networking type that uses 802.2 LLC? */ if (!snap_print(ndo, p, length, caplen, src, dst, 2)) { /* * Unknown packet type; tell our caller, by * returning a negative value, so they * can print the raw packet. */ return (-(hdrlen + 5)); /* include LLC and SNAP header */ } else return (hdrlen + 5); /* include LLC and SNAP header */ } if (ssap == LLCSAP_8021D && dsap == LLCSAP_8021D && control == LLC_UI) { stp_print(ndo, p, length); return (hdrlen); } if (ssap == LLCSAP_IP && dsap == LLCSAP_IP && control == LLC_UI) { /* * This is an RFC 948-style IP packet, with * an 802.3 header and an 802.2 LLC header * with the source and destination SAPs being * the IP SAP. */ ip_print(ndo, p, length); return (hdrlen); } if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX && control == LLC_UI) { /* * This is an Ethernet_802.2 IPX frame, with an 802.3 * header and an 802.2 LLC header with the source and * destination SAPs being the IPX SAP. */ if (ndo->ndo_eflag) ND_PRINT((ndo, "IPX 802.2: ")); ipx_print(ndo, p, length); return (hdrlen); } #ifdef ENABLE_SMB if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI && (!(control & LLC_S_FMT) || control == LLC_U_FMT)) { /* * we don't actually have a full netbeui parser yet, but the * smb parser can handle many smb-in-netbeui packets, which * is very useful, so we call that * * We don't call it for S frames, however, just I frames * (which are frames that don't have the low-order bit, * LLC_S_FMT, set in the first byte of the control field) * and UI frames (whose control field is just 3, LLC_U_FMT). */ netbeui_print(ndo, control, p, length); return (hdrlen); } #endif if (ssap == LLCSAP_ISONS && dsap == LLCSAP_ISONS && control == LLC_UI) { isoclns_print(ndo, p, length, caplen); return (hdrlen); } if (!ndo->ndo_eflag) { if (ssap == dsap) { if (src == NULL || dst == NULL) ND_PRINT((ndo, "%s ", tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); else ND_PRINT((ndo, "%s > %s %s ", (src->addr_string)(ndo, src->addr), (dst->addr_string)(ndo, dst->addr), tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); } else { if (src == NULL || dst == NULL) ND_PRINT((ndo, "%s > %s ", tok2str(llc_values, "Unknown SSAP 0x%02x", ssap), tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); else ND_PRINT((ndo, "%s %s > %s %s ", (src->addr_string)(ndo, src->addr), tok2str(llc_values, "Unknown SSAP 0x%02x", ssap), (dst->addr_string)(ndo, dst->addr), tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); } } if (is_u) { ND_PRINT((ndo, "Unnumbered, %s, Flags [%s], length %u", tok2str(llc_cmd_values, "%02x", LLC_U_CMD(control)), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_U_POLL)), length + hdrlen)); if ((control & ~LLC_U_POLL) == LLC_XID) { if (length == 0) { /* * XID with no payload. * This could, for example, be an SNA * "short form" XID. */ return (hdrlen); } if (caplen < 1) { ND_PRINT((ndo, "[|llc]")); if (caplen > 0) ND_DEFAULTPRINT((const u_char *)p, caplen); return (hdrlen); } if (*p == LLC_XID_FI) { if (caplen < 3 || length < 3) { ND_PRINT((ndo, "[|llc]")); if (caplen > 0) ND_DEFAULTPRINT((const u_char *)p, caplen); } else ND_PRINT((ndo, ": %02x %02x", p[1], p[2])); return (hdrlen); } } } else { if ((control & LLC_S_FMT) == LLC_S_FMT) { ND_PRINT((ndo, "Supervisory, %s, rcv seq %u, Flags [%s], length %u", tok2str(llc_supervisory_values,"?",LLC_S_CMD(control)), LLC_IS_NR(control), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_IS_POLL)), length + hdrlen)); return (hdrlen); /* no payload to print */ } else { ND_PRINT((ndo, "Information, send seq %u, rcv seq %u, Flags [%s], length %u", LLC_I_NS(control), LLC_IS_NR(control), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_IS_POLL)), length + hdrlen)); } } return (-hdrlen); }
4,593
152,750
0
std::unique_ptr<HistogramSamples> Histogram::SnapshotFinalDelta() const { DCHECK(!final_delta_created_); final_delta_created_ = true; std::unique_ptr<HistogramSamples> snapshot = SnapshotSampleVector(); if (logged_samples_) snapshot->Subtract(*logged_samples_); return snapshot; }
4,594
71,182
0
kvm_pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn) { return __gfn_to_pfn_memslot(slot, gfn, false, NULL, true, NULL); }
4,595
58,112
0
__checkparam_dl(const struct sched_attr *attr) { return attr && attr->sched_deadline != 0 && (attr->sched_period == 0 || (s64)(attr->sched_period - attr->sched_deadline) >= 0) && (s64)(attr->sched_deadline - attr->sched_runtime ) >= 0 && attr->sched_runtime >= (2 << (DL_SCALE - 1)); }
4,596
157,767
0
void WebContentsImpl::FullscreenFrameSetUpdated() { if (fullscreen_frames_.empty()) { current_fullscreen_frame_ = nullptr; return; } RenderFrameHostImpl* new_fullscreen_frame = *std::max_element( fullscreen_frames_.begin(), fullscreen_frames_.end(), FrameCompareDepth); if (new_fullscreen_frame == current_fullscreen_frame_) return; current_fullscreen_frame_ = new_fullscreen_frame; for (auto& observer : observers_) observer.DidAcquireFullscreen(new_fullscreen_frame); if (display_cutout_host_impl_) display_cutout_host_impl_->DidAcquireFullscreen(new_fullscreen_frame); }
4,597
88,302
0
prologInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; parser->m_processor = prologProcessor; return prologProcessor(parser, s, end, nextPtr); }
4,598
32,712
0
static int tg3_readphy(struct tg3 *tp, int reg, u32 *val) { return __tg3_readphy(tp, tp->phy_addr, reg, val); }
4,599