From: Felix Fietkau Date: Sat, 24 Feb 2007 20:20:57 +0000 (+0000) Subject: fix cylinder rounding in ptgen X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=aa222536022b384dc8b5ff996c21ab5451d1739a;p=openwrt%2Fstaging%2Frmilecki.git fix cylinder rounding in ptgen SVN-Revision: 6352 --- diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c index 2d78eae5351..277fbbc1340 100644 --- a/tools/firmware-utils/src/ptgen.c +++ b/tools/firmware-utils/src/ptgen.c @@ -114,7 +114,7 @@ static void to_chs(long sect, unsigned char chs[3]) { static inline unsigned long round_to_cyl(long sect) { int cyl_size = heads * sectors; - return sect + cyl_size - ((sect % cyl_size) ?: cyl_size); + return sect + cyl_size - (sect % cyl_size); } /* check the partition sizes and write the partition table */