All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Remove explicit type conversions
@ 2015-10-16 16:18 Shivani Bhardwaj
  2015-10-16 16:18 ` [PATCH 1/3] Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast Shivani Bhardwaj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-10-16 16:18 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

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(-)

-- 
2.1.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast
  2015-10-16 16:18 [PATCH 0/3] Remove explicit type conversions Shivani Bhardwaj
@ 2015-10-16 16:18 ` Shivani Bhardwaj
  2015-10-16 16:19 ` [PATCH 2/3] Staging: fbtft: fb_ra8875: Remove useless cast Shivani Bhardwaj
  2015-10-16 16:19 ` [PATCH 3/3] Staging: fbtft: fb_ssd1331: Remove unnecessary cast Shivani Bhardwaj
  2 siblings, 0 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-10-16 16:18 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove explicit typecast from variables as compiler can typecast
implicitly.
Semantic patch used:

@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
index 19f6136..2a50cf9 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -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);
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] Staging: fbtft: fb_ra8875: Remove useless cast
  2015-10-16 16:18 [PATCH 0/3] Remove explicit type conversions Shivani Bhardwaj
  2015-10-16 16:18 ` [PATCH 1/3] Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast Shivani Bhardwaj
@ 2015-10-16 16:19 ` Shivani Bhardwaj
  2015-10-16 16:19 ` [PATCH 3/3] Staging: fbtft: fb_ssd1331: Remove unnecessary cast Shivani Bhardwaj
  2 siblings, 0 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-10-16 16:19 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove explicit type conversion as it is not required.
Semantic patch used:

@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/fbtft/fb_ra8875.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
index 86e43e1..b167c50 100644
--- a/drivers/staging/fbtft/fb_ra8875.c
+++ b/drivers/staging/fbtft/fb_ra8875.c
@@ -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;
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] Staging: fbtft: fb_ssd1331: Remove unnecessary cast
  2015-10-16 16:18 [PATCH 0/3] Remove explicit type conversions Shivani Bhardwaj
  2015-10-16 16:18 ` [PATCH 1/3] Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast Shivani Bhardwaj
  2015-10-16 16:19 ` [PATCH 2/3] Staging: fbtft: fb_ra8875: Remove useless cast Shivani Bhardwaj
@ 2015-10-16 16:19 ` Shivani Bhardwaj
  2 siblings, 0 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-10-16 16:19 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Compiler 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;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/fbtft/fb_ssd1331.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c
index 53cb8e9..bd294f8 100644
--- a/drivers/staging/fbtft/fb_ssd1331.c
+++ b/drivers/staging/fbtft/fb_ssd1331.c
@@ -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);
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-16 16:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 16:18 [PATCH 0/3] Remove explicit type conversions Shivani Bhardwaj
2015-10-16 16:18 ` [PATCH 1/3] Staging: fbtft: fb_agm1264k-fl: Remove unnecessary cast Shivani Bhardwaj
2015-10-16 16:19 ` [PATCH 2/3] Staging: fbtft: fb_ra8875: Remove useless cast Shivani Bhardwaj
2015-10-16 16:19 ` [PATCH 3/3] Staging: fbtft: fb_ssd1331: Remove unnecessary cast Shivani Bhardwaj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.