xf86platformBus: Add assertion to avoid (fatal) compiler warning
Compilation of -video-intel started failing in gnome-continuous, it's because xserver has -Werror=return-type on, and gcc can't prove this function always returns a value: /usr/include/xorg/xf86platformBus.h:119:1: error: control reaches end of non-void function [-Werror=return-type] Let's add assertions to the accessor functions to fix this. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
5c2e9fa3d6
commit
ac3acab131
|
@ -115,6 +115,9 @@ _xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib
|
||||||
return xf86_platform_device_odev_attributes(device)->busid;
|
return xf86_platform_device_odev_attributes(device)->busid;
|
||||||
case ODEV_ATTRIB_DRIVER:
|
case ODEV_ATTRIB_DRIVER:
|
||||||
return xf86_platform_device_odev_attributes(device)->driver;
|
return xf86_platform_device_odev_attributes(device)->driver;
|
||||||
|
default:
|
||||||
|
assert(FALSE);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +138,9 @@ _xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int at
|
||||||
return xf86_platform_device_odev_attributes(device)->major;
|
return xf86_platform_device_odev_attributes(device)->major;
|
||||||
case ODEV_ATTRIB_MINOR:
|
case ODEV_ATTRIB_MINOR:
|
||||||
return xf86_platform_device_odev_attributes(device)->minor;
|
return xf86_platform_device_odev_attributes(device)->minor;
|
||||||
|
default:
|
||||||
|
assert(FALSE);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user