Remove explicit type conversions
Subsystems (2)
cover Remove explicit type conversions
This patch removes explicit type conversions as compiler can convert the type of variables implicitly.
After applying this patch, code looks better.
Shivani Bhardwaj (3):
Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast
Staging: fbtft: fb_ra8875: Remove useless cast
Staging: fbtft: fb_ssd1331: Remove unnecessary cast
drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +- drivers/staging/fbtft/fb_ra8875.c | 2 +- drivers/staging/fbtft/fb_ssd1331.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/3 Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast
Remove explicit typecast from variables as compiler can typecast implicitly.
Semantic patch used:
@@
type T;
T e;
identifier x;
@@
* T x = (T)e;
--- drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_agm1264k-fl.c +1 -1
@@ -177,7 +177,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) {va_list args;int i, ret; -u8 *buf = (u8 *)par->buf; +u8 *buf = par->buf;if (unlikely (par->debug &DEBUG_WRITE_REGISTER )) {va_start (args, len);
Signature · 1 line
2.1.0
PATCH 2/3 Staging: fbtft: fb_ra8875: Remove useless cast
In reply to Shivani BhardwajRemove explicit type conversion as it is not required. Semantic patch used:
@@
type T;
T e;
identifier x;
@@
* T x = (T)e;
--- drivers/staging/fbtft/fb_ra8875.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_ra8875.c +1 -1
@@ -204,7 +204,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) {va_list args;int i, ret; -u8 *buf = (u8 *)par->buf; +u8 *buf = par->buf;/* slow down spi-speed for writing registers */ par->fbtftops.write = write_spi;
Signature · 1 line
2.1.0
PATCH 3/3 Staging: fbtft: fb_ssd1331: Remove unnecessary cast
In reply to Shivani BhardwajCompiler can typecast variables implicitly so, explicit type cast is not required and should be removed.
Semantic patch used:
@@
type T;
T e;
identifier x;
@@
* T x = (T)e;
--- drivers/staging/fbtft/fb_ssd1331.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_ssd1331.c +1 -1
@@ -60,7 +60,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) {va_list args;int i, ret; -u8 *buf = (u8 *)par->buf; +u8 *buf = par->buf;if (unlikely (par->debug &DEBUG_WRITE_REGISTER )) {va_start (args, len);
Signature · 1 line
2.1.0