linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] 2.4.21-rc1 pointless IDE noise reduction
@ 2003-04-24 23:25 Chuck Ebbert
  2003-04-25 15:08 ` Timothy Miller
  0 siblings, 1 reply; 15+ messages in thread
From: Chuck Ebbert @ 2003-04-24 23:25 UTC (permalink / raw)
  To: Timothy Miller; +Cc: linux-kernel

Timothy Miller wrote:


> Two alternatives:
>
> (a)     !!(x & 0x400)
> 
> (b)     (x & 0x400) >> 10



I like either of these:

   #define FOO_BITS 0x400
   #define test_mask(t,m) ( !!((t) & (m)) )
   ...
   return test_mask(x, FOO_BITS);

or

   return (x & FOO_BITS) != 0;

Those double exclamation points should be hidden in macros. :)



------
 Chuck

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: [PATCH] 2.4.21-rc1 pointless IDE noise reduction
@ 2003-04-24 15:25 Chuck Ebbert
  2003-04-24 15:59 ` Richard B. Johnson
  0 siblings, 1 reply; 15+ messages in thread
From: Chuck Ebbert @ 2003-04-24 15:25 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

Jens Axboe wrote:


>> +	return((drive->id->cfs_enable_1 & 0x0400) ? 1 : 0);
>>  }
>
> Seconded, it causes a lot more confusion than it does good.


  The return looks like a function call in that last line.

  That's one of the few things I find really annoying -- extra parens
are fine when they make code clearer, but not there.


-------
 Chuck [ C Style Police, badge #666 ]

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH] 2.4.21-rc1 pointless IDE noise reduction
@ 2003-04-24  9:34 Erik Andersen
  2003-04-24 10:28 ` Jens Axboe
  2003-04-27 12:21 ` Adrian Bunk
  0 siblings, 2 replies; 15+ messages in thread
From: Erik Andersen @ 2003-04-24  9:34 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-kernel

The ide driver does not list whether drives support things like
write cache, SMART, SECURITY ERASE UNIT.  But for some silly
reason it tells us at boot whether each drive is capable of
supporting the Host Protected Area feature set.  If people want
to know the capabilites of their drive, they can run 'hdparm' 
and find out.

This patch removes this pointless noise.  Please apply,


--- linux/drivers/ide/ide-disk.c.orig	2003-04-24 03:23:53.000000000 -0600
+++ linux/drivers/ide/ide-disk.c	2003-04-24 03:24:54.000000000 -0600
@@ -1133,10 +1133,7 @@
  */
 static inline int idedisk_supports_host_protected_area(ide_drive_t *drive)
 {
-	int flag = (drive->id->cfs_enable_1 & 0x0400) ? 1 : 0;
-	if (flag)
-		printk("%s: host protected area => %d\n", drive->name, flag);
-	return flag;
+	return((drive->id->cfs_enable_1 & 0x0400) ? 1 : 0);
 }
 
 /*

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-04-27 17:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-24 23:25 [PATCH] 2.4.21-rc1 pointless IDE noise reduction Chuck Ebbert
2003-04-25 15:08 ` Timothy Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-04-24 15:25 Chuck Ebbert
2003-04-24 15:59 ` Richard B. Johnson
2003-04-24 16:31   ` Timothy Miller
2003-04-24 16:46     ` Richard B. Johnson
2003-04-24 17:15       ` Timothy Miller
2003-04-24 18:27         ` Willy Tarreau
2003-04-24 19:00           ` Timothy Miller
2003-04-25 18:14       ` Bill Davidsen
2003-04-25 18:30         ` Richard B. Johnson
2003-04-24  9:34 Erik Andersen
2003-04-24 10:28 ` Jens Axboe
2003-04-27 12:21 ` Adrian Bunk
2003-04-27 17:44   ` Erik Andersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).