From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755671AbcLXSRe (ORCPT ); Sat, 24 Dec 2016 13:17:34 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:34390 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753536AbcLXSRd (ORCPT ); Sat, 24 Dec 2016 13:17:33 -0500 Date: Sat, 24 Dec 2016 19:17:30 +0100 From: Pavel Machek To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Ming Lei , "Luis R. Rodriguez" , Greg Kroah-Hartman , Kalle Valo , David Gnedt , Michal Kazior , Daniel Wagner , Tony Lindgren , Sebastian Reichel , Ivaylo Dimitrov , Aaro Koskinen , Grazvydas Ignotas , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 6/6] wl1251: Set generated MAC address back to NVS data Message-ID: <20161224181730.GD13590@amd> References: <1482598381-16513-1-git-send-email-pali.rohar@gmail.com> <1482598381-16513-7-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RYJh/3oyKhIjGcML" Content-Disposition: inline In-Reply-To: <1482598381-16513-7-git-send-email-pali.rohar@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --RYJh/3oyKhIjGcML Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > In case there is no valid MAC address kernel generates random one. This > patch propagate this generated MAC address back to NVS data which will be > uploaded to wl1251 chip. So HW would have same MAC address as linux kernel > uses. > return 0; > } > =20 > +static int wl1251_write_nvs_mac(struct wl1251 *wl) > +{ The name is quite confusing, this sounds like writing into non-volatile storage. > + int i; > + > + if (wl->nvs_len < 0x24) > + return -ENODATA; > + > + /* length is 2 and data address is 0x546c (mask is 0xfffe) */ You don't actually check for the mask. > + if (wl->nvs[0x19] !=3D 2 || wl->nvs[0x1a] !=3D 0x6d || wl->nvs[0x1b] != =3D 0x54) > + return -EINVAL; You have two copies of these. Does it make sense to move it to helper function? Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --RYJh/3oyKhIjGcML Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlheu7oACgkQMOfwapXb+vJfSwCgrwQYFkfPI2CSIlLo2J07YCoK afwAniXEYCwILW244Gn3kA1bPezLPNCO =FNYC -----END PGP SIGNATURE----- --RYJh/3oyKhIjGcML--