Wed Jun 6 20:05:36 2018 UTC ()
Enhance the syntax in order to be acceptable by Clang

Replace "((crv == 0))" with "(crv == 0)", as the intention is to check the
value, whether it is equal to 0.

This fixes kernel=GENERIC build under MKLLVM=yes.

Sponsored by <The NetBSD Foundation>


(kamil)
diff -r1.22 -r1.23 src/sys/dev/pci/svwsata.c

cvs diff -r1.22 -r1.23 src/sys/dev/pci/svwsata.c (expand / switch to unified diff)

--- src/sys/dev/pci/svwsata.c 2018/06/01 18:14:33 1.22
+++ src/sys/dev/pci/svwsata.c 2018/06/06 20:05:36 1.23
@@ -1,33 +1,33 @@ @@ -1,33 +1,33 @@
1/* $NetBSD: svwsata.c,v 1.22 2018/06/01 18:14:33 macallan Exp $ */ 1/* $NetBSD: svwsata.c,v 1.23 2018/06/06 20:05:36 kamil Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2005 Mark Kettenis 4 * Copyright (c) 2005 Mark Kettenis
5 * 5 *
6 * Permission to use, copy, modify, and distribute this software for any 6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above 7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies. 8 * copyright notice and this permission notice appear in all copies.
9 * 9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */ 17 */
18 18
19#include <sys/cdefs.h> 19#include <sys/cdefs.h>
20__KERNEL_RCSID(0, "$NetBSD: svwsata.c,v 1.22 2018/06/01 18:14:33 macallan Exp $"); 20__KERNEL_RCSID(0, "$NetBSD: svwsata.c,v 1.23 2018/06/06 20:05:36 kamil Exp $");
21 21
22#include <sys/param.h> 22#include <sys/param.h>
23#include <sys/systm.h> 23#include <sys/systm.h>
24 24
25#include <dev/ata/atareg.h> 25#include <dev/ata/atareg.h>
26#include <dev/ata/satareg.h> 26#include <dev/ata/satareg.h>
27#include <dev/ata/satavar.h> 27#include <dev/ata/satavar.h>
28#include <dev/pci/pcivar.h> 28#include <dev/pci/pcivar.h>
29#include <dev/pci/pcidevs.h> 29#include <dev/pci/pcidevs.h>
30#include <dev/pci/pciidereg.h> 30#include <dev/pci/pciidereg.h>
31#include <dev/pci/pciidevar.h> 31#include <dev/pci/pciidevar.h>
32#include <dev/pci/pciide_svwsata_reg.h> 32#include <dev/pci/pciide_svwsata_reg.h>
33 33
@@ -359,24 +359,24 @@ svwsata_intr(void *arg) @@ -359,24 +359,24 @@ svwsata_intr(void *arg)
359 359
360 dmastat = bus_space_read_1(sc->sc_dma_iot, 360 dmastat = bus_space_read_1(sc->sc_dma_iot,
361 cp->dma_iohs[IDEDMA_CTL], 0); 361 cp->dma_iohs[IDEDMA_CTL], 0);
362 362
363 /* If a compat channel skip. */ 363 /* If a compat channel skip. */
364 if (cp->compat) 364 if (cp->compat)
365 continue; 365 continue;
366 366
367 /* if this channel not waiting for intr, skip */ 367 /* if this channel not waiting for intr, skip */
368 if ((wdc_cp->ch_flags & ATACH_IRQ_WAIT) == 0) { 368 if ((wdc_cp->ch_flags & ATACH_IRQ_WAIT) == 0) {
369 continue; 369 continue;
370 } 370 }
371 crv = wdcintr(wdc_cp); 371 crv = wdcintr(wdc_cp);
372 if ((crv == 0)) { 372 if (crv == 0) {
373 bus_space_write_1(sc->sc_dma_iot,  373 bus_space_write_1(sc->sc_dma_iot,
374 cp->dma_iohs[IDEDMA_CTL], 0, dmastat); 374 cp->dma_iohs[IDEDMA_CTL], 0, dmastat);
375 } 375 }
376 else if (crv == 1) 376 else if (crv == 1)
377 rv = 1; /* claim the intr */ 377 rv = 1; /* claim the intr */
378 else if (rv == 0) /* crv should be -1 in this case */ 378 else if (rv == 0) /* crv should be -1 in this case */
379 rv = crv; /* if we've done no better, take it */ 379 rv = crv; /* if we've done no better, take it */
380 } 380 }
381 return (rv); 381 return (rv);
382} 382}