Print this page
5253 kmem_alloc/kmem_zalloc won't fail with KM_SLEEP
5254 getrbuf won't fail with KM_SLEEP
@@ -22,12 +22,10 @@
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/debug.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/buf.h>
@@ -162,14 +160,11 @@
* Find a PCI device based on its address, and return a unique handle
* to be used in subsequent calls to read from or write to the config
* space of this device.
*/
- if ((pci_bsf = kmem_zalloc(sizeof (gfxp_pci_bsf_t), KM_SLEEP))
- == NULL) {
- return (NULL);
- }
+ pci_bsf = kmem_zalloc(sizeof (gfxp_pci_bsf_t), KM_SLEEP);
pci_bsf->bus = bus;
pci_bsf->slot = slot;
pci_bsf->function = function;
@@ -328,12 +323,11 @@
/*
* Find a PCI device based on its device and vendor id.
*/
- if ((pci_bsf = kmem_zalloc(sizeof (gfxp_pci_bsf_t), KM_SLEEP)) == NULL)
- return (0);
+ pci_bsf = kmem_zalloc(sizeof (gfxp_pci_bsf_t), KM_SLEEP);
pci_bsf->vendor = vendor;
pci_bsf->device = device;
ddi_walk_devs(ddi_root_node(), gfxp_pci_find_vd, pci_bsf);