Skip to contentSkip to conversation

adjust function arguments

PATCH New Aya Mahfouz 1 participant 21 messages Mar 10, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover adjust function arguments

Fixes functions' arguments through a series of coccinelle rules. The focus was on removing extra parentheses and unnecessary casts in case the passed argument is a pointer. Each patch has its corresponding coccinelle script.

checkpatch.pl issued line over 80 characters warning for some of the patches. Most of them were ignored since the problem was present in all of the affected files before the changes were applied. In addition, fixing the problem was not the best move.

Aya Mahfouz (20):
staging: fwserial: remove extra parentheses around function arguments
staging: media: lirc: lirc_imon.c: remove extra parentheses around
function arguments
staging: media: lirc: remove unnecessary cast on function argument
staging: media: lirc: fix multiple issues with function arguments
staging: media: lirc: remove pointer to pointer cast on function
arguments
staging: mt29f_spinand: remove pointer to pointer cast in function
argument
staging: ft1000: adjust function arguments
staging: ft1000: ft1000-pcmcia: adjust function arguments
staging: ft1000: ft1000-usb: adjust function arguments
staging: ft1000: ft1000-usb: ft1000_download.c: adjust function
arguments
staging: ft1000: ft1000-usb: ft1000_hw.c: adjust function arguments
staging: fbtft: fb_agm1264k-fl.c: remove extra parentheses around
function arguments
staging: fbtft: fb_hx8340bn.c: remove extra parentheses around
function arguments
staging: fbtft: fb_hx8353d.c: remove extra parentheses around function
arguments
staging: fbtft: fb_s6d02a1.c: remove extra parentheses around function
arguments
staging: fbtft: fb_st7735r.c: remove extra parentheses around function
arguments
staging: fbtft: Remove unnecessary pointer to potinter cast
staging: fbtft: fbtft-io.c: remove extra parentheses around function
arguments
staging: fbtft: fbtft_device.c: remove extra parentheses around
function arguments
staging: goldfish: remove extra parentheses around function arguments

 drivers/staging/fbtft/fb_agm1264k-fl.c              |  2 +-
 drivers/staging/fbtft/fb_hx8340bn.c                 |  2 +-
 drivers/staging/fbtft/fb_hx8353d.c                  |  2 +-
 drivers/staging/fbtft/fb_s6d02a1.c                  |  2 +-
 drivers/staging/fbtft/fb_st7735r.c                  |  2 +-
 drivers/staging/fbtft/fbtft-core.c                  |  2 +-
 drivers/staging/fbtft/fbtft-io.c                    |  8 ++++----
 drivers/staging/fbtft/fbtft_device.c                |  4 ++--
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c  |  4 ++--
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c    |  8 +++++---
 drivers/staging/ft1000/ft1000-usb/ft1000_debug.c    |  8 ++++----
 drivers/staging/ft1000/ft1000-usb/ft1000_download.c | 14 +++++++-------
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c       | 18 +++++++++---------
 drivers/staging/fwserial/fwserial.c                 |  2 +-
 drivers/staging/goldfish/goldfish_audio.c           |  8 ++++----
 drivers/staging/media/lirc/lirc_imon.c              |  4 ++--
 drivers/staging/media/lirc/lirc_parallel.c          |  2 +-
 drivers/staging/media/lirc/lirc_sasem.c             |  6 +++---
 drivers/staging/media/lirc/lirc_serial.c            |  2 +-
 drivers/staging/mt29f_spinand/mt29f_spinand.c       |  2 +-
 20 files changed, 52 insertions(+), 50 deletions(-)
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#1 lore raw

PATCH 1/20 staging: fwserial: remove extra parentheses around function arguments

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...);

---
 drivers/staging/fwserial/fwserial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fwserial/fwserial.c +1 -1
index 73deae3..fdb2418 100644
@@ -1186,7 +1186,7 @@ static void fwtty_unthrottle(struct tty_struct *tty)
 {
 	struct fwtty_port *port = tty->driver_data;
 
-	fwtty_dbg(port, "CRTSCTS: %d\n", (C_CRTSCTS(tty) != 0));
+	fwtty_dbg(port, "CRTSCTS: %d\n", C_CRTSCTS(tty) != 0);
 
 	fwtty_profile_fifo(port, port->stats.unthrottle);
 
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#2 lore raw

PATCH 2/20 staging: media: lirc: lirc_imon.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
&
-(
e
-)
,...)

