Skip to content

Instantly share code, notes, and snippets.

@evdenis
evdenis / context.diff
Created Aug 9, 2020
flexible_array.cocci context
View context.diff
Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.
diff -u -p ./fs/erofs/erofs_fs.h /tmp/nothing/fs/erofs/erofs_fs.h
--- ./fs/erofs/erofs_fs.h
+++ /tmp/nothing/fs/erofs/erofs_fs.h
@@ -152,7 +152,6 @@ struct erofs_xattr_ibody_header {
__le32 h_reserved;
__u8 h_shared_count;
@evdenis
evdenis / flex.diff
Created Aug 9, 2020
flexible_array.cocci patch
View flex.diff
diff --git a/arch/alpha/include/asm/hwrpb.h b/arch/alpha/include/asm/hwrpb.h
index d8180e527a1e..fc76f36265ad 100644
--- a/arch/alpha/include/asm/hwrpb.h
+++ b/arch/alpha/include/asm/hwrpb.h
@@ -152,7 +152,7 @@ struct memdesc_struct {
unsigned long chksum;
unsigned long optional_pa;
unsigned long numclusters;
- struct memclust_struct cluster[0];
+ struct memclust_struct cluster[];
View memweight.c
#include <assert.h>
#define BITS_PER_BYTE 8
#define BITS_PER_LONG 64
#define INT_MAX ((int)(~0U >> 1))
#define UINT_MAX (~0U)
#define __const_hweight8(w) ((unsigned int) ((!!((w) & (1ULL << 0))) + (!!((w) & (1ULL << 1))) + (!!((w) & (1ULL << 2))) + (!!((w) & (1ULL << 3))) + (!!((w) & (1ULL << 4))) + (!!((w) & (1ULL << 5))) + (!!((w) & (1ULL << 6))) + (!!((w) & (1ULL << 7)))))
@evdenis
evdenis / check_static_export.pl
Created Jul 14, 2019
Check that exported symbols in the Linux kernel are global
View check_static_export.pl
#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0
# check_static_export.pl - check that exported symbols are global
# (c) 2019 Denis Efremov <efremov@linux.com>
use strict;
use warnings;
foreach (@ARGV) {
my %symb;
@evdenis
evdenis / remove_acsl_specs.pl
Created Sep 4, 2018
Script for removing ACSL specifications from C files
View remove_acsl_specs.pl
#!/usr/bin/env perl
use warnings;
use strict;
use Fcntl qw(:flock SEEK_END);
unless (@ARGV) {
die("usage: $0 <files>\n");
}
@evdenis
evdenis / keybase
Created May 26, 2018
keybase proof
View keybase
### Keybase proof
I hereby claim:
* I am evdenis on github.
* I am efremov (https://keybase.io/efremov) on keybase.
* I have a public key ASDoFXA8YfMZwcyRUpQRSF9BR9nP9TySXUdYl0Y3qgwnfwo
To claim this, I am signing this object:
@evdenis
evdenis / META
Created Dec 18, 2016 — forked from kerneis/META
CIL plugin example
View META
version = "0.1"
description = "count and display the number of function calls"
archive(byte,plugin) = "countCalls.cma"
archive(native,plugin) = "countCalls.cmxs"
@evdenis
evdenis / ghost.conf
Created Jul 18, 2016
Apache configuration for Ghost blogging platform through unix socket
View ghost.conf
<VirtualHost *:80>
ServerName blog.llkl.org
ServerAdmin admin@llkl.org
ProxyRequests Off
ProxyPreserveHost On
<Location />
ProxyPass unix:/run/ghost/sock|http://127.0.0.1/
ProxyPassReverse unix:/run/ghost/sock|http://127.0.0.1/
@evdenis
evdenis / ghost_upgrade.sh
Created Jul 18, 2016
Upgrade script for Ghost blogging platform
View ghost_upgrade.sh
#!/bin/bash -x
# Остановить скрипт, если любая команда завершится с ошибкой
set -e
# -- BEGIN CONFIGURATION --
## Директория, где располагаются файлы Ghost
ghost_dir='/var/www/ghost'
## Директория, куда загрузить обновлённую версию
download_dir="$(mktemp -d)"
@evdenis
evdenis / ghost.service
Created Jul 18, 2016
Systemd service file for Ghost blogging platform
View ghost.service
[Unit]
Description=Ghost blog
After=network.target
[Service]
Type=simple
PIDFile=/run/ghost/pid
WorkingDirectory=/var/www/ghost
RuntimeDirectory=ghost
User=ghost