Module: Mesa
Branch: master
Commit: 0663ae0aa1d5b8a1fb6e5da4a9f48ba99da72477
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0663ae0aa1d5b8a1fb6e5da4a9f48ba99da72477

Author: Eric Engestrom <eric.engest...@imgtec.com>
Date:   Tue Dec 19 14:12:44 2017 +0000

loader: let compiler figure out the length of the string

Basically, turn comment into code

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
Reviewed-by: Emil Velikov <emil.veli...@collabora.com>

---

 src/loader/loader.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/loader/loader.c b/src/loader/loader.c
index 3c67f9dc24..913b3dcac0 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -110,8 +110,7 @@ static char *loader_get_dri_config_device_id(void)
 
 static char *drm_construct_id_path_tag(drmDevicePtr device)
 {
-/* Length of "pci-xxxx_xx_xx_x\0" */
-#define PCI_ID_PATH_TAG_LENGTH 17
+#define PCI_ID_PATH_TAG_LENGTH sizeof("pci-xxxx_xx_xx_x")
    char *tag = NULL;
 
    if (device->bustype == DRM_BUS_PCI) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to