dritte fehler

This commit is contained in:
Ulrich Bessoh 2024-07-31 15:56:45 +02:00
parent 0049daed67
commit 3585ccfae5
2 changed files with 6 additions and 5 deletions

View File

@ -34,14 +34,14 @@ static void set_priv_data(struct file *file, st_int_t *data) {
}
#endif
static int sum(int val[], int len) {
/*static int sum(int val[], int len) {
int ret = 0;
for (int i = 0; i < len; i++) {
ret += val[i];
}
return ret + CONFIG_STUDENT_OFFSET;
}
}*/
static ssize_t student_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos) {
@ -53,7 +53,8 @@ static ssize_t student_read(struct file *file, char __user *buf, size_t count,
return 0;
}
len = snprintf(tmp, 10, "%d\n", sum(data->values, MAX_VALUES));
//len = snprintf(tmp, 10, "%d\n", sum(data->values, MAX_VALUES));
len = snprintf(tmp,10,"42.");
st_debug("About to copy %lu bytes to the userspace\n", len);
len = min(len, count);
if (count < len) {

View File

@ -48,9 +48,9 @@ static int vogon_peom(struct seq_file *p, void *v) {
int i;
// In the dusk of an Operating System, the solution lies beyond its bounds.
spin_lock(&poem_lock);
spin_lock_bh(&poem_lock);
i = poem_line;
spin_unlock(&poem_lock);
spin_unlock_bh(&poem_lock);
seq_printf(p, "%s\n", poem[i]);
return 0;
}