From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932867AbcFBO3p (ORCPT ); Thu, 2 Jun 2016 10:29:45 -0400 Received: from AUSXIPPS310.us.dell.com ([143.166.148.211]:44585 "EHLO ausxipps310.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932128AbcFBO3n (ORCPT ); Thu, 2 Jun 2016 10:29:43 -0400 DomainKey-Signature: s=smtpout; d=dell.com; c=nofws; q=dns; h=X-LoopCount0:X-IronPort-AV:From:To:CC:Subject: Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader:x-originating-ip: Content-Type:Content-Transfer-Encoding:MIME-Version: Return-Path; b=d8iEt7QGt4PXIiI6n04jEoaJJpNHE6JVt8MyruxuGFRaLtw6Mw7U7Kwl 2CEuSOJJR33XPmlLtDo/EkT+xUvpAGRvbLiEUhfR7Rts1FhoIyribfXCu E4POUPrbYrmmdgnzkudLN3ES6w5S+pvz14CuJdYbC5b2XrUKNw85TSHf4 M=; X-LoopCount0: from 10.170.28.40 X-IronPort-AV: E=Sophos;i="5.26,406,1459832400"; d="scan'208";a="323017314" From: To: CC: , , , , , , Subject: RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address Thread-Topic: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address Thread-Index: AQHRvKZSMb9mMEf0UUOJaXsVnbGJUp/WOS0w Date: Thu, 2 Jun 2016 14:29:41 +0000 Message-ID: <19ff919663a2454a82645b9b0f4146dd@ausx13mpc124.AMER.DELL.COM> References: <1464817844-27206-1-git-send-email-mario_limonciello@dell.com> <20160601230535.GA29279@kroah.com> <8760tsypr5.fsf@nemi.mork.no> In-Reply-To: <8760tsypr5.fsf@nemi.mork.no> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.11.181.4] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u52ETpLo020625 > -----Original Message----- > From: Bjørn Mork [mailto:bjorn@mork.no] > Sent: Thursday, June 2, 2016 3:11 AM > To: Limonciello, Mario > Cc: gregkh@linuxfoundation.org; hayeswang@realtek.com; linux- > kernel@vger.kernel.org; netdev@vger.kernel.org; linux- > usb@vger.kernel.org; pali.rohar@gmail.com; anthony.wong@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > writes: > > >> > +static u8 amac_ascii_to_hex(int c) { > >> > + if (c <= 0x39) > >> > + return (u8)(c - 0x30); > >> > + else if (c <= 0x46) > >> > + return (u8)(c - 0x37); > >> > + return (u8)(c - 0x57); > >> > +} > >> > > > > Sorry forgot to address this. > > > >> We really don't have such a function somewhere in the kernel already? > > > > There is a function in acpi/acpica/uthex.c that does this, but it > > doesn't seem to be used by anything outside of acpica so far. Would it be > OK style wise to #include " ../../acpi/acpica/acutils.h" from r8152.c? > > Makes me wonder where you looked.... You have hex_to_bin() and > hex2bin() in include/linux/kernel.h > Thank you, I completely missed that. I wasn't looking for literals in my grepping. I'll use this instead. > You could look at usbnet_get_ethernet_addr() for an example of how to do > this properly. It's pretty close to this driver in the tree, and should be a > natural starting point before reinventing the wheel... > OK will do.