Код и так удобно читать, но я бы избавился от if else по возможности
static ssize_t mydev_write(struct file * filep, const char * buffer, size_t len, loff_t * offset) {
copy_from_user(ips[i], buffer, 256);
printk(KERN_INFO "ips: %s \n", ips[i]);
i++;
if (strncmp(ips[0], "wh", 2) == 0) {
BORW = 0;
if (nf_register_net_hook( & init_net, &w_drop) {
printk(KERN_ALERT "FAILED\n");
}
printk(KERN_INFO "white list\n");
return len;
}
if (strncmp(ips[0], "bl", 2) == 0) {
BORW = 1;
if (nf_register_net_hook( & init_net, &b_drop)) {
printk(KERN_ALERT "FAILED\n");
}
printk(KERN_INFO "block list\n");
return len;
}
BORW = 1;
if (nf_register_net_hook( & init_net, &b_drop)) {
printk(KERN_ALERT "FAILED\n");
}
printk(KERN_INFO "defult is block list\n");
return len;
}