fifo.c (135c5504a600ff9b06e321694fbcac78a9530cd4) | fifo.c (6396bb221514d2876fd6dc0aa2a1f240d99b37bb) |
---|---|
1/* 2 * Copyright 2018 Red Hat Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the --- 36 unchanged lines hidden (view full) --- 45 for (i = 0; i < ARRAY_SIZE(a->v.runlist); i++) 46 a->v.runlist[i].mthd = NV_DEVICE_FIFO_RUNLIST_ENGINES(i); 47 48 ret = nvif_object_mthd(object, NV_DEVICE_V0_INFO, a, sizeof(*a)); 49 if (ret) 50 goto done; 51 52 device->runlists = fls64(a->v.runlists.data); | 1/* 2 * Copyright 2018 Red Hat Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the --- 36 unchanged lines hidden (view full) --- 45 for (i = 0; i < ARRAY_SIZE(a->v.runlist); i++) 46 a->v.runlist[i].mthd = NV_DEVICE_FIFO_RUNLIST_ENGINES(i); 47 48 ret = nvif_object_mthd(object, NV_DEVICE_V0_INFO, a, sizeof(*a)); 49 if (ret) 50 goto done; 51 52 device->runlists = fls64(a->v.runlists.data); |
53 device->runlist = kzalloc(sizeof(*device->runlist) * 54 device->runlists, GFP_KERNEL); | 53 device->runlist = kcalloc(device->runlists, sizeof(*device->runlist), 54 GFP_KERNEL); |
55 if (!device->runlist) { 56 ret = -ENOMEM; 57 goto done; 58 } 59 60 for (i = 0; i < device->runlists; i++) { 61 if (a->v.runlists.data & BIT_ULL(i)) 62 device->runlist[i].engines = a->v.runlist[i].data; --- 37 unchanged lines hidden --- | 55 if (!device->runlist) { 56 ret = -ENOMEM; 57 goto done; 58 } 59 60 for (i = 0; i < device->runlists; i++) { 61 if (a->v.runlists.data & BIT_ULL(i)) 62 device->runlist[i].engines = a->v.runlist[i].data; --- 37 unchanged lines hidden --- |