| Summary: | -Wtautilogical-pointer-compare issues with drm(4) code | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Enji Cooper <ngie> |
| Component: | kern | Assignee: | freebsd-x11 (Nobody) <x11> |
| Status: | Closed FIXED | ||
| Severity: | Affects Some People | CC: | bapt, dim, dumbbell, zeising |
| Priority: | --- | ||
| Version: | CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
Uh... hmmm...
800 /** driver private structure attached to each drm_gem_object */
801 struct drm_i915_gem_object {
802 struct drm_gem_object base;
803
Hi! I guess I will silence this particular warning for DRM (maybe i915 only). Thank you! Here's the complete list according to Jenkins, BTW: https://jenkins.freebsd.org/job/FreeBSD_HEAD/95/warnings7Result/package.1163104811/ . The warnings seem valid though -- why is a scalar being compared against NULL? Yes, the check looks wrong. Some time ago, I verified in later versions of Linux and it was still there. I didn't look again recently if it was fixed. I had no time to report this yet. Some people add this type of null check as a sort of "defensive programming" practice. For example, if the obj->base member was a pointer instead of an array, you would definitely need such a null check. So maybe the rationale is 'better safe than sorry'... Hi! Is this still relevant? Feedback timeout. |
Ran into these issues on amd64 with buildkernel: $ svnversion 295081 $ env SRCCONF=/dev/null make tinderbox KERNCONF=LINT -j4 ... --- all_subdir_i915kms ---^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:680:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:1040:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:1259:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:1299:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:1725:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:3595:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M --- all_subdir_drm ---^M --- drm.ko ---^M ld -d -warn-common -r -d -o drm.ko ati_pcigart.o drm_agpsupport.o drm_auth.o drm_bufs.o drm_context.o drm_dma.o drm_drawable.o drm_drv.o drm_fops.o drm_hashtab.o drm_ioctl.o drm_irq.o drm_lock.o drm_memory.o drm_mm.o drm_pci.o drm_scatter.o drm_sman.o drm_sysctl.o drm_vm.o^M --- all_subdir_drm2 ---^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:3632:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem.c:3685:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M --- all_subdir_drm ---^M --- all_subdir_i915kms ---^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem_execbuffer.c:798:13: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M --- all_subdir_i915kms ---^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem_execbuffer.c:1275:13: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL) {^M ~~~~~^~~~ ~~~~^M --- all_subdir_i915kms ---^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem_tiling.c:311:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL)^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/i915_gem_tiling.c:418:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL)^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_display.c:5161:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL)^M ~~~~~^~~~ ~~~~^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_display.c:6731:12: warning: comparison of address of 'obj->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&obj->base == NULL)^M ~~~~~^~~~ ~~~~^M --- all_subdir_drm2 ---^M /usr/src/svn/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_overlay.c:1153:15: warning: comparison of address of 'new_bo->base' equal to a null pointer is always false [-Wtautological-pointer-compare]^M if (&new_bo->base == NULL) {^M ~~~~~~~~^~~~ ~~~~^M