Re: [ath5k-devel] [PATCH 1/2] ath5k: debug level improvements

2008-01-20 Thread Kalle Valo
bruno randolf <[EMAIL PROTECTED]> writes: > On Monday 21 January 2008 15:44:46 Kalle Valo wrote: >> > + char buf[20]; >> > + >> > + if (copy_from_user(buf, userbuf, min_t(size_t, count, 20))) >> > + return -EFAULT; >> >> How about let the compiler count the size of buf? Like this: >> >>

Re: [ath5k-devel] [PATCH 1/2] ath5k: debug level improvements

2008-01-20 Thread bruno randolf
On Monday 21 January 2008 15:44:46 Kalle Valo wrote: > > + char buf[20]; > > + > > + if (copy_from_user(buf, userbuf, min_t(size_t, count, 20))) > > + return -EFAULT; > > How about let the compiler count the size of buf? Like this: > > if (copy_from_user(buf, userbuf, min_t(size_t, co

Re: [ath5k-devel] [PATCH 1/2] ath5k: debug level improvements

2008-01-20 Thread Kalle Valo
Bruno Randolf <[EMAIL PROTECTED]> writes: > @@ -209,7 +209,12 @@ static ssize_t write_file_tsf(struct file *file, >size_t count, loff_t *ppos) > { > struct ath5k_softc *sc = file->private_data; > - if (strncmp(userbuf, "reset", 5) == 0) { > + char buf