* save_flags() should take unsigned long
@ 2002-03-04 18:46 Pavel Machek
2002-03-26 13:29 ` David Weinehall
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2002-03-04 18:46 UTC (permalink / raw)
To: kernel list, Rusty trivial patch monkey Russell
Hi!
...and here's patch to fix it... Please apply.
Pavel
--- linux/drivers/ide/ide.c Sun Nov 11 18:48:09 2001
+++ linux.uns/drivers/ide/ide.c Mon Mar 4 19:35:21 2002
@@ -1864,7 +1864,7 @@
ide_drive_t *drive;
ide_hwgroup_t *hwgroup;
unsigned int p, major, minor;
- long flags;
+ unsigned long flags;
if ((drive = get_info_ptr(i_rdev)) == NULL)
return -ENODEV;
--- linux/drivers/scsi/sym53c8xx.c Tue Jan 15 11:08:49 2002
+++ linux.uns/drivers/scsi/sym53c8xx.c Mon Mar 4 19:35:17 2002
@@ -14111,7 +14111,7 @@
if (len)
return -EINVAL;
else {
- long flags;
+ unsigned long flags;
NCR_LOCK_NCB(np, flags);
ncr_usercmd (np);
--- linux/include/linux/skbuff.h Thu Feb 28 23:15:23 2002
+++ linux.uns/include/linux/skbuff.h Mon Mar 4 19:24:35 2002
@@ -588,7 +588,7 @@
static inline struct sk_buff *skb_dequeue(struct sk_buff_head *list)
{
- long flags;
+ unsigned long flags;
struct sk_buff *result;
spin_lock_irqsave(&list->lock, flags);
@@ -737,7 +737,7 @@
static inline struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list)
{
- long flags;
+ unsigned long flags;
struct sk_buff *result;
spin_lock_irqsave(&list->lock, flags);
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: save_flags() should take unsigned long
2002-03-04 18:46 save_flags() should take unsigned long Pavel Machek
@ 2002-03-26 13:29 ` David Weinehall
2002-03-26 13:46 ` Pavel Machek
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: David Weinehall @ 2002-03-26 13:29 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list, Rusty trivial patch monkey Russell
On Mon, Mar 04, 2002 at 07:46:53PM +0100, Pavel Machek wrote:
> Hi!
>
> ...and here's patch to fix it... Please apply.
The correct way to fix this would be:
<in suitable header-file; suggestions welcome>
typedef flags_t unsigned long;
If someone can just come up with the proper header-file to use, I have
a patch that fixes up all (?) code.
My suggestion would be to keep the typedef in the same header-file as
save_flags/restore_flags.
Regards: David Weinehall
_ _
// David Weinehall <tao@acc.umu.se> /> Northern lights wander \\
// Maintainer of the v2.0 kernel // Dance across the winter sky //
\> http://www.acc.umu.se/~tao/ </ Full colour fire </
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: save_flags() should take unsigned long
2002-03-26 13:29 ` David Weinehall
@ 2002-03-26 13:46 ` Pavel Machek
2002-03-26 13:47 ` Richard B. Johnson
2002-03-26 16:54 ` Russell King
2 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2002-03-26 13:46 UTC (permalink / raw)
To: David Weinehall; +Cc: kernel list, Rusty trivial patch monkey Russell
Hi!
> >
> > ...and here's patch to fix it... Please apply.
>
> The correct way to fix this would be:
>
> <in suitable header-file; suggestions welcome>
> typedef flags_t unsigned long;
>
> If someone can just come up with the proper header-file to use, I have
> a patch that fixes up all (?) code.
>
> My suggestion would be to keep the typedef in the same header-file as
> save_flags/restore_flags.
Yep, looks good. Try to feed it as trivial to rusty ;-).
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: save_flags() should take unsigned long
2002-03-26 13:29 ` David Weinehall
2002-03-26 13:46 ` Pavel Machek
@ 2002-03-26 13:47 ` Richard B. Johnson
2002-03-26 16:54 ` Russell King
2 siblings, 0 replies; 5+ messages in thread
From: Richard B. Johnson @ 2002-03-26 13:47 UTC (permalink / raw)
To: David Weinehall
Cc: Pavel Machek, kernel list, Rusty trivial patch monkey Russell
On Tue, 26 Mar 2002, David Weinehall wrote:
> On Mon, Mar 04, 2002 at 07:46:53PM +0100, Pavel Machek wrote:
> > Hi!
> >
> > ...and here's patch to fix it... Please apply.
>
> The correct way to fix this would be:
>
> <in suitable header-file; suggestions welcome>
> typedef flags_t unsigned long;
I don't think it takes an 'unsigned long'. Instead, it takes 'size_t'.
This makes it work in all architectures because 'size_t' is the
size of a register.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Windows-2000/Professional isn't.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: save_flags() should take unsigned long
2002-03-26 13:29 ` David Weinehall
2002-03-26 13:46 ` Pavel Machek
2002-03-26 13:47 ` Richard B. Johnson
@ 2002-03-26 16:54 ` Russell King
2 siblings, 0 replies; 5+ messages in thread
From: Russell King @ 2002-03-26 16:54 UTC (permalink / raw)
To: David Weinehall
Cc: Pavel Machek, kernel list, Rusty trivial patch monkey Russell
On Tue, Mar 26, 2002 at 02:29:55PM +0100, David Weinehall wrote:
> The correct way to fix this would be:
>
> <in suitable header-file; suggestions welcome>
> typedef flags_t unsigned long;
You mean typedef unsigned long flags_t;
However, people will still write:
{
int flags;
save_flags(flags);
because 'int' is faster to type than 'flags_t'. About the only way
you're going to stop it dead is to do:
typedef struct { unsigned long val; } flags_t;
and then save_flags(x)/restore_flags(x) use (x).val
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-03-26 16:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-04 18:46 save_flags() should take unsigned long Pavel Machek
2002-03-26 13:29 ` David Weinehall
2002-03-26 13:46 ` Pavel Machek
2002-03-26 13:47 ` Richard B. Johnson
2002-03-26 16:54 ` Russell King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox