Skip to content

Instantly share code, notes, and snippets.

View dvdhrm's full-sized avatar
✔️
Fixing Whitespace, what else would you do at this time?

David Rheinsberg dvdhrm

✔️
Fixing Whitespace, what else would you do at this time?
View GitHub Profile
@dvdhrm
dvdhrm / n-ndp.h
Created December 29, 2016 11:20
NDP API
#pragma once
/*
* IPv6 Neighbor Discovery Protocol
*
* This is the public header of the n-ndp library, implementing IPv6 Neighbor
* Discovery Protocol as described in RFC-4861. This header defines the public
* API and all entry points of n-ndp.
*/
From 23b39ffc66db836c1d5f895d90188e982ebe512d Mon Sep 17 00:00:00 2001
From: David Herrmann <[email protected]>
Date: Tue, 13 Dec 2016 14:49:14 +0100
Subject: [PATCH] bpf-lpm: fixes and tests
Fixes 3 things:
- Initialize new_node to NULL. Otherwise, the error-path is wrong if
we jump there just to unlock the spinlock.
- longest_prefix_match() should check for both node->prefixlen and
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 0ad2c47..e32c590 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -225,6 +225,7 @@ static int drm_getstats(struct drm_device *dev, void *data,
*/
static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
+ bool is_kms = drm_core_check_feature(dev, DRIVER_MODESET);
struct drm_get_cap *req = data;
@dvdhrm
dvdhrm / tx.c
Created October 22, 2016 15:08
bus1 transactions
#ifndef __BUS1_TX_H
#define __BUS1_TX_H
/*
* Copyright (C) 2013-2016 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
@dvdhrm
dvdhrm / peer.c
Created September 19, 2016 15:07
static int bus1_peer_transfer(struct bus1_peer *src,
struct bus1_peer *dst,
struct bus1_cmd_handle_transfer *param)
{
struct bus1_handle *src_h, *dst_h;
int r = 0;
mutex_lock(&src->local.lock);
src_h = bus1_handle_ref_by_id(src, param.src_handle);
if (src_h) {
#pragma once
/***
This file is part of bus1. See COPYING for details.
bus1 is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
#pragma once
/***
This file is part of bus1. See COPYING for details.
bus1 is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
#pragma once
/***
This file is part of bus1. See COPYING for details.
bus1 is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
#ifndef _UAPI_LINUX_BUS1_H
#define _UAPI_LINUX_BUS1_H
/*
* Copyright (C) 2013-2016 Red Hat, Inc.
*
* bus1 is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
@dvdhrm
dvdhrm / foobar.c
Last active February 29, 2016 01:13
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
static int pi_1(int idx) {
int sq, sq2;
sq = floor(sqrt(idx));
sq2 = sq * sq;