]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: fbtft: improve a syslog message in fbtft_register_framebuffer
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 2 Mar 2017 19:48:53 +0000 (20:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Mar 2017 16:31:56 +0000 (17:31 +0100)
There are drivers like fb_sh1106 which allocate a txbuf less than 1 KiB.
In this case the message would include "0 KiB buffer memory" what
doesn't make sense and in general I doubt that there is any benefit in
informing the user about allocation of a very small buffer.

Therefore omit this message part if the buffer has less than 1 KiB.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft-core.c

index b89183421cb24d7d606372302d519d46399f0ba7..429b52431f88432fb97b591b3d1461deeb0dd80e 100644 (file)
@@ -956,7 +956,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)
 
        fbtft_sysfs_init(par);
 
-       if (par->txbuf.buf)
+       if (par->txbuf.buf && par->txbuf.len >= 1024)
                sprintf(text1, ", %zu KiB buffer memory", par->txbuf.len >> 10);
        if (spi)
                sprintf(text2, ", spi%d.%d at %d MHz", spi->master->bus_num,