From: kettenis Date: Mon, 2 Aug 2010 20:55:49 +0000 (+0000) Subject: Make MHZ_TO_PLL safer to use by adding parenthesis. Fixes a potential issue X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c6f7b7ac36f90fbcb41003d9081c54b7545f3276;p=openbsd Make MHZ_TO_PLL safer to use by adding parenthesis. Fixes a potential issue in agten(4) uncovered by gcc4. ok miod@, deraadt@ --- diff --git a/sys/dev/ic/ibm525reg.h b/sys/dev/ic/ibm525reg.h index a602128093a..fca2fff436a 100644 --- a/sys/dev/ic/ibm525reg.h +++ b/sys/dev/ic/ibm525reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ibm525reg.h,v 1.1 2005/07/19 09:34:14 miod Exp $ */ +/* $OpenBSD: ibm525reg.h,v 1.2 2010/08/02 20:55:49 kettenis Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. * @@ -176,7 +176,7 @@ * Pixel clock encoding */ #define MHZ_TO_PLL(m) \ - (m) < 32 ? 0x00 | (4 * (m) - 65) : \ - (m) < 64 ? 0x40 | (2 * (m) - 65) : \ - (m) < 128 ? 0x80 | ((m) - 65) : \ - 0xc0 | ((m) / 2 - 65) + ((m) < 32 ? 0x00 | (4 * (m) - 65) : \ + (m) < 64 ? 0x40 | (2 * (m) - 65) : \ + (m) < 128 ? 0x80 | ((m) - 65) : \ + 0xc0 | ((m) / 2 - 65))