[OPW,kernel,v2] Staging: btmtk_usb: Fix line length exceeding 80 characters
diff mbox

Message ID 20131005164301.GA3672@gmail.com
State Changes Requested
Headers show

Commit Message

Rashika Oct. 5, 2013, 4:43 p.m. UTC
This patch fixes the following checkpatch.pl warning in btmtk_usb.c
WARNING: line over 80 characters in the file

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
---

This revision fixes the following issues from the previous revision-
Non-Uniform Indentation, Incorrect breaking of Line, Breaking the
string, Non-Readability, operators placed in new line and seperating the
structure from its field.

 drivers/staging/btmtk_usb/btmtk_usb.c |   61 ++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 32 deletions(-)

Comments

Xenia Ragiadakou Oct. 5, 2013, 4:56 p.m. UTC | #1
Rashika,

probably i confused you. The changes should apply to the original code 
not to your patch. That means you have to redo the changes based on what 
i suggested to you.
To accomplish this do: git reset <to the commit before your first patch 
(2 commits before i imagine)>
That will keep your current changes and you can recommit them, without 
the need to redo them.
The new patch will then apply to the original file. Is it clear?

ksenia

On 10/05/2013 07:43 PM, Rashika Kheria wrote:
> This patch fixes the following checkpatch.pl warning in btmtk_usb.c
> WARNING: line over 80 characters in the file
>
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
> ---
>
> This revision fixes the following issues from the previous revision-
> Non-Uniform Indentation, Incorrect breaking of Line, Breaking the
> string, Non-Readability, operators placed in new line and seperating the
> structure from its field.
>
>   drivers/staging/btmtk_usb/btmtk_usb.c |   61 ++++++++++++++++-----------------
>   1 file changed, 29 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/staging/btmtk_usb/btmtk_usb.c b/drivers/staging/btmtk_usb/btmtk_usb.c
> index 7bf3118..0dc42e6 100644
> --- a/drivers/staging/btmtk_usb/btmtk_usb.c
> +++ b/drivers/staging/btmtk_usb/btmtk_usb.c
> @@ -16,8 +16,8 @@
>    *  You should have received a copy of the GNU General Public License
>    *  along with this program; if not, write to the Free Software
>    *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> - *  or on the worldwide web at http://www.gnu.org/licenses/old-licenses/
> - *  gpl-2.0.txt.
> + *  or on the worldwide web at
> + *  http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
>    *
>    */
>   
> @@ -96,7 +96,7 @@ static int btmtk_usb_io_read32(struct btmtk_usb_data *data, u32 reg, u32 *val)
>   
>   	ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), request,
>   			DEVICE_VENDOR_REQUEST_IN, 0x0, reg, data->io_buf, 4,
> -						  CONTROL_TIMEOUT_JIFFIES);
> +			CONTROL_TIMEOUT_JIFFIES);
>   
>   	if (ret < 0) {
>   		*val = 0xffffffff;
> @@ -127,7 +127,7 @@ static int btmtk_usb_io_write32(struct btmtk_usb_data *data, u32 reg, u32 val)
>   
>   	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), request,
>   			DEVICE_VENDOR_REQUEST_OUT, value, index, NULL, 0,
> -						  CONTROL_TIMEOUT_JIFFIES);
> +			CONTROL_TIMEOUT_JIFFIES);
>   
>   	if (ret < 0) {
>   		BT_ERR("%s error(%d), reg=%x, value=%x\n", __func__, ret, reg,
> @@ -194,9 +194,8 @@ static void btmtk_usb_cap_init(struct btmtk_usb_data *data)
>   				BT_ERR("Firmware file \"%s\" not found\n",
>   						MT7650_FIRMWARE);
>   			} else {
> -				BT_ERR("Firmware file \"%s\" request failed
> -						(err=%d) \n", MT7650_FIRMWARE,
> -						ret);
> +				BT_ERR("Firmware file \"%s\" request failed (err=%d)\n",
> +						MT7650_FIRMWARE, ret);
>   			}
>   		} else {
>   			BT_DBG("Firmware file \"%s\" Found\n",
> @@ -216,9 +215,8 @@ static void btmtk_usb_cap_init(struct btmtk_usb_data *data)
>   				BT_ERR("Firmware file \"%s\" not found\n",
>   						MT7662_FIRMWARE);
>   			} else {
> -				BT_ERR("Firmware file \"%s\" request failed
> -						(err=%d)\n", MT7662_FIRMWARE,
> -						ret);
> +				BT_ERR("Firmware file \"%s\" request failed (err=%d)\n",
> +						MT7662_FIRMWARE, ret);
>   			}
>   		} else {
>   		    BT_DBG("Firmware file \"%s\" Found\n", MT7662_FIRMWARE);
> @@ -269,7 +267,7 @@ static int btmtk_usb_chk_crc(struct btmtk_usb_data *data, u32 checksum_len)
>   
>   	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x1,
>   			DEVICE_VENDOR_REQUEST_IN, 0x20, 0x00, data->io_buf, 8,
> -						  CONTROL_TIMEOUT_JIFFIES);
> +			CONTROL_TIMEOUT_JIFFIES);
>   
>   	if (ret < 0)
>   		BT_ERR("%s error(%d)\n", __func__, ret);
> @@ -419,8 +417,8 @@ load_patch_protect:
>   	/* loading rom patch */
>   	while (1) {
>   		s32 sent_len_max = UPLOAD_PATCH_UNIT - PATCH_HEADER_SIZE;
> -		sent_len = (patch_len - cur_len) >= sent_len_max ? sent_len_max
> -			: (patch_len - cur_len);
> +		sent_len = (patch_len - cur_len) >= sent_len_max ?
> +			sent_len_max : (patch_len - cur_len);
>   
>   		BT_DBG("patch_len = %d\n", patch_len);
>   		BT_DBG("cur_len = %d\n", cur_len);
> @@ -453,12 +451,11 @@ load_patch_protect:
>   
>   			pos[8] = phase;
>   
> -			memcpy(&pos[9], data->firmware->data + PATCH_INFO_SIZE
> -					+ cur_len, sent_len);
> +			memcpy(&pos[9], data->firmware->data + PATCH_INFO_SIZE +
> +					cur_len, sent_len);
>   
> -			BT_DBG("sent_len + PATCH_HEADER_SIZE = %d,
> -					phase = %d\n", sent_len +
> -					PATCH_HEADER_SIZE, phase);
> +			BT_DBG("sent_len + PATCH_HEADER_SIZE = %d, phase = %d\n",
> +					sent_len + PATCH_HEADER_SIZE, phase);
>   
>   			usb_fill_bulk_urb(urb,
>   					data->udev,
> @@ -616,10 +613,10 @@ loadfw_protect:
>   			| (*(data->firmware->data + 4));
>   
>   	fw_ver = (*(data->firmware->data + 11) << 8) |
> -		(*(data->firmware->data + 10));
> +	      (*(data->firmware->data + 10));
>   
>   	build_ver = (*(data->firmware->data + 9) << 8) |
> -		(*(data->firmware->data + 8));
> +		 (*(data->firmware->data + 8));
>   
>   	BT_DBG("fw version:%d.%d.%02d ",
>   			(fw_ver & 0xf000) >> 8,
> @@ -676,8 +673,8 @@ loadfw_protect:
>   
>   	/* Loading ILM */
>   	while (1) {
> -		sent_len = (ilm_len - cur_len) >= 14336 ? 14336
> -			: (ilm_len - cur_len);
> +		sent_len = (ilm_len - cur_len) >= 14336 ? 14336 :
> +			(ilm_len - cur_len);
>   
>   		if (sent_len > 0) {
>   			packet_header &= ~(0xffffffff);
> @@ -736,8 +733,8 @@ loadfw_protect:
>   
>   	/* Loading DLM */
>   	while (1) {
> -		sent_len = (dlm_len - cur_len) >= 14336 ? 14336
> -			: (dlm_len - cur_len);
> +		sent_len = (dlm_len - cur_len) >= 14336 ? 14336 :
> +			(dlm_len - cur_len);
>   
>   		if (sent_len > 0) {
>   			packet_header &= ~(0xffffffff);
> @@ -745,8 +742,8 @@ loadfw_protect:
>   			packet_header = cpu_to_le32(packet_header);
>   
>   			memmove(buf, &packet_header, 4);
> -			memmove(buf + 4, data->firmware->data + 32 + ilm_len
> -					+ cur_len, sent_len);
> +			memmove(buf + 4, data->firmware->data + 32 + ilm_len +
> +					cur_len, sent_len);
>   
>   			/* U2M_PDMA descriptor */
>   			btmtk_usb_io_write32(data, 0x230, 0x80000 + cur_len);
> @@ -1039,8 +1036,8 @@ static void btmtk_usb_isoc_in_complete(struct urb *urb)
>   	if (urb->status == 0) {
>   		for (i = 0; i < urb->number_of_packets; i++) {
>   			unsigned int offset = urb->iso_frame_desc[i].offset;
> -			unsigned int length = urb->iso_frame_desc[i]
> -				.actual_length;
> +			unsigned int length =
> +				urb->iso_frame_desc[i].actual_length;
>   
>   			if (urb->iso_frame_desc[i].status)
>   				continue;
> @@ -1479,8 +1476,8 @@ static void btmtk_usb_work(struct work_struct *work)
>   
>   	if (hdev->conn_hash.sco_num > 0) {
>   		if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) {
> -			err = usb_autopm_get_interface(data->isoc ? data->isoc
> -					: data->intf);
> +			err = usb_autopm_get_interface(data->isoc ? data->isoc :
> +					data->intf);
>   			if (err < 0) {
>   				clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
>   				usb_kill_anchored_urbs(&data->isoc_anchor);
> @@ -1518,8 +1515,8 @@ static void btmtk_usb_work(struct work_struct *work)
>   		__set_isoc_interface(hdev, 0);
>   
>   		if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags))
> -			usb_autopm_put_interface(data->isoc ? data->isoc
> -					: data->intf);
> +			usb_autopm_put_interface(data->isoc ? data->isoc :
> +					data->intf);
>   	}
>   }
>

Patch
diff mbox

diff --git a/drivers/staging/btmtk_usb/btmtk_usb.c b/drivers/staging/btmtk_usb/btmtk_usb.c
index 7bf3118..0dc42e6 100644
--- a/drivers/staging/btmtk_usb/btmtk_usb.c
+++ b/drivers/staging/btmtk_usb/btmtk_usb.c
@@ -16,8 +16,8 @@ 
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *  or on the worldwide web at http://www.gnu.org/licenses/old-licenses/
- *  gpl-2.0.txt.
+ *  or on the worldwide web at
+ *  http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  *
  */
 
@@ -96,7 +96,7 @@  static int btmtk_usb_io_read32(struct btmtk_usb_data *data, u32 reg, u32 *val)
 
 	ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), request,
 			DEVICE_VENDOR_REQUEST_IN, 0x0, reg, data->io_buf, 4,
-						  CONTROL_TIMEOUT_JIFFIES);
+			CONTROL_TIMEOUT_JIFFIES);
 
 	if (ret < 0) {
 		*val = 0xffffffff;
@@ -127,7 +127,7 @@  static int btmtk_usb_io_write32(struct btmtk_usb_data *data, u32 reg, u32 val)
 
 	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), request,
 			DEVICE_VENDOR_REQUEST_OUT, value, index, NULL, 0,
-						  CONTROL_TIMEOUT_JIFFIES);
+			CONTROL_TIMEOUT_JIFFIES);
 
 	if (ret < 0) {
 		BT_ERR("%s error(%d), reg=%x, value=%x\n", __func__, ret, reg,
@@ -194,9 +194,8 @@  static void btmtk_usb_cap_init(struct btmtk_usb_data *data)
 				BT_ERR("Firmware file \"%s\" not found\n",
 						MT7650_FIRMWARE);
 			} else {
-				BT_ERR("Firmware file \"%s\" request failed
-						(err=%d) \n", MT7650_FIRMWARE,
-						ret);
+				BT_ERR("Firmware file \"%s\" request failed (err=%d)\n",
+						MT7650_FIRMWARE, ret);
 			}
 		} else {
 			BT_DBG("Firmware file \"%s\" Found\n",
@@ -216,9 +215,8 @@  static void btmtk_usb_cap_init(struct btmtk_usb_data *data)
 				BT_ERR("Firmware file \"%s\" not found\n",
 						MT7662_FIRMWARE);
 			} else {
-				BT_ERR("Firmware file \"%s\" request failed
-						(err=%d)\n", MT7662_FIRMWARE,
-						ret);
+				BT_ERR("Firmware file \"%s\" request failed (err=%d)\n",
+						MT7662_FIRMWARE, ret);
 			}
 		} else {
 		    BT_DBG("Firmware file \"%s\" Found\n", MT7662_FIRMWARE);
@@ -269,7 +267,7 @@  static int btmtk_usb_chk_crc(struct btmtk_usb_data *data, u32 checksum_len)
 
 	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x1,
 			DEVICE_VENDOR_REQUEST_IN, 0x20, 0x00, data->io_buf, 8,
-						  CONTROL_TIMEOUT_JIFFIES);
+			CONTROL_TIMEOUT_JIFFIES);
 
 	if (ret < 0)
 		BT_ERR("%s error(%d)\n", __func__, ret);
@@ -419,8 +417,8 @@  load_patch_protect:
 	/* loading rom patch */
 	while (1) {
 		s32 sent_len_max = UPLOAD_PATCH_UNIT - PATCH_HEADER_SIZE;
-		sent_len = (patch_len - cur_len) >= sent_len_max ? sent_len_max
-			: (patch_len - cur_len);
+		sent_len = (patch_len - cur_len) >= sent_len_max ?
+			sent_len_max : (patch_len - cur_len);
 
 		BT_DBG("patch_len = %d\n", patch_len);
 		BT_DBG("cur_len = %d\n", cur_len);
@@ -453,12 +451,11 @@  load_patch_protect:
 
 			pos[8] = phase;
 
-			memcpy(&pos[9], data->firmware->data + PATCH_INFO_SIZE
-					+ cur_len, sent_len);
+			memcpy(&pos[9], data->firmware->data + PATCH_INFO_SIZE +
+					cur_len, sent_len);
 
-			BT_DBG("sent_len + PATCH_HEADER_SIZE = %d,
-					phase = %d\n", sent_len +
-					PATCH_HEADER_SIZE, phase);
+			BT_DBG("sent_len + PATCH_HEADER_SIZE = %d, phase = %d\n",
+					sent_len + PATCH_HEADER_SIZE, phase);
 
 			usb_fill_bulk_urb(urb,
 					data->udev,
@@ -616,10 +613,10 @@  loadfw_protect:
 			| (*(data->firmware->data + 4));
 
 	fw_ver = (*(data->firmware->data + 11) << 8) |
-		(*(data->firmware->data + 10));
+	      (*(data->firmware->data + 10));
 
 	build_ver = (*(data->firmware->data + 9) << 8) |
-		(*(data->firmware->data + 8));
+		 (*(data->firmware->data + 8));
 
 	BT_DBG("fw version:%d.%d.%02d ",
 			(fw_ver & 0xf000) >> 8,
@@ -676,8 +673,8 @@  loadfw_protect:
 
 	/* Loading ILM */
 	while (1) {
-		sent_len = (ilm_len - cur_len) >= 14336 ? 14336
-			: (ilm_len - cur_len);
+		sent_len = (ilm_len - cur_len) >= 14336 ? 14336 :
+			(ilm_len - cur_len);
 
 		if (sent_len > 0) {
 			packet_header &= ~(0xffffffff);
@@ -736,8 +733,8 @@  loadfw_protect:
 
 	/* Loading DLM */
 	while (1) {
-		sent_len = (dlm_len - cur_len) >= 14336 ? 14336
-			: (dlm_len - cur_len);
+		sent_len = (dlm_len - cur_len) >= 14336 ? 14336 :
+			(dlm_len - cur_len);
 
 		if (sent_len > 0) {
 			packet_header &= ~(0xffffffff);
@@ -745,8 +742,8 @@  loadfw_protect:
 			packet_header = cpu_to_le32(packet_header);
 
 			memmove(buf, &packet_header, 4);
-			memmove(buf + 4, data->firmware->data + 32 + ilm_len
-					+ cur_len, sent_len);
+			memmove(buf + 4, data->firmware->data + 32 + ilm_len +
+					cur_len, sent_len);
 
 			/* U2M_PDMA descriptor */
 			btmtk_usb_io_write32(data, 0x230, 0x80000 + cur_len);
@@ -1039,8 +1036,8 @@  static void btmtk_usb_isoc_in_complete(struct urb *urb)
 	if (urb->status == 0) {
 		for (i = 0; i < urb->number_of_packets; i++) {
 			unsigned int offset = urb->iso_frame_desc[i].offset;
-			unsigned int length = urb->iso_frame_desc[i]
-				.actual_length;
+			unsigned int length =
+				urb->iso_frame_desc[i].actual_length;
 
 			if (urb->iso_frame_desc[i].status)
 				continue;
@@ -1479,8 +1476,8 @@  static void btmtk_usb_work(struct work_struct *work)
 
 	if (hdev->conn_hash.sco_num > 0) {
 		if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) {
-			err = usb_autopm_get_interface(data->isoc ? data->isoc
-					: data->intf);
+			err = usb_autopm_get_interface(data->isoc ? data->isoc :
+					data->intf);
 			if (err < 0) {
 				clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
 				usb_kill_anchored_urbs(&data->isoc_anchor);
@@ -1518,8 +1515,8 @@  static void btmtk_usb_work(struct work_struct *work)
 		__set_isoc_interface(hdev, 0);
 
 		if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags))
-			usb_autopm_put_interface(data->isoc ? data->isoc
-					: data->intf);
+			usb_autopm_put_interface(data->isoc ? data->isoc :
+					data->intf);
 	}
 }