public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [STUPID] Best looking code to transfer to a t-shirt
@ 2003-01-03 13:25 Maciej Soltysiak
  2003-01-03 13:26 ` Jose Celestino
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Maciej Soltysiak @ 2003-01-03 13:25 UTC (permalink / raw)
  To: linux-kernel

Hi,

I am in a t-shirt transfering frenzy and was wondering which part of the
kernel code it would be best to have on my t-shirt.
I was looking at my favourite: netfilter code, but it is to clean, short
and simple functions, no tons of pointers, no mallocs, no hex numbers, too
many defines used. I was looking for something terribly complicated and
looking awesome to the eye.

How about we have a poll of the most frightening pieces of the kernel ?
What are your ideas?

Regards,
Maciej Soltysiak



^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [STUPID] Best looking code to transfer to a t-shirt
@ 2003-01-03 14:53 uaca
  0 siblings, 0 replies; 17+ messages in thread
From: uaca @ 2003-01-03 14:53 UTC (permalink / raw)
  To: linux-kernel


Hi Maciej

On Fri, Jan 03, 2003 at 02:25:09PM +0100, Maciej Soltysiak wrote:
> Hi,
> 
[...]
> How about we have a poll of the most frightening pieces of the kernel ?
> What are your ideas?

Do you like this one?

/*
 * We use this if we don't have any better
 * idle routine..
 */
void default_idle(void)
{
        if (current_cpu_data.hlt_works_ok && !hlt_counter) {
                __cli();
                if (!current->need_resched)
                        safe_halt();
                else
                        __sti();
        }
}


	Ulisses

                Debian GNU/Linux: a dream come true
-----------------------------------------------------------------------------
"Computers are useless. They can only give answers."            Pablo Picasso

--->	Visita http://www.valux.org/ para saber acerca de la	<---
--->	Asociación Valenciana de Usuarios de Linux		<---

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [STUPID] Best looking code to transfer to a t-shirt
@ 2003-01-04  0:13 Nivedita Singhvi
  0 siblings, 0 replies; 17+ messages in thread
From: Nivedita Singhvi @ 2003-01-04  0:13 UTC (permalink / raw)
  To: riel; +Cc: linux-kernel

Rik,

Thanks for posting this, it was truly hilarious and a joy to behold :)

A reminder of the best on this planet, after observing the ugliest 
and worst on this planet a short while ago on this mailing list..

thanks,
Nivedita

> How about drivers/net/sunhme.c ?
> 
> It's not scary, but it is absolutely hilarious, even to
> people who don't even know C.
> 
> static void happy_meal_tcvr_write(struct happy_meal *hp,
>                                   unsigned long tregs, int reg,
>                                   unsigned short value)
> {
>         int tries = TCVR_WRITE_TRIES;
> 
>         ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg,
> value));
> 
>         /* Welcome to Sun Microsystems, can I take your order please? */
>         if (!hp-&gt;happy_flags &amp; HFLAG_FENABLE)
>                 return happy_meal_bb_write(hp, tregs, reg, value);
> 
>         /* Would you like fries with that? */
>         hme_write32(hp, tregs + TCVR_FRAME,
>                     (FRAME_WRITE | (hp-&gt;paddr &lt;&lt; 23) |
>                      ((reg &amp; 0xff) &lt;&lt; 18) | (value &amp; 0xffff)));
>         while (!(hme_read32(hp, tregs + TCVR_FRAME) &amp; 0x10000) &amp;&amp; --tries)
>                 udelay(20);
> 
>         /* Anything else? */
>         if (!tries)
>                 printk(KERN_ERR "happy meal: Aieee, transceiver MIF write
> bolixed\n");
> 
>         /* Fifty-two cents is your change, have a nice day. */
> }
> 
> 
> Rik

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

end of thread, other threads:[~2003-01-05  3:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03 13:25 [STUPID] Best looking code to transfer to a t-shirt Maciej Soltysiak
2003-01-03 13:26 ` Jose Celestino
2003-01-03 14:55 ` Matthias Schniedermeyer
2003-01-03 15:03   ` Anders Gustafsson
2003-01-03 15:11 ` Tomas Szepe
2003-01-03 15:59 ` Disconnect
2003-01-03 16:32   ` Randy.Dunlap
2003-01-03 16:53     ` Arnaldo Carvalho de Melo
2003-01-03 16:33 ` Alvaro Lopes
2003-01-03 22:58 ` Rik van Riel
2003-01-03 23:39 ` William Lee Irwin III
2003-01-04  0:20   ` Ranjeet Shetye
2003-01-04 13:46     ` Maciej Soltysiak
2003-01-04 13:47     ` Maciej Soltysiak
2003-01-05  3:55       ` Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03 14:53 uaca
2003-01-04  0:13 Nivedita Singhvi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox