lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1172744162.5264.102.camel@roc-desktop>
Date:	Thu, 01 Mar 2007 18:16:02 +0800
From:	"Wu, Bryan" <bryan.wu@...log.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	bryan.wu@...log.com, nico@....org, jgarzik@...ox.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -mm 4/5] Blackfin: patch add blackfin support in smc91x
	ethernet controller driver

On Thu, 2007-03-01 at 02:03 -0800, Andrew Morton wrote:
> On Thu, 01 Mar 2007 17:52:48 +0800 "Wu, Bryan" <bryan.wu@...log.com> wrote:
> 
> > > Please always prefer coding in C over coding in cpp.
> > 
> > Yes, it can be writen as a C function.
> > We just follow other implementation in the drivers/net/smc91x.h
> > 
> > start at line 1156 of
> > ---
> > #ifndef SMC_GET_MAC_ADDR
> > #define SMC_GET_MAC_ADDR(addr)                                          \
> >         do {                                                            \
> >                 unsigned int __v;                                       \
> >                 __v = SMC_inw( ioaddr, ADDR0_REG );                     \
> >                 addr[0] = __v; addr[1] = __v >> 8;                      \
> >                 __v = SMC_inw( ioaddr, ADDR1_REG );                     \
> >                 addr[2] = __v; addr[3] = __v >> 8;                      \
> >                 __v = SMC_inw( ioaddr, ADDR2_REG );                     \
> >                 addr[4] = __v; addr[5] = __v >> 8;                      \
> >         } while (0)
> > #endif
> > _
> 
> Please don't treat ghastly old driver code as a model for new kernel code.
> 
> > If you think this is necessary, we may rewrite it in C function.
> 
> hm, well, if it's copied and pasted from somewhere else then there is some
> merit in leaving it as it is.
> 
> It would of course be better to pull it out into a shared header file, avoid the
> duplication.

Exactly, this is a better solution. Because smc91x driver is widely used
in embedded linux world, we just want to add our arch support into this
common driver.

Maybe Nico can help us on this.

Thanks
-Bryan Wu 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