Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a08b15e6 authored by Valentin Ilie's avatar Valentin Ilie Committed by Johan Hedberg
Browse files

Bluetooth: Remove assignments in if-statements



Remove assignment in if-statements to be consistent with the coding
style.

Signed-off-by: default avatarValentin Ilie <valentin.ilie@gmail.com>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 5981a882
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -180,10 +180,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
	}

	memcpy(send_buf, firmware->data, 20);
	if ((err = usb_control_msg(udev, pipe,
				USB_REQ_DFU_DNLOAD,
				USB_TYPE_VENDOR, 0, 0,
				send_buf, 20, USB_CTRL_SET_TIMEOUT)) < 0) {
	err = usb_control_msg(udev, pipe, USB_REQ_DFU_DNLOAD, USB_TYPE_VENDOR,
			      0, 0, send_buf, 20, USB_CTRL_SET_TIMEOUT);
	if (err < 0) {
		BT_ERR("Can't change to loading configuration err");
		goto error;
	}
+10 −4
Original line number Diff line number Diff line
@@ -131,8 +131,11 @@ static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb)

	BT_DBG("bfusb %p skb %p len %d", data, skb, skb->len);

	if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
	if (!urb) {
		urb = usb_alloc_urb(0, GFP_ATOMIC);
		if (!urb)
			return -ENOMEM;
	}

	pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep);

@@ -218,8 +221,11 @@ static int bfusb_rx_submit(struct bfusb_data *data, struct urb *urb)

	BT_DBG("bfusb %p urb %p", data, urb);

	if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
	if (!urb) {
		urb = usb_alloc_urb(0, GFP_ATOMIC);
		if (!urb)
			return -ENOMEM;
	}

	skb = bt_skb_alloc(size, GFP_ATOMIC);
	if (!skb) {
+6 −3
Original line number Diff line number Diff line
@@ -257,7 +257,8 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
			ready_bit = XMIT_BUF_ONE_READY;
		}

		if (!(skb = skb_dequeue(&(info->txq))))
		skb = skb_dequeue(&(info->txq));
		if (!skb)
			break;

		if (bt_cb(skb)->pkt_type & 0x80) {
@@ -391,7 +392,8 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
		if (info->rx_skb == NULL) {
			info->rx_state = RECV_WAIT_PACKET_TYPE;
			info->rx_count = 0;
			if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
			info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC);
			if (!info->rx_skb) {
				BT_ERR("Can't allocate mem for new packet");
				return;
			}
@@ -566,7 +568,8 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
	/* Ericsson baud rate command */
	unsigned char cmd[] = { HCI_COMMAND_PKT, 0x09, 0xfc, 0x01, 0x03 };

	if (!(skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
	skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC);
	if (!skb) {
		BT_ERR("Can't allocate mem for new packet");
		return -1;
	}
+4 −3
Original line number Diff line number Diff line
@@ -193,8 +193,8 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
		if (!pcmcia_dev_present(info->p_dev))
			break;


		if (!(skb = skb_dequeue(&(info->txq)))) {
		skb = skb_dequeue(&(info->txq));
		if (!skb) {
			clear_bit(XMIT_SENDING, &(info->tx_state));
			break;
		}
@@ -238,7 +238,8 @@ static void bt3c_receive(bt3c_info_t *info)
		if (info->rx_skb == NULL) {
			info->rx_state = RECV_WAIT_PACKET_TYPE;
			info->rx_count = 0;
			if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
			info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC);
			if (!info->rx_skb) {
				BT_ERR("Can't allocate mem for new packet");
				return;
			}
+4 −2
Original line number Diff line number Diff line
@@ -149,7 +149,8 @@ static void btuart_write_wakeup(btuart_info_t *info)
		if (!pcmcia_dev_present(info->p_dev))
			return;

		if (!(skb = skb_dequeue(&(info->txq))))
		skb = skb_dequeue(&(info->txq));
		if (!skb)
			break;

		/* Send frame */
@@ -190,7 +191,8 @@ static void btuart_receive(btuart_info_t *info)
		if (info->rx_skb == NULL) {
			info->rx_state = RECV_WAIT_PACKET_TYPE;
			info->rx_count = 0;
			if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
			info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC);
			if (!info->rx_skb) {
				BT_ERR("Can't allocate mem for new packet");
				return;
			}
Loading