public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nivedita Singhvi <niv@us.ibm.com>
To: riel@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: Re: [STUPID] Best looking code to transfer to a t-shirt
Date: Fri, 03 Jan 2003 16:13:08 -0800	[thread overview]
Message-ID: <3E162714.F721786F@us.ibm.com> (raw)

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

             reply	other threads:[~2003-01-04  0:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-04  0:13 Nivedita Singhvi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03 14:53 [STUPID] Best looking code to transfer to a t-shirt uaca
2003-01-03 13:25 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E162714.F721786F@us.ibm.com \
    --to=niv@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox