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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Apr 2014 22:26:41 +1000 (EST)
From:	Austin Boyle <boyle.austin@...il.com>
To:	Marek Vasut <marex@...x.de>
cc:	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mtd: m25p80: Calculate flash block protect bits based
 on number of sectors


On Sun, 13 Apr 2014, Marek Vasut wrote:
> 
> This portion of code looks like a duplicate of ...
> 
> > +	for (lock_bits = 1; lock_bits < 7; lock_bits++) {
> > +		protected_area_start = flash->mtd.size -
> > +					get_protected_area(flash, lock_bits);
> > +		if (offset+len >= protected_area_start)
> > +			break;
> > +	}
> > +	lock_bits--;
> > +
> > +	status_new = (status_old & ~SR_BP_BIT_MASK) |
> > +			((lock_bits << SR_BP_BIT_OFFSET) & SR_BP_BIT_MASK);
> 
> ... this here (if you don't consider the lock_bits--) . Why don't we move this 
> into a separate function to avoid the duplication?
> 

Thanks for reviewing this patch Marek, your suggestions were very 
helpful. I am about to post another version that 
hopefully addresses the issues raised, I would appreciate if you can take 
another look at it.

Cheers,
Austin.
--
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