* [PATCH] floppy98.c: use kernel min/max [not found] <20040418194357.4cd02a06.rddunlap@osdl.org> @ 2004-04-19 2:51 ` Randy.Dunlap 2004-04-19 12:14 ` Bartlomiej Zolnierkiewicz [not found] ` <20040418194813.629e75bd.randy.dunlap@verizon.net> 1 sibling, 1 reply; 9+ messages in thread From: Randy.Dunlap @ 2004-04-19 2:51 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, zwane Convert floppy98.c to use kernel min/max, like floppy.c. diffstat:= drivers/block/floppy98.c | 28 ++++++---------------------- 1 files changed, 6 insertions(+), 22 deletions(-) diff -Naurp ./drivers/block/floppy98.c~fd98_minmax ./drivers/block/floppy98.c --- ./drivers/block/floppy98.c~fd98_minmax 2004-04-18 17:54:42.000000000 -0700 +++ ./drivers/block/floppy98.c 2004-04-18 18:12:38.000000000 -0700 @@ -720,25 +720,9 @@ static void reschedule_timeout(int drive timeout_message = message; } -static int maximum(int a, int b) -{ - if (a > b) - return a; - else - return b; -} - -#define INFBOUND(a,b) (a)=maximum((a),(b)); - -static int minimum(int a, int b) -{ - if (a < b) - return a; - else - return b; -} +#define INFBOUND(a,b) (a)=max_t(int, a, b) -#define SUPBOUND(a,b) (a)=minimum((a),(b)); +#define SUPBOUND(a,b) (a)=min_t(int, a, b) /* * Bottom half floppy driver. @@ -2556,12 +2540,12 @@ static void copy_buffer(int ssize, int m int size, i; max_sector = transfer_size(ssize, - minimum(max_sector, max_sector_2), + min(max_sector, max_sector_2), current_req->nr_sectors); if (current_count_sectors <= 0 && CT(COMMAND) == FD_WRITE && buffer_max > fsector_t + current_req->nr_sectors) - current_count_sectors = minimum(buffer_max - fsector_t, + current_count_sectors = min_t(int, buffer_max - fsector_t, current_req->nr_sectors); remaining = current_count_sectors << 9; @@ -2580,7 +2564,7 @@ static void copy_buffer(int ssize, int m } #endif - buffer_max = maximum(max_sector, buffer_max); + buffer_max = max(max_sector, buffer_max); dma_buffer = floppy_track_buffer + ((fsector_t - buffer_min) << 9); @@ -2733,7 +2717,7 @@ static int make_raw_rw_request(void) max_sector = 2 * _floppy->sect / 3; if (fsector_t >= max_sector) { current_count_sectors = - minimum(_floppy->sect - fsector_t, + min_t(int, _floppy->sect - fsector_t, current_req->nr_sectors); return 1; } -- ~Randy ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] floppy98.c: use kernel min/max 2004-04-19 2:51 ` [PATCH] floppy98.c: use kernel min/max Randy.Dunlap @ 2004-04-19 12:14 ` Bartlomiej Zolnierkiewicz 2004-04-19 15:51 ` Randy.Dunlap 0 siblings, 1 reply; 9+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2004-04-19 12:14 UTC (permalink / raw) To: Randy.Dunlap, akpm; +Cc: linux-kernel, zwane Hi Randy, I wonder if PC9800 fixes are worth the hassle as PC9800 merge (AFAIR first patch went into 2.5.50!) was never finished. I think somebody should fix it or we should just remove it completely. Cheers, Bartlomiej On Monday 19 of April 2004 04:51, Randy.Dunlap wrote: > Convert floppy98.c to use kernel min/max, like floppy.c. > > > diffstat:= > drivers/block/floppy98.c | 28 ++++++---------------------- > 1 files changed, 6 insertions(+), 22 deletions(-) > > > diff -Naurp ./drivers/block/floppy98.c~fd98_minmax > ./drivers/block/floppy98.c --- > ./drivers/block/floppy98.c~fd98_minmax 2004-04-18 17:54:42.000000000 -0700 > +++ ./drivers/block/floppy98.c 2004-04-18 18:12:38.000000000 -0700 @@ > -720,25 +720,9 @@ static void reschedule_timeout(int drive > timeout_message = message; > } > > -static int maximum(int a, int b) > -{ > - if (a > b) > - return a; > - else > - return b; > -} > - > -#define INFBOUND(a,b) (a)=maximum((a),(b)); > - > -static int minimum(int a, int b) > -{ > - if (a < b) > - return a; > - else > - return b; > -} > +#define INFBOUND(a,b) (a)=max_t(int, a, b) > > -#define SUPBOUND(a,b) (a)=minimum((a),(b)); > +#define SUPBOUND(a,b) (a)=min_t(int, a, b) > > /* > * Bottom half floppy driver. > @@ -2556,12 +2540,12 @@ static void copy_buffer(int ssize, int m > int size, i; > > max_sector = transfer_size(ssize, > - minimum(max_sector, max_sector_2), > + min(max_sector, max_sector_2), > current_req->nr_sectors); > > if (current_count_sectors <= 0 && CT(COMMAND) == FD_WRITE && > buffer_max > fsector_t + current_req->nr_sectors) > - current_count_sectors = minimum(buffer_max - fsector_t, > + current_count_sectors = min_t(int, buffer_max - fsector_t, > current_req->nr_sectors); > > remaining = current_count_sectors << 9; > @@ -2580,7 +2564,7 @@ static void copy_buffer(int ssize, int m > } > #endif > > - buffer_max = maximum(max_sector, buffer_max); > + buffer_max = max(max_sector, buffer_max); > > dma_buffer = floppy_track_buffer + ((fsector_t - buffer_min) << 9); > > @@ -2733,7 +2717,7 @@ static int make_raw_rw_request(void) > max_sector = 2 * _floppy->sect / 3; > if (fsector_t >= max_sector) { > current_count_sectors = > - minimum(_floppy->sect - fsector_t, > + min_t(int, _floppy->sect - fsector_t, > current_req->nr_sectors); > return 1; > } > -- > ~Randy ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] floppy98.c: use kernel min/max 2004-04-19 12:14 ` Bartlomiej Zolnierkiewicz @ 2004-04-19 15:51 ` Randy.Dunlap 2004-04-19 16:59 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 9+ messages in thread From: Randy.Dunlap @ 2004-04-19 15:51 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: akpm, linux-kernel, zwane On Mon, 19 Apr 2004 14:14:15 +0200 Bartlomiej Zolnierkiewicz wrote: | | Hi Randy, | | I wonder if PC9800 fixes are worth the hassle as PC9800 merge | (AFAIR first patch went into 2.5.50!) was never finished. | | I think somebody should fix it or we should just remove it completely. I agree -- completely, on all counts, and I'm trying to take that up with Osamu Tomita, but he hasn't replied to my emails. BTW, I have fixes for about 95% of all of the PC-9800 modules and can successfully build a PC-9800 kernel, with IDE, SCSI, speaker, etc. However, I can't test it. So I think that it is fixable, but if it's been abandoned, it can also be removed. -- ~Randy ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] floppy98.c: use kernel min/max 2004-04-19 15:51 ` Randy.Dunlap @ 2004-04-19 16:59 ` Bartlomiej Zolnierkiewicz 2004-04-19 17:05 ` Christoph Hellwig 2004-04-19 17:09 ` Randy.Dunlap 0 siblings, 2 replies; 9+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2004-04-19 16:59 UTC (permalink / raw) To: Randy.Dunlap; +Cc: akpm, linux-kernel, zwane On Monday 19 of April 2004 17:51, Randy.Dunlap wrote: > On Mon, 19 Apr 2004 14:14:15 +0200 Bartlomiej Zolnierkiewicz wrote: > | Hi Randy, > | > | I wonder if PC9800 fixes are worth the hassle as PC9800 merge > | (AFAIR first patch went into 2.5.50!) was never finished. > | > | I think somebody should fix it or we should just remove it completely. > > I agree -- completely, on all counts, and I'm trying to take that up > with Osamu Tomita, but he hasn't replied to my emails. :-( > BTW, I have fixes for about 95% of all of the PC-9800 modules > and can successfully build a PC-9800 kernel, with IDE, SCSI, Cool, do you also have these patches? http://www.uwsg.iu.edu/hypermail/linux/kernel/0303.1/2045.html BTW at least PC9800 IDE support needs reworking - it is one BIG hack > speaker, etc. However, I can't test it. So I think that it is > fixable, but if it's been abandoned, it can also be removed. Yep, somebody needs to maintain it or at least report when it breaks. Cheers, Bartlomiej ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] floppy98.c: use kernel min/max 2004-04-19 16:59 ` Bartlomiej Zolnierkiewicz @ 2004-04-19 17:05 ` Christoph Hellwig 2004-04-19 18:05 ` Randy.Dunlap 2004-04-19 17:09 ` Randy.Dunlap 1 sibling, 1 reply; 9+ messages in thread From: Christoph Hellwig @ 2004-04-19 17:05 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: Randy.Dunlap, akpm, linux-kernel, zwane On Mon, Apr 19, 2004 at 06:59:29PM +0200, Bartlomiej Zolnierkiewicz wrote: > BTW at least PC9800 IDE support needs reworking - it is one BIG hack Please just kill it then. PC9800 wasn't completly merged ever and there haven't been atempts for ages. No need to stall development because of it. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] floppy98.c: use kernel min/max 2004-04-19 17:05 ` Christoph Hellwig @ 2004-04-19 18:05 ` Randy.Dunlap 2004-04-19 19:06 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 9+ messages in thread From: Randy.Dunlap @ 2004-04-19 18:05 UTC (permalink / raw) To: Christoph Hellwig; +Cc: B.Zolnierkiewicz, akpm, linux-kernel, zwane On Mon, 19 Apr 2004 18:05:22 +0100 Christoph Hellwig wrote: | On Mon, Apr 19, 2004 at 06:59:29PM +0200, Bartlomiej Zolnierkiewicz wrote: | > BTW at least PC9800 IDE support needs reworking - it is one BIG hack | | Please just kill it then. PC9800 wasn't completly merged ever and there | haven't been atempts for ages. No need to stall development because of it. Is some development stalled because of it? The current (status quo) isn't good. It either needs to be fixed or removed. -- ~Randy ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] floppy98.c: use kernel min/max 2004-04-19 18:05 ` Randy.Dunlap @ 2004-04-19 19:06 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 9+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2004-04-19 19:06 UTC (permalink / raw) To: Randy.Dunlap, Christoph Hellwig; +Cc: akpm, linux-kernel, zwane On Monday 19 of April 2004 20:05, Randy.Dunlap wrote: > On Mon, 19 Apr 2004 18:05:22 +0100 Christoph Hellwig wrote: > | On Mon, Apr 19, 2004 at 06:59:29PM +0200, Bartlomiej Zolnierkiewicz wrote: > | > BTW at least PC9800 IDE support needs reworking - it is one BIG hack > | > | Please just kill it then. PC9800 wasn't completly merged ever and there > | haven't been atempts for ages. No need to stall development because of > | it. > > Is some development stalled because of it? Well, for IDE there are bigger problems than PC9800... ;-) > The current (status quo) isn't good. > It either needs to be fixed or removed. Yep, there is no doubt that it slow downs development, i.e. recent i386 standard resources fixups/cleanups. Bartlomiej ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] floppy98.c: use kernel min/max 2004-04-19 16:59 ` Bartlomiej Zolnierkiewicz 2004-04-19 17:05 ` Christoph Hellwig @ 2004-04-19 17:09 ` Randy.Dunlap 1 sibling, 0 replies; 9+ messages in thread From: Randy.Dunlap @ 2004-04-19 17:09 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: akpm, linux-kernel, zwane On Mon, 19 Apr 2004 18:59:29 +0200 Bartlomiej Zolnierkiewicz wrote: | On Monday 19 of April 2004 17:51, Randy.Dunlap wrote: | > On Mon, 19 Apr 2004 14:14:15 +0200 Bartlomiej Zolnierkiewicz wrote: | > | Hi Randy, | > | | > | I wonder if PC9800 fixes are worth the hassle as PC9800 merge | > | (AFAIR first patch went into 2.5.50!) was never finished. | > | | > | I think somebody should fix it or we should just remove it completely. | > | > I agree -- completely, on all counts, and I'm trying to take that up | > with Osamu Tomita, but he hasn't replied to my emails. | | :-( | | > BTW, I have fixes for about 95% of all of the PC-9800 modules | > and can successfully build a PC-9800 kernel, with IDE, SCSI, | | Cool, do you also have these patches? | http://www.uwsg.iu.edu/hypermail/linux/kernel/0303.1/2045.html I saw that, but I began with the latest linux98 tarball that I could find at http://sourceforge.jp/projects/linux98/, for 2.5.67-bk9. There are still lots of build issues with that tarball, but I have most of them fixed. | BTW at least PC9800 IDE support needs reworking - it is one BIG hack Not a surprise. | > speaker, etc. However, I can't test it. So I think that it is | > fixable, but if it's been abandoned, it can also be removed. | | Yep, somebody needs to maintain it or at least report when it breaks. Yup. -- ~Randy ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20040418194813.629e75bd.randy.dunlap@verizon.net>]
* [PATCH] floppy98.c: use C99 struct initializers [not found] ` <20040418194813.629e75bd.randy.dunlap@verizon.net> @ 2004-04-19 2:51 ` Randy.Dunlap 0 siblings, 0 replies; 9+ messages in thread From: Randy.Dunlap @ 2004-04-19 2:51 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, zwane Convert (most of) floppy98.c to use C99 struct initializers, like floppy.c. diffstat:= drivers/block/floppy98.c | 60 +++++++++++++++++++++++------------------------ 1 files changed, 30 insertions(+), 30 deletions(-) diff -Naurp ./drivers/block/floppy98.c~fd98_c99 ./drivers/block/floppy98.c --- ./drivers/block/floppy98.c~fd98_c99 2004-04-18 18:12:10.000000000 -0700 +++ ./drivers/block/floppy98.c 2004-04-18 19:20:18.000000000 -0700 @@ -907,9 +907,9 @@ static void motor_off_callback(unsigned } static struct timer_list motor_off_timer[N_FDC] = { - {data: 0, function: motor_off_callback}, + {.data = 0, .function = motor_off_callback}, #if N_FDC > 1 - {data: 1, function: motor_off_callback}, + {.data = 1, .function = motor_off_callback}, #endif #if N_FDC > 2 # error "N_FDC > 2; please fix initializer for motor_off_timer[]" @@ -2071,17 +2071,17 @@ static void do_wakeup(void) } static struct cont_t wakeup_cont = { - empty, - do_wakeup, - empty, - (done_f) empty + .interrupt = empty, + .redo = do_wakeup, + .error = empty, + .done = (done_f) empty }; static struct cont_t intr_cont = { - empty, - process_fd_request, - empty, - (done_f) empty + .interrupt = empty, + .redo = process_fd_request, + .error = empty, + .done = (done_f) empty }; static int wait_til_done(void (*handler) (void), int interruptible) @@ -2303,10 +2303,10 @@ static void redo_format(void) } static struct cont_t format_cont = { - format_interrupt, - redo_format, - bad_flp_intr, - generic_done + .interrupt = format_interrupt, + .redo = redo_format, + .error = bad_flp_intr, + .done = generic_done }; static int do_format(int drive, struct format_descr *tmp_format_req) @@ -3026,10 +3026,10 @@ static void redo_fd_request(void) } static struct cont_t rw_cont = { - rw_interrupt, - redo_fd_request, - bad_flp_intr, - request_done + .interrupt = rw_interrupt, + .redo = redo_fd_request, + .error = bad_flp_intr, + .done = request_done }; static void process_fd_request(void) @@ -3064,10 +3064,10 @@ static void do_fd_request(request_queue_ } static struct cont_t poll_cont = { - success_and_wakeup, - floppy_ready, - generic_failure, - generic_done + .interrupt = success_and_wakeup, + .redo = floppy_ready, + .error = generic_failure, + .done = generic_done }; static int poll_drive(int interruptible, int flag) @@ -3100,10 +3100,10 @@ static void reset_intr(void) } static struct cont_t reset_cont = { - reset_intr, - success_and_wakeup, - generic_failure, - generic_done + .interrupt = reset_intr, + .redo = success_and_wakeup, + .error = generic_failure, + .done = generic_done }; static int user_reset_fdc(int drive, int arg, int interruptible) @@ -3207,10 +3207,10 @@ static void raw_cmd_done(int flag) } static struct cont_t raw_cmd_cont = { - success_and_wakeup, - floppy_start, - generic_failure, - raw_cmd_done + .interrupt = success_and_wakeup, + .redo = floppy_start, + .error = generic_failure, + .done = raw_cmd_done }; static inline int raw_cmd_copyout(int cmd, char *param, ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-04-19 19:08 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20040418194357.4cd02a06.rddunlap@osdl.org>
2004-04-19 2:51 ` [PATCH] floppy98.c: use kernel min/max Randy.Dunlap
2004-04-19 12:14 ` Bartlomiej Zolnierkiewicz
2004-04-19 15:51 ` Randy.Dunlap
2004-04-19 16:59 ` Bartlomiej Zolnierkiewicz
2004-04-19 17:05 ` Christoph Hellwig
2004-04-19 18:05 ` Randy.Dunlap
2004-04-19 19:06 ` Bartlomiej Zolnierkiewicz
2004-04-19 17:09 ` Randy.Dunlap
[not found] ` <20040418194813.629e75bd.randy.dunlap@verizon.net>
2004-04-19 2:51 ` [PATCH] floppy98.c: use C99 struct initializers Randy.Dunlap
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®