---
 drivers/staging/media/lirc/lirc_imon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/lirc/lirc_imon.c +2 -2
index 2e883e9..335b98a 100644
@@ -337,11 +337,11 @@ static int send_packet(struct imon_context *context)
 	context->tx_urb->actual_length = 0;
 
 	init_completion(&context->tx.finished);
-	atomic_set(&(context->tx.busy), 1);
+	atomic_set(&context->tx.busy, 1);
 
 	retval = usb_submit_urb(context->tx_urb, GFP_KERNEL);
 	if (retval) {
-		atomic_set(&(context->tx.busy), 0);
+		atomic_set(&context->tx.busy, 0);
 		dev_err(&context->usbdev->dev, "error submitting urb(%d)\n",
 			retval);
 	} else {
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#3 lore raw

PATCH 3/20 staging: media: lirc: remove unnecessary cast on function argument

In reply to Aya Mahfouz

Removes pointer to pointer cast on a function argument. Issue detected and resolved using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

---
 drivers/staging/media/lirc/lirc_parallel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/lirc/lirc_parallel.c +1 -1
index 19c5c21..df55644 100644
@@ -336,7 +336,7 @@ static ssize_t lirc_read(struct file *filep, char __user *buf, size_t n,
 	set_current_state(TASK_INTERRUPTIBLE);
 	while (count < n) {
 		if (rptr != wptr) {
-			if (copy_to_user(buf+count, (char *) &rbuf[rptr],
+			if (copy_to_user(buf+count, &rbuf[rptr],
 					 sizeof(int))) {
 				result = -EFAULT;
 				break;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#4 lore raw

PATCH 4/20 staging: media: lirc: fix multiple issues with function arguments

In reply to Aya Mahfouz

Handles the following issues:

Removing extra parentheses around function arguments, Removing unnecessary pointer to pointer casts.

Issues detected and resolved using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

@@
expression e;
identifier f;
@@

f(...,
&
-(
e
-)
,...)

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/media/lirc/lirc_sasem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/media/lirc/lirc_sasem.c +3 -3
index 9944af1..b9c53e2 100644
@@ -331,11 +331,11 @@ static int send_packet(struct sasem_context *context)
 	context->tx_urb->actual_length = 0;
 
 	init_completion(&context->tx.finished);
-	atomic_set(&(context->tx.busy), 1);
+	atomic_set(&context->tx.busy, 1);
 
 	retval =  usb_submit_urb(context->tx_urb, GFP_KERNEL);
 	if (retval) {
-		atomic_set(&(context->tx.busy), 0);
+		atomic_set(&context->tx.busy, 0);
 		dev_err(&context->dev->dev, "error submitting urb (%d)\n",
 			retval);
 	} else {
@@ -387,7 +387,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
 		goto exit;
 	}
 
-	data_buf = memdup_user((void const __user *)buf, n_bytes);
+	data_buf = memdup_user(buf, n_bytes);
 	if (IS_ERR(data_buf)) {
 		retval = PTR_ERR(data_buf);
 		data_buf = NULL;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#5 lore raw

PATCH 5/20 staging: media: lirc: remove pointer to pointer cast on function arguments

In reply to Aya Mahfouz

Removes pointer to pointer cast on function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

---
 drivers/staging/media/lirc/lirc_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/lirc/lirc_serial.c +1 -1
index 9f55a83..56df8d7 100644
@@ -784,7 +784,7 @@ static int lirc_serial_probe(struct platform_device *dev)
 
 	result = devm_request_irq(&dev->dev, irq, lirc_irq_handler,
 			     (share_irq ? IRQF_SHARED : 0),
-			     LIRC_DRIVER_NAME, (void *)&hardware);
+			     LIRC_DRIVER_NAME, &hardware);
 	if (result < 0) {
 		if (result == -EBUSY)
 			dev_err(&dev->dev, "IRQ %d busy\n", irq);
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#6 lore raw

PATCH 6/20 staging: mt29f_spinand: remove pointer to pointer cast in function argument

In reply to Aya Mahfouz

Removes unnecessary pointer to pointer cast on function arguments. It is worth noting that buf is already a u8 pointer. Issue detected and resolved using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

---
 drivers/staging/mt29f_spinand/mt29f_spinand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/mt29f_spinand/mt29f_spinand.c +1 -1
index 3b191fc..7285c64 100644
@@ -770,7 +770,7 @@ static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
 		break;
 	case NAND_CMD_READID:
 		state->buf_ptr = 0;
-		spinand_read_id(info->spi, (u8 *)state->buf);
+		spinand_read_id(info->spi, state->buf);
 		break;
 	case NAND_CMD_PARAM:
 		state->buf_ptr = 0;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#7 lore raw

PATCH 7/20 staging: ft1000: adjust function arguments

In reply to Aya Mahfouz

Handles the following issues:

Removing extra parentheses around function arguments, Removing unnecessary pointer to pointer cast.

Issues detected and resolved using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

@@
expression e;
identifier f;
@@

f(...,
&
-(
e
-)
,...)

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c +2 -2
index 06b0e9c..cbf59ab 100644
@@ -713,10 +713,10 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
 
 				/* Get buffer for provisioning data */
 				pbuffer =
-					kmalloc((usHdrLength + sizeof(struct pseudo_hdr)),
+					kmalloc(usHdrLength + sizeof(struct pseudo_hdr),
 						GFP_ATOMIC);
 				if (pbuffer) {
-					memcpy(pbuffer, (void *)pUcFile,
+					memcpy(pbuffer, pUcFile,
 					       (u32) (usHdrLength +
 						      sizeof(struct pseudo_hdr)));
 					/* link provisioning data */
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#8 lore raw

PATCH 8/20 staging: ft1000: ft1000-pcmcia: adjust function arguments

In reply to Aya Mahfouz

Handles the following issues:

Removing extra parentheses around function arguments, Removing unnecessary pointer to potinter cast.

Issues were detected using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

@@
expression e;
identifier f;
@@

f(...,
&
-(
e
-)
,...)

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Parentheses removal were left to the script. However, handling pointer casts were done manually because not all replacements generated by the script were suitable. In general, the following cases were discarded:

pointer casts in macros,
pointer casts on function arguments in the form of:
<func>(...,(<type> *)&<expression>,...)

since both cases generated compilation warnings.

---
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +5 -3
index bc959ff..e4559ca 100644
@@ -327,7 +327,7 @@ static void ft1000_reset_asic(struct net_device *dev)
 	 */
 	if (info->AsicID == MAGNEMITE_ID) {
 		ft1000_write_reg(dev, FT1000_REG_RESET,
-				 (DSP_RESET_BIT | ASIC_RESET_BIT));
+				 DSP_RESET_BIT | ASIC_RESET_BIT);
 	}
 	mdelay(1);
 	if (info->AsicID == ELECTRABUZZ_ID) {
@@ -387,7 +387,7 @@ static int ft1000_reset_card(struct net_device *dev)
 	} else {
 		pr_debug("resetting ASIC and DSP\n");
 		ft1000_write_reg(dev, FT1000_REG_RESET,
-				 (DSP_RESET_BIT | ASIC_RESET_BIT));
+				 DSP_RESET_BIT | ASIC_RESET_BIT);
 	}
 
 	/* Copy DSP session record into info block if this is not a coldstart */
@@ -1127,7 +1127,9 @@ static void ft1000_proc_drvmsg(struct net_device *dev)
 				info->DSPInfoBlk[8] = 0x7200;
 				info->DSPInfoBlk[9] =
 					htons(info->DSPInfoBlklen);
-				ft1000_send_cmd(dev, (u16 *)info->DSPInfoBlk, (u16)(info->DSPInfoBlklen+4), 0);
+				ft1000_send_cmd(dev, info->DSPInfoBlk,
+						(u16)(info->DSPInfoBlklen+4),
+						0);
 			}
 
 			break;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#9 lore raw

PATCH 9/20 staging: ft1000: ft1000-usb: adjust function arguments

In reply to Aya Mahfouz

Handles the following issues:

Removing extra parentheses around function arguments, Removing unnecessary pointer to pointer cast.

Issues were detected using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

@@
expression e;
identifier f;
@@

f(...,
&
-(
e
-)
,...)

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Parentheses removal were left to the script. However, handling pointer casts were done manually because not all replacements generated by the script were suitable. In general, the following cases were discarded:

pointer casts in macros,
pointer casts on function arguments in the form of:

    <func>(...,(<type> *)&<expression>,...)

since both cases generated compilation warnings.

---
 drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +4 -4
index 0f776d0..7138523 100644
@@ -190,7 +190,7 @@ int ft1000_create_dev(struct ft1000_usb *dev)
 	tmp->dent = dir;
 	tmp->file = file;
 	tmp->int_number = dev->CardNumber;
-	list_add(&(tmp->list), &(dev->nodes.list));
+	list_add(&tmp->list, &dev->nodes.list);
 
 	pr_debug("registered debugfs directory \"%s\"\n", dev->DeviceName);
 
@@ -477,14 +477,14 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
 		/* Connect Message */
 		pr_debug("IOCTL_FT1000_CONNECT\n");
 		ConnectionMsg[79] = 0xfc;
-		result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
+		result = card_send_command(ft1000dev, ConnectionMsg, 0x4c);
 
 		break;
 	case IOCTL_DISCONNECT:
 		/* Disconnect Message */
 		pr_debug("IOCTL_FT1000_DISCONNECT\n");
 		ConnectionMsg[79] = 0xfd;
-		result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
+		result = card_send_command(ft1000dev, ConnectionMsg, 0x4c);
 		break;
 	case IOCTL_GET_DSP_STAT_CMD:
 		/* pr_debug("IOCTL_FT1000_GET_DSP_STAT\n"); */
@@ -642,7 +642,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
 						}
 						pmsg++;
 						ppseudo_hdr = (struct pseudo_hdr *)pmsg;
-						result = card_send_command(ft1000dev, (unsigned short *)dpram_data, total_len+2);
+						result = card_send_command(ft1000dev, dpram_data, total_len+2);
 
 
 						ft1000dev->app_info[app_index].nTxMsg++;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#10 lore raw

PATCH 10/20 staging: ft1000: ft1000-usb: ft1000_download.c: adjust function arguments

In reply to Aya Mahfouz

Handles the following issues:

Removing extra parentheses around function arguments, Removing unnecessary pointer to pointer cast.

Issues were detected using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

@@
expression e;
identifier f;
@@

f(...,
&
-(
e
-)
,...)

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Parentheses removal were left to the script. However, handling pointer casts were done manually because not all replacements generated by the script were suitable. In general, the following cases were discarded:

pointer casts in macros,
pointer casts on function arguments in the form of:

    <func>(...,(<type> *)&<expression>,...)

since both cases generated compilation warnings.

---
 drivers/staging/ft1000/ft1000-usb/ft1000_download.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/ft1000/ft1000-usb/ft1000_download.c +7 -7
index e8126325..800450f 100644
@@ -230,7 +230,7 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value)
 	while (loopcnt < 100) {
 		if (ft1000dev->usbboot == 2) {
 			status = ft1000_read_dpram32(ft1000dev, 0,
-						     (u8 *)&(ft1000dev->tempbuf[0]), 64);
+						     (u8 *)&ft1000dev->tempbuf[0], 64);
 			for (temp = 0; temp < 16; temp++) {
 				pr_debug("tempbuf %d = 0x%x\n",
 					 temp, ft1000dev->tempbuf[temp]);
@@ -538,7 +538,7 @@ static int write_blk_fifo(struct ft1000_usb *ft1000dev, u16 **pUsFile,
 			  usb_sndbulkpipe(ft1000dev->dev,
 					  ft1000dev->bulk_out_endpointAddr),
 			  ft1000dev->tx_buf, byte_length, usb_dnld_complete,
-			  (void *)ft1000dev);
+			  ft1000dev);
 
 	usb_submit_urb(ft1000dev->tx_urb, GFP_ATOMIC);
 
@@ -704,7 +704,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
 				case REQUEST_CODE_SEGMENT:
 					status = request_code_segment(ft1000dev,
 								      &s_file, &c_file,
-								      (const u8 *)boot_end,
+								      boot_end,
 								      true);
 					break;
 				default:
@@ -799,7 +799,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
 
 					status = request_code_segment(ft1000dev,
 								      &s_file, &c_file,
-								      (const u8 *)code_end,
+								      code_end,
 								      false);
 
 					break;
@@ -971,11 +971,11 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
 
 				/* Get buffer for provisioning data */
 				pbuffer =
-					kmalloc((pseudo_header_len +
-						 sizeof(struct pseudo_hdr)),
+					kmalloc(pseudo_header_len +
+						 sizeof(struct pseudo_hdr),
 						GFP_ATOMIC);
 				if (pbuffer) {
-					memcpy(pbuffer, (void *)c_file,
+					memcpy(pbuffer, c_file,
 					       (u32) (pseudo_header_len +
 						      sizeof(struct
 							     pseudo_hdr)));
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#11 lore raw

PATCH 11/20 staging: ft1000: ft1000-usb: ft1000_hw.c: adjust function arguments

In reply to Aya Mahfouz

Handles the following issues:

Removing extra parentheses around function arguments, Removing unnecessary pointer to pointer casts.

Issues were detected using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

@@
expression e;
identifier f;
@@

f(...,
&
-(
e
-)
,...)

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Parentheses removal were left to the script. However, there were some cases that were handled manually. In addition, handling pointer casts were done manually too because not all replacements generated by the script were suitable. When pointer casts on function arguments were in the form:

    <func>(...,(<type> *)&<expression>,...)

the replacements were discarded due to compilation warnings.

---
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +9 -9
index f0ac438..2620778 100644
@@ -339,7 +339,7 @@ int card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer,
 	commandbuf = kmalloc(size + 2, GFP_KERNEL);
 	if (!commandbuf)
 		return -ENOMEM;
-	memcpy((void *)commandbuf + 2, (void *)ptempbuffer, size);
+	memcpy((void *)commandbuf + 2, ptempbuffer, size);
 
 	if (temp & 0x0100)
 		usleep_range(900, 1100);
@@ -429,7 +429,7 @@ static void ft1000_reset_asic(struct net_device *dev)
 	/* Let's use the register provided by the Magnemite ASIC to reset the
 	 * ASIC and DSP.
 	 */
-	ft1000_write_register(ft1000dev, (DSP_RESET_BIT | ASIC_RESET_BIT),
+	ft1000_write_register(ft1000dev, DSP_RESET_BIT | ASIC_RESET_BIT,
 			      FT1000_REG_RESET);
 
 	mdelay(1);
@@ -542,7 +542,7 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len)
 		hdr.portdest ^ hdr.portsrc ^ hdr.sh_str_id ^ hdr.control;
 
 	memcpy(&pFt1000Dev->tx_buf[0], &hdr, sizeof(hdr));
-	memcpy(&(pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)]), packet, len);
+	memcpy(&pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)], packet, len);
 
 	netif_stop_queue(netdev);
 
@@ -551,7 +551,7 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len)
 			  usb_sndbulkpipe(pFt1000Dev->dev,
 					  pFt1000Dev->bulk_out_endpointAddr),
 			  pFt1000Dev->tx_buf, count,
-			  ft1000_usb_transmit_complete, (void *)pFt1000Dev);
+			  ft1000_usb_transmit_complete, pFt1000Dev);
 
 	t = (u8 *)pFt1000Dev->tx_urb->transfer_buffer;
 
@@ -606,7 +606,7 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		goto err;
 	}
 
-	ft1000_copy_down_pkt(dev, (pdata + ENET_HEADER_SIZE - 2),
+	ft1000_copy_down_pkt(dev, pdata + ENET_HEADER_SIZE - 2,
 			     skb->len - ENET_HEADER_SIZE + 2);
 
 err:
@@ -1558,19 +1558,19 @@ int ft1000_poll(void *dev_id)
 				/* Reset ASIC and DSP */
 				status = ft1000_read_dpram16(dev,
 							     FT1000_MAG_DSP_TIMER0,
-							     (u8 *)&(info->DSP_TIME[0]),
+							     (u8 *)&info->DSP_TIME[0],
 							     FT1000_MAG_DSP_TIMER0_INDX);
 				status = ft1000_read_dpram16(dev,
 							     FT1000_MAG_DSP_TIMER1,
-							     (u8 *)&(info->DSP_TIME[1]),
+							     (u8 *)&info->DSP_TIME[1],
 							     FT1000_MAG_DSP_TIMER1_INDX);
 				status = ft1000_read_dpram16(dev,
 							     FT1000_MAG_DSP_TIMER2,
-							     (u8 *)&(info->DSP_TIME[2]),
+							     (u8 *)&info->DSP_TIME[2],
 							     FT1000_MAG_DSP_TIMER2_INDX);
 				status = ft1000_read_dpram16(dev,
 							     FT1000_MAG_DSP_TIMER3,
-							     (u8 *)&(info->DSP_TIME[3]),
+							     (u8 *)&info->DSP_TIME[3],
 							     FT1000_MAG_DSP_TIMER3_INDX);
 				info->CardReady = 0;
 				info->DrvErrNum = DSP_CONDRESET_INFO;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#12 lore raw

PATCH 12/20 staging: fbtft: fb_agm1264k-fl.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
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
index 7aa9e8c..578fdbe 100644
@@ -390,7 +390,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 			/* select right side (sc1)
 			 * set addr
 			 */
-			write_reg(par, 0x01, (1 << 6));
+			write_reg(par, 0x01, 1 << 6);
 			write_reg(par, 0x01, (0x17 << 3) | (u8)y);
 
 			/* write bitmap */
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#13 lore raw

PATCH 13/20 staging: fbtft: fb_hx8340bn.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/fbtft/fb_hx8340bn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_hx8340bn.c +1 -1
index 26a987a..072b755 100644
@@ -129,7 +129,7 @@ static int set_var(struct fbtft_par *par)
 #define MV (1 << 5)
 	switch (par->info->var.rotate) {
 	case 0:
-		write_reg(par, 0x36, (par->bgr << 3));
+		write_reg(par, 0x36, par->bgr << 3);
 		break;
 	case 270:
 		write_reg(par, 0x36, MX | MV | (par->bgr << 3));
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#14 lore raw

PATCH 14/20 staging: fbtft: fb_hx8353d.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/fbtft/fb_hx8353d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_hx8353d.c +1 -1
index c9512dc..ca52465 100644
@@ -112,7 +112,7 @@ static int set_var(struct fbtft_par *par)
 		write_reg(par, 0x36, my | mv | (par->bgr << 3));
 		break;
 	case 180:
-		write_reg(par, 0x36, (par->bgr << 3));
+		write_reg(par, 0x36, par->bgr << 3);
 		break;
 	case 90:
 		write_reg(par, 0x36, mx | mv | (par->bgr << 3));
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#15 lore raw

PATCH 15/20 staging: fbtft: fb_s6d02a1.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/fbtft/fb_s6d02a1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_s6d02a1.c +1 -1
index e412a42..c87aa25 100644
@@ -136,7 +136,7 @@ static int set_var(struct fbtft_par *par)
 		write_reg(par, 0x36, MY | MV | (par->bgr << 3));
 		break;
 	case 180:
-		write_reg(par, 0x36, (par->bgr << 3));
+		write_reg(par, 0x36, par->bgr << 3);
 		break;
 	case 90:
 		write_reg(par, 0x36, MX | MV | (par->bgr << 3));
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#16 lore raw

PATCH 16/20 staging: fbtft: fb_st7735r.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/fbtft/fb_st7735r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_st7735r.c +1 -1
index 078f502..eb3af1d 100644
@@ -130,7 +130,7 @@ static int set_var(struct fbtft_par *par)
 		write_reg(par, 0x36, MY | MV | (par->bgr << 3));
 		break;
 	case 180:
-		write_reg(par, 0x36, (par->bgr << 3));
+		write_reg(par, 0x36, par->bgr << 3);
 		break;
 	case 90:
 		write_reg(par, 0x36, MX | MV | (par->bgr << 3));
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#17 lore raw

PATCH 17/20 staging: fbtft: remove unnecessary pointer to pointer cast

In reply to Aya Mahfouz

Removes unnecessary pointer to pointer cast since the address is already of type char** and will be implicitly treated as a constant. Issue detected and resolved using the following coccinelle script:

@@
expression e;
type t;
identifier f;
@@

f(...,
-(t *)
e
,...)

---
 drivers/staging/fbtft/fbtft-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fbtft-core.c +1 -1
index 16c7260..1f8d73e 100644
@@ -1331,7 +1331,7 @@ static struct fbtft_platform_data *fbtft_probe_dt(struct device *dev)
 	pdata->fps = fbtft_of_value(node, "fps");
 	pdata->txbuflen = fbtft_of_value(node, "txbuflen");
 	pdata->startbyte = fbtft_of_value(node, "startbyte");
-	of_property_read_string(node, "gamma", (const char **)&pdata->gamma);
+	of_property_read_string(node, "gamma", &pdata->gamma);
 
 	if (of_find_property(node, "led-gpios", NULL))
 		pdata->display.backlight = 1;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#18 lore raw

PATCH 18/20 staging: fbtft: fbtft-io.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/fbtft/fbtft-io.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/fbtft/fbtft-io.c +4 -4
index e19b814..a6f091f 100644
@@ -154,14 +154,14 @@ int fbtft_write_gpio8_wr(struct fbtft_par *par, void *buf, size_t len)
 			for (i = 0; i < 8; i++) {
 				if ((data & 1) != (prev_data & 1))
 					gpio_set_value(par->gpio.db[i],
-								(data & 1));
+								data & 1);
 				data >>= 1;
 				prev_data >>= 1;
 			}
 		}
 #else
 		for (i = 0; i < 8; i++) {
-			gpio_set_value(par->gpio.db[i], (data & 1));
+			gpio_set_value(par->gpio.db[i], data & 1);
 			data >>= 1;
 		}
 #endif
@@ -204,14 +204,14 @@ int fbtft_write_gpio16_wr(struct fbtft_par *par, void *buf, size_t len)
 			for (i = 0; i < 16; i++) {
 				if ((data & 1) != (prev_data & 1))
 					gpio_set_value(par->gpio.db[i],
-								(data & 1));
+								data & 1);
 				data >>= 1;
 				prev_data >>= 1;
 			}
 		}
 #else
 		for (i = 0; i < 16; i++) {
-			gpio_set_value(par->gpio.db[i], (data & 1));
+			gpio_set_value(par->gpio.db[i], data & 1);
 			data >>= 1;
 		}
 #endif
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#19 lore raw

PATCH 19/20 staging: fbtft: fbtft_device.c: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/fbtft/fbtft_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fbtft_device.c +2 -2
index dc48bcc..1afeebb 100644
@@ -1126,14 +1126,14 @@ static int write_gpio16_wr_slow(struct fbtft_par *par, void *buf, size_t len)
 			for (i = 0; i < 16; i++) {
 				if ((data & 1) != (prev_data & 1))
 					gpio_set_value(par->gpio.db[i],
-								(data & 1));
+								data & 1);
 				data >>= 1;
 				prev_data >>= 1;
 			}
 		}
 #else
 		for (i = 0; i < 16; i++) {
-			gpio_set_value(par->gpio.db[i], (data & 1));
+			gpio_set_value(par->gpio.db[i], data & 1);
 			data >>= 1;
 		}
 #endif
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#20 lore raw

PATCH 20/20 staging: goldfish: remove extra parentheses around function arguments

In reply to Aya Mahfouz

Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

---
 drivers/staging/goldfish/goldfish_audio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/goldfish/goldfish_audio.c +4 -4
index f200359..c7f8f1c 100644
@@ -125,8 +125,8 @@ static ssize_t goldfish_audio_read(struct file *fp, char __user *buf,
 		length = (count > READ_BUFFER_SIZE ? READ_BUFFER_SIZE : count);
 		AUDIO_WRITE(data, AUDIO_START_READ, length);
 
-		wait_event_interruptible(data->wait, (data->buffer_status &
-					 AUDIO_INT_READ_BUFFER_FULL));
+		wait_event_interruptible(data->wait, data->buffer_status &
+					 AUDIO_INT_READ_BUFFER_FULL);
 
 		length = AUDIO_READ(data, AUDIO_READ_BUFFER_AVAILABLE);
 
@@ -154,9 +154,9 @@ static ssize_t goldfish_audio_write(struct file *fp, const char __user *buf,
 
 		if (copy > WRITE_BUFFER_SIZE)
 			copy = WRITE_BUFFER_SIZE;
-		wait_event_interruptible(data->wait, (data->buffer_status &
+		wait_event_interruptible(data->wait, data->buffer_status &
 					(AUDIO_INT_WRITE_BUFFER_1_EMPTY |
-					AUDIO_INT_WRITE_BUFFER_2_EMPTY)));
+					AUDIO_INT_WRITE_BUFFER_2_EMPTY));
 
 		if ((data->buffer_status & AUDIO_INT_WRITE_BUFFER_1_EMPTY) != 0)
 			kbuf = data->write_buffer1;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz