* [Kernel-janitors] [PATCH] minmax-removal arch/ia64/kernel/unwind.c
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
@ 2004-08-15 11:43 ` Michael Veeck
2004-08-15 11:43 ` [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:43 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-ia64-kernel.patch --]
[-- Type: text/plain, Size: 2526 bytes --]
--- linux-2.6.8-old/arch/ia64/kernel/unwind.c 2004-08-14 11:49:01.000000000 +0200
+++ linux-2.6.8-new/arch/ia64/kernel/unwind.c 2004-08-15 13:03:05.789019200 +0200
@@ -47,7 +47,6 @@
#include "entry.h"
#include "unwind_i.h"
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define p5 5
#define UNW_LOG_CACHE_SIZE 7 /* each unw_script is ~256 bytes in size */
@@ -963,13 +962,13 @@ static inline void
desc_mem_stack_f (unw_word t, unw_word size, struct unw_state_record *sr)
{
set_reg(sr->curr.reg + UNW_REG_PSP, UNW_WHERE_NONE,
- sr->region_start + MIN((int)t, sr->region_len - 1), 16*size);
+ sr->region_start + min_t(int, t, sr->region_len - 1), 16*size);
}
static inline void
desc_mem_stack_v (unw_word t, struct unw_state_record *sr)
{
- sr->curr.reg[UNW_REG_PSP].when = sr->region_start + MIN((int)t, sr->region_len - 1);
+ sr->curr.reg[UNW_REG_PSP].when = sr->region_start + min_t(int, t, sr->region_len - 1);
}
static inline void
@@ -1005,7 +1004,7 @@ desc_reg_when (unsigned char regnum, unw
if (reg->where == UNW_WHERE_NONE)
reg->where = UNW_WHERE_GR_SAVE;
- reg->when = sr->region_start + MIN((int)t, sr->region_len - 1);
+ reg->when = sr->region_start + min_t(int, t, sr->region_len - 1);
}
static inline void
@@ -1073,7 +1072,7 @@ desc_label_state (unw_word label, struct
static inline int
desc_is_active (unsigned char qp, unw_word t, struct unw_state_record *sr)
{
- if (sr->when_target <= sr->region_start + MIN((int)t, sr->region_len - 1))
+ if (sr->when_target <= sr->region_start + min_t(int, t, sr->region_len - 1))
return 0;
if (qp > 0) {
if ((sr->pr_val & (1UL << qp)) == 0)
@@ -1114,7 +1113,7 @@ desc_spill_reg_p (unsigned char qp, unw_
r = sr->curr.reg + decode_abreg(abreg, 0);
r->where = where;
- r->when = sr->region_start + MIN((int)t, sr->region_len - 1);
+ r->when = sr->region_start + min_t(int, t, sr->region_len - 1);
r->val = (ytreg & 0x7f);
}
@@ -1129,7 +1128,7 @@ desc_spill_psprel_p (unsigned char qp, u
r = sr->curr.reg + decode_abreg(abreg, 1);
r->where = UNW_WHERE_PSPREL;
- r->when = sr->region_start + MIN((int)t, sr->region_len - 1);
+ r->when = sr->region_start + min_t(int, t, sr->region_len - 1);
r->val = 0x10 - 4*pspoff;
}
@@ -1144,7 +1143,7 @@ desc_spill_sprel_p (unsigned char qp, un
r = sr->curr.reg + decode_abreg(abreg, 1);
r->where = UNW_WHERE_SPREL;
- r->when = sr->region_start + MIN((int)t, sr->region_len - 1);
+ r->when = sr->region_start + min_t(int, t, sr->region_len - 1);
r->val = 4*spoff;
}
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* [Kernel-janitors] [PATCH] minmax-removal
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
2004-08-15 11:43 ` [Kernel-janitors] [PATCH] minmax-removal arch/ia64/kernel/unwind.c Michael Veeck
@ 2004-08-15 11:43 ` Michael Veeck
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal arch/m68k/kernel/bios32.c Michael Veeck
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:43 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-ia64-sn.patch --]
[-- Type: text/plain, Size: 1269 bytes --]
--- linux-2.6.8-old/arch/ia64/sn/fakeprom/fw-emu.c 2004-08-14 11:49:01.000000000 +0200
+++ linux-2.6.8-new/arch/ia64/sn/fakeprom/fw-emu.c 2004-08-15 13:01:12.151294760 +0200
@@ -77,8 +77,6 @@
#define MB (1024*1024UL)
#define GB (MB*1024UL)
#define BOOT_PARAM_ADDR 0x40000
-#define MAX(i,j) ((i) > (j) ? (i) : (j))
-#define MIN(i,j) ((i) < (j) ? (i) : (j))
#define ALIGN8(p) (((long)(p) +7) & ~7)
#define FPROM_BUG() do {while (1);} while (0)
@@ -497,7 +495,7 @@ sys_fw_init (const char *args, int argle
num_nodes = GetNumNodes();
num_cpus = GetNumCpus();
for (max_nasid=0, cnode=0; cnode<num_nodes; cnode++)
- max_nasid = MAX(max_nasid, GetNasid(cnode));
+ max_nasid = max(max_nasid, GetNasid(cnode));
memset(fw_mem, 0, sizeof(fw_mem));
@@ -670,7 +668,7 @@ sys_fw_init (const char *args, int argle
for (i=0; i<=max_nasid; i++)
for (j=0; j<=max_nasid; j++)
if (nasid_present(i) && nasid_present(j))
- *(cp+PROXIMITY_DOMAIN(i)*acpi_slit->localities+PROXIMITY_DOMAIN(j)) = 10 + MIN(254, 5*abs(i-j));
+ *(cp+PROXIMITY_DOMAIN(i)*acpi_slit->localities+PROXIMITY_DOMAIN(j)) = 10 + min(254, 5*abs(i-j));
cp = acpi_slit->entry + acpi_slit->localities*acpi_slit->localities;
acpi_checksum(&acpi_slit->header, cp - (char*)acpi_slit);
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* [Kernel-janitors] [PATCH] minmax-removal arch/m68k/kernel/bios32.c
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
2004-08-15 11:43 ` [Kernel-janitors] [PATCH] minmax-removal arch/ia64/kernel/unwind.c Michael Veeck
2004-08-15 11:43 ` [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
@ 2004-08-15 11:44 ` Michael Veeck
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:44 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-m68k-kernel.patch --]
[-- Type: text/plain, Size: 1069 bytes --]
--- linux-2.6.8-old/arch/m68k/kernel/bios32.c 2004-08-14 11:49:02.000000000 +0200
+++ linux-2.6.8-new/arch/m68k/kernel/bios32.c 2004-08-15 13:05:10.251098088 +0200
@@ -46,8 +46,6 @@
#define ALIGN(val,align) (((val) + ((align) - 1)) & ~((align) - 1))
-#define MAX(val1, val2) (((val1) > (val2)) ? val1 : val2)
-
/*
* Offsets relative to the I/O and memory base addresses from where resources
* are allocated.
@@ -176,7 +174,7 @@ static void __init layout_dev(struct pci
* Align to multiple of size of minimum base.
*/
- alignto = MAX(0x040, size) ;
+ alignto = max_t(unsigned int, 0x040, size);
base = ALIGN(io_base, alignto);
io_base = base + size;
pci_write_config_dword(dev, reg, base | PCI_BASE_ADDRESS_SPACE_IO);
@@ -219,7 +217,7 @@ static void __init layout_dev(struct pci
* Align to multiple of size of minimum base.
*/
- alignto = MAX(0x1000, size) ;
+ alignto = max_t(unsigned int, 0x1000, size);
base = ALIGN(mem_base, alignto);
mem_base = base + size;
pci_write_config_dword(dev, reg, base);
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* [Kernel-janitors] [PATCH] minmax-removal
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (2 preceding siblings ...)
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal arch/m68k/kernel/bios32.c Michael Veeck
@ 2004-08-15 11:44 ` Michael Veeck
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal arch/s390/kernel/debug.c Michael Veeck
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:44 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-mips-au1000.patch --]
[-- Type: text/plain, Size: 381 bytes --]
--- linux-2.6.8-old/arch/mips/au1000/common/usbdev.c 2004-08-14 11:49:09.000000000 +0200
+++ linux-2.6.8-new/arch/mips/au1000/common/usbdev.c 2004-08-15 13:08:00.661191816 +0200
@@ -61,8 +61,6 @@
#define vdbg(fmt, arg...) do {} while (0)
#endif
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
#define ALLOC_FLAGS (in_interrupt () ? GFP_ATOMIC : GFP_KERNEL)
#define EP_FIFO_DEPTH 8
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* [Kernel-janitors] [PATCH] minmax-removal arch/s390/kernel/debug.c
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (3 preceding siblings ...)
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
@ 2004-08-15 11:44 ` Michael Veeck
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal arch/sh/boards/bigsur/io.c Michael Veeck
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:44 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-s390-kernel.patch --]
[-- Type: text/plain, Size: 2511 bytes --]
--- linux-2.6.8-old/arch/s390/kernel/debug.c 2004-08-14 11:49:10.000000000 +0200
+++ linux-2.6.8-new/arch/s390/kernel/debug.c 2004-08-15 13:14:05.860673056 +0200
@@ -24,7 +24,6 @@
#include <asm/debug.h>
-#define MIN(a,b) (((a)<(b))?(a):(b))
#define DEBUG_PROLOG_ENTRY -1
/* typedefs */
@@ -435,7 +434,7 @@ static ssize_t debug_output(struct file
while(count < len){
size = debug_format_entry(p_info);
- size = MIN((len - count), (size - entry_offset));
+ size = min((len - count), (size - entry_offset));
if(size){
if (copy_to_user(user_buf + count,
@@ -723,7 +722,7 @@ debug_entry_t *debug_event_common(debug_
spin_lock_irqsave(&id->lock, flags);
active = get_active_entry(id);
memset(DEBUG_DATA(active), 0, id->buf_size);
- memcpy(DEBUG_DATA(active), buf, MIN(len, id->buf_size));
+ memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size));
debug_finish_entry(id, active, level, 0);
spin_unlock_irqrestore(&id->lock, flags);
@@ -744,7 +743,7 @@ debug_entry_t *debug_exception_common(de
spin_lock_irqsave(&id->lock, flags);
active = get_active_entry(id);
memset(DEBUG_DATA(active), 0, id->buf_size);
- memcpy(DEBUG_DATA(active), buf, MIN(len, id->buf_size));
+ memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size));
debug_finish_entry(id, active, level, 1);
spin_unlock_irqrestore(&id->lock, flags);
@@ -789,7 +788,7 @@ debug_entry_t *debug_sprintf_event(debug
curr_event=(debug_sprintf_entry_t *) DEBUG_DATA(active);
va_start(ap,string);
curr_event->string=string;
- for(idx=0;idx<MIN(numargs,((id->buf_size / sizeof(long))-1));idx++)
+ for(idx=0;idx<min(numargs,((id->buf_size / sizeof(long))-1));idx++)
curr_event->args[idx]=va_arg(ap,long);
va_end(ap);
debug_finish_entry(id, active, level, 0);
@@ -821,7 +820,7 @@ debug_entry_t *debug_sprintf_exception(d
curr_event=(debug_sprintf_entry_t *)DEBUG_DATA(active);
va_start(ap,string);
curr_event->string=string;
- for(idx=0;idx<MIN(numargs,((id->buf_size / sizeof(long))-1));idx++)
+ for(idx=0;idx<min(numargs,((id->buf_size / sizeof(long))-1));idx++)
curr_event->args[idx]=va_arg(ap,long);
va_end(ap);
debug_finish_entry(id, active, level, 1);
@@ -1157,7 +1156,7 @@ int debug_sprintf_format_fn(debug_info_t
}
/* number of arguments used for sprintf (without the format string) */
- num_used_args = MIN(DEBUG_SPRINTF_MAX_ARGS, (num_longs - 1));
+ num_used_args = min(DEBUG_SPRINTF_MAX_ARGS, (num_longs - 1));
memset(index,0, DEBUG_SPRINTF_MAX_ARGS * sizeof(int));
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* [Kernel-janitors] [PATCH] minmax-removal arch/sh/boards/bigsur/io.c
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (4 preceding siblings ...)
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal arch/s390/kernel/debug.c Michael Veeck
@ 2004-08-15 11:44 ` Michael Veeck
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:44 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-sh-boards.patch --]
[-- Type: text/plain, Size: 1267 bytes --]
--- linux-2.6.8-old/arch/sh/boards/bigsur/io.c 2004-08-14 11:48:56.000000000 +0200
+++ linux-2.6.8-new/arch/sh/boards/bigsur/io.c 2004-08-15 13:23:10.392891576 +0200
@@ -37,10 +37,6 @@ static u8 bigsur_iomap_lo_shift[BIGSUR_I
static u32 bigsur_iomap_hi[BIGSUR_IOMAP_HI_NMAP];
static u8 bigsur_iomap_hi_shift[BIGSUR_IOMAP_HI_NMAP];
-#ifndef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-#endif
-
void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift)
{
u32 port, endport = baseport + nports;
@@ -57,7 +53,7 @@ void bigsur_port_map(u32 baseport, u32 n
addr += (1<<(BIGSUR_IOMAP_LO_SHIFT));
}
- for (port = MAX(baseport, BIGSUR_IOMAP_LO_THRESH) ;
+ for (port = max(baseport, BIGSUR_IOMAP_LO_THRESH);
port < endport && port < BIGSUR_IOMAP_HI_THRESH ;
port += (1<<BIGSUR_IOMAP_HI_SHIFT)) {
pr_debug(" maphi[0x%x] = 0x%08x\n", port, addr);
@@ -80,7 +76,7 @@ void bigsur_port_unmap(u32 baseport, u32
bigsur_iomap_lo[port>>BIGSUR_IOMAP_LO_SHIFT] = 0;
}
- for (port = MAX(baseport, BIGSUR_IOMAP_LO_THRESH) ;
+ for (port = max(baseport, BIGSUR_IOMAP_LO_THRESH);
port < endport && port < BIGSUR_IOMAP_HI_THRESH ;
port += (1<<BIGSUR_IOMAP_HI_SHIFT)) {
bigsur_iomap_hi[port>>BIGSUR_IOMAP_HI_SHIFT] = 0;
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* [Kernel-janitors] [PATCH] minmax-removal
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (5 preceding siblings ...)
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal arch/sh/boards/bigsur/io.c Michael Veeck
@ 2004-08-15 11:44 ` Michael Veeck
2004-08-15 11:45 ` Michael Veeck
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:44 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-sh-cchips.patch --]
[-- Type: text/plain, Size: 1376 bytes --]
--- linux-2.6.8-old/arch/sh/cchips/hd6446x/hd64465/io.c 2004-08-14 11:48:56.000000000 +0200
+++ linux-2.6.8-new/arch/sh/cchips/hd6446x/hd64465/io.c 2004-08-15 13:22:12.517689944 +0200
@@ -48,10 +48,6 @@ static unsigned char hd64465_iomap_lo_sh
static unsigned long hd64465_iomap_hi[HD64465_IOMAP_HI_NMAP];
static unsigned char hd64465_iomap_hi_shift[HD64465_IOMAP_HI_NMAP];
-#ifndef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-#endif
-
#define PORT2ADDR(x) (sh_mv.mv_isa_port2addr(x))
void hd64465_port_map(unsigned short baseport, unsigned int nports,
@@ -71,7 +67,7 @@ void hd64465_port_map(unsigned short bas
addr += (1<<(HD64465_IOMAP_LO_SHIFT));
}
- for (port = MAX(baseport, HD64465_IOMAP_LO_THRESH) ;
+ for (port = max_t(unsigned int, baseport, HD64465_IOMAP_LO_THRESH);
port < endport && port < HD64465_IOMAP_HI_THRESH ;
port += (1<<HD64465_IOMAP_HI_SHIFT)) {
DPRINTK(" maphi[0x%x] = 0x%08lx\n", port, addr);
@@ -95,7 +91,7 @@ void hd64465_port_unmap(unsigned short b
hd64465_iomap_lo[port>>HD64465_IOMAP_LO_SHIFT] = 0;
}
- for (port = MAX(baseport, HD64465_IOMAP_LO_THRESH) ;
+ for (port = max_t(unsigned int, baseport, HD64465_IOMAP_LO_THRESH);
port < endport && port < HD64465_IOMAP_HI_THRESH ;
port += (1<<HD64465_IOMAP_HI_SHIFT)) {
hd64465_iomap_hi[port>>HD64465_IOMAP_HI_SHIFT] = 0;
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* [Kernel-janitors] [PATCH] minmax-removal
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (6 preceding siblings ...)
2004-08-15 11:44 ` [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
@ 2004-08-15 11:45 ` Michael Veeck
2004-08-19 14:57 ` maximilian attems
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-08-15 11:45 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Since I dont have the hardware those patches are not tested.
Best regards
Veeck
Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
[-- Attachment #2: minmax-arch-um-drivers.patch --]
[-- Type: text/plain, Size: 984 bytes --]
--- linux-2.6.8-old/arch/um/drivers/mconsole_user.c 2004-08-14 11:48:56.000000000 +0200
+++ linux-2.6.8-new/arch/um/drivers/mconsole_user.c 2004-08-15 12:50:48.610087432 +0200
@@ -67,8 +67,6 @@ static struct mconsole_command *mconsole
return(NULL);
}
-#define MIN(a,b) ((a)<(b) ? (a):(b))
-
#define STRINGX(x) #x
#define STRING(x) STRINGX(x)
@@ -86,7 +84,7 @@ int mconsole_get_request(int fd, struct
if(req->request.magic != MCONSOLE_MAGIC){
/* Unversioned request */
- len = MIN(sizeof(req->request.data) - 1,
+ len = min_t(int, sizeof(req->request.data) - 1,
strlen((char *) &req->request));
memmove(req->request.data, &req->request, len);
req->request.data[len] = '\0';
@@ -131,7 +129,7 @@ int mconsole_reply(struct mc_request *re
/* err can only be true on the first packet */
err = 0;
- len = MIN(total, MCONSOLE_MAX_DATA - 1);
+ len = min(total, MCONSOLE_MAX_DATA - 1);
if(len == total) reply.more = more;
else reply.more = 1;
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Kernel-janitors] [PATCH] minmax-removal
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (7 preceding siblings ...)
2004-08-15 11:45 ` Michael Veeck
@ 2004-08-19 14:57 ` maximilian attems
2004-09-21 22:03 ` maximilian attems
2004-09-21 22:38 ` Michael Veeck
10 siblings, 0 replies; 12+ messages in thread
From: maximilian attems @ 2004-08-19 14:57 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 175 bytes --]
On Sun, 15 Aug 2004, Michael Veeck wrote:
> Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
> calls to use kernel.h macros instead.
thx all applied
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Kernel-janitors] [PATCH] minmax-removal
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (8 preceding siblings ...)
2004-08-19 14:57 ` maximilian attems
@ 2004-09-21 22:03 ` maximilian attems
2004-09-21 22:38 ` Michael Veeck
10 siblings, 0 replies; 12+ messages in thread
From: maximilian attems @ 2004-09-21 22:03 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]
On Sun, 15 Aug 2004, Michael Veeck wrote:
> Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
> calls to use kernel.h macros instead.
>
> Since I dont have the hardware those patches are not tested.
>
> Best regards
> Veeck
>
> Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
>
>
>
>
> --- linux-2.6.8-old/arch/um/drivers/mconsole_user.c 2004-08-14 11:48:56.000000000 +0200
> +++ linux-2.6.8-new/arch/um/drivers/mconsole_user.c 2004-08-15 12:50:48.610087432 +0200
> @@ -67,8 +67,6 @@ static struct mconsole_command *mconsole
> return(NULL);
> }
>
> -#define MIN(a,b) ((a)<(b) ? (a):(b))
> -
> #define STRINGX(x) #x
> #define STRING(x) STRINGX(x)
>
> @@ -86,7 +84,7 @@ int mconsole_get_request(int fd, struct
>
> if(req->request.magic != MCONSOLE_MAGIC){
> /* Unversioned request */
> - len = MIN(sizeof(req->request.data) - 1,
> + len = min_t(int, sizeof(req->request.data) - 1,
> strlen((char *) &req->request));
> memmove(req->request.data, &req->request, len);
> req->request.data[len] = '\0';
> @@ -131,7 +129,7 @@ int mconsole_reply(struct mc_request *re
> /* err can only be true on the first packet */
> err = 0;
>
> - len = MIN(total, MCONSOLE_MAX_DATA - 1);
> + len = min(total, MCONSOLE_MAX_DATA - 1);
>
> if(len == total) reply.more = more;
> else reply.more = 1;
no idea why that file is in the kernel,
it's a userspace programm dropping this patch.
a++ maks
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Kernel-janitors] [PATCH] minmax-removal
2004-08-15 11:43 [Kernel-janitors] [PATCH] minmax-removal Michael Veeck
` (9 preceding siblings ...)
2004-09-21 22:03 ` maximilian attems
@ 2004-09-21 22:38 ` Michael Veeck
10 siblings, 0 replies; 12+ messages in thread
From: Michael Veeck @ 2004-09-21 22:38 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]
Hmm, so who's then to ask for permission to throw it out since we are
the janitors?
maximilian attems schrieb:
> On Sun, 15 Aug 2004, Michael Veeck wrote:
>
>
>>Patch (against 2.6.8.1) removes unnecessary min/max macros and changes
>>calls to use kernel.h macros instead.
>>
>>Since I dont have the hardware those patches are not tested.
>>
>>Best regards
>>Veeck
>>
>>Signed-off-by: Michael Veeck <michael.veeck@gmx.net>
>>
>>
>>
>>
>
>>--- linux-2.6.8-old/arch/um/drivers/mconsole_user.c 2004-08-14 11:48:56.000000000 +0200
>>+++ linux-2.6.8-new/arch/um/drivers/mconsole_user.c 2004-08-15 12:50:48.610087432 +0200
>>@@ -67,8 +67,6 @@ static struct mconsole_command *mconsole
>> return(NULL);
>> }
>>
>>-#define MIN(a,b) ((a)<(b) ? (a):(b))
>>-
>> #define STRINGX(x) #x
>> #define STRING(x) STRINGX(x)
>>
>>@@ -86,7 +84,7 @@ int mconsole_get_request(int fd, struct
>>
>> if(req->request.magic != MCONSOLE_MAGIC){
>> /* Unversioned request */
>>- len = MIN(sizeof(req->request.data) - 1,
>>+ len = min_t(int, sizeof(req->request.data) - 1,
>> strlen((char *) &req->request));
>> memmove(req->request.data, &req->request, len);
>> req->request.data[len] = '\0';
>>@@ -131,7 +129,7 @@ int mconsole_reply(struct mc_request *re
>> /* err can only be true on the first packet */
>> err = 0;
>>
>>- len = MIN(total, MCONSOLE_MAX_DATA - 1);
>>+ len = min(total, MCONSOLE_MAX_DATA - 1);
>>
>> if(len == total) reply.more = more;
>> else reply.more = 1;
>
>
> no idea why that file is in the kernel,
> it's a userspace programm dropping this patch.
>
> a++ maks
>
>
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 12+ messages in thread