Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: fix CodingStyle issues in PATA timings code

* fix the overly long line in ata_timing_quantize()

* use standard kernel CodingStyle in ata_timing_merge()

* do not use assignment in if condition in ata_timing_compute()

* fix non-standard comment style in ata_timing_compute()

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Bartlomiej Zolnierkiewicz and committed by
Jens Axboe
4e168187 2b67a6d3

+27 -15
+27 -15
drivers/ata/libata-core.c
··· 3251 3251 #define ENOUGH(v, unit) (((v)-1)/(unit)+1) 3252 3252 #define EZ(v, unit) ((v)?ENOUGH(((v) * 1000), unit):0) 3253 3253 3254 - static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT) 3254 + static void ata_timing_quantize(const struct ata_timing *t, 3255 + struct ata_timing *q, int T, int UT) 3255 3256 { 3256 3257 q->setup = EZ(t->setup, T); 3257 3258 q->act8b = EZ(t->act8b, T); ··· 3268 3267 void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b, 3269 3268 struct ata_timing *m, unsigned int what) 3270 3269 { 3271 - if (what & ATA_TIMING_SETUP ) m->setup = max(a->setup, b->setup); 3272 - if (what & ATA_TIMING_ACT8B ) m->act8b = max(a->act8b, b->act8b); 3273 - if (what & ATA_TIMING_REC8B ) m->rec8b = max(a->rec8b, b->rec8b); 3274 - if (what & ATA_TIMING_CYC8B ) m->cyc8b = max(a->cyc8b, b->cyc8b); 3275 - if (what & ATA_TIMING_ACTIVE ) m->active = max(a->active, b->active); 3276 - if (what & ATA_TIMING_RECOVER) m->recover = max(a->recover, b->recover); 3277 - if (what & ATA_TIMING_DMACK_HOLD) m->dmack_hold = max(a->dmack_hold, b->dmack_hold); 3278 - if (what & ATA_TIMING_CYCLE ) m->cycle = max(a->cycle, b->cycle); 3279 - if (what & ATA_TIMING_UDMA ) m->udma = max(a->udma, b->udma); 3270 + if (what & ATA_TIMING_SETUP) 3271 + m->setup = max(a->setup, b->setup); 3272 + if (what & ATA_TIMING_ACT8B) 3273 + m->act8b = max(a->act8b, b->act8b); 3274 + if (what & ATA_TIMING_REC8B) 3275 + m->rec8b = max(a->rec8b, b->rec8b); 3276 + if (what & ATA_TIMING_CYC8B) 3277 + m->cyc8b = max(a->cyc8b, b->cyc8b); 3278 + if (what & ATA_TIMING_ACTIVE) 3279 + m->active = max(a->active, b->active); 3280 + if (what & ATA_TIMING_RECOVER) 3281 + m->recover = max(a->recover, b->recover); 3282 + if (what & ATA_TIMING_DMACK_HOLD) 3283 + m->dmack_hold = max(a->dmack_hold, b->dmack_hold); 3284 + if (what & ATA_TIMING_CYCLE) 3285 + m->cycle = max(a->cycle, b->cycle); 3286 + if (what & ATA_TIMING_UDMA) 3287 + m->udma = max(a->udma, b->udma); 3280 3288 } 3281 3289 EXPORT_SYMBOL_GPL(ata_timing_merge); 3282 3290 ··· 3316 3306 /* 3317 3307 * Find the mode. 3318 3308 */ 3319 - 3320 - if (!(s = ata_timing_find_mode(speed))) 3309 + s = ata_timing_find_mode(speed); 3310 + if (!s) 3321 3311 return -EINVAL; 3322 3312 3323 3313 memcpy(t, s, sizeof(*s)); ··· 3373 3363 t->recover = t->cycle - t->active; 3374 3364 } 3375 3365 3376 - /* In a few cases quantisation may produce enough errors to 3377 - leave t->cycle too low for the sum of active and recovery 3378 - if so we must correct this */ 3366 + /* 3367 + * In a few cases quantisation may produce enough errors to 3368 + * leave t->cycle too low for the sum of active and recovery 3369 + * if so we must correct this. 3370 + */ 3379 3371 if (t->active + t->recover > t->cycle) 3380 3372 t->cycle = t->active + t->recover; 3381 3373