Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2098334lqb; Mon, 27 May 2024 07:50:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtnDhyp5O9+3qn7xKlzCrIqUZshGlct+p6IvLQ9Dif3/CRdXxz8lDo0fjkEAAnTFpMorG2HGzKO76I8cgqLsVR8/1yTGMMQM/PcLmVGw== X-Google-Smtp-Source: AGHT+IGvCrPbGjS03nZWFlfsi/hKdvfj7qVjwmCYPYKWFZ4qU7nb4YeY9aYFMhZwHw6cc+4KAbe+ X-Received: by 2002:a05:6870:c354:b0:24c:523c:b6cf with SMTP id 586e51a60fabf-24ca13149f8mr9821202fac.30.1716821434159; Mon, 27 May 2024 07:50:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716821434; cv=pass; d=google.com; s=arc-20160816; b=eZ/ZVm/ntkH+jms9bZjIHU6aXTAjnYuw9UDzLZYzQplBEjhaKTwv7dptJQ/MRCkOBC OZ6eDZfnFPQJ1wo9pHGCNjGWwUvrlsb03+UDllo5wh5MuLKupiN/Kcv6R/cTzuQfEMzy uNvYl6ILDXFguYKracqs1egpMcZun8ANMc9ALYA6rquRIBqIqMtbkKNYUWv/WPc6h55k 7DFadhw+7KOvu8hdpcC4bTGYfLpvH1GKTUXQcjR9YOMf7sviiFxh+2XPPpicavDphs6A gn3VdxOjnWepQpctzR1ajGWiguCkcHCf0sf8UkEP7dGVLzqsxb557rLWNDhyY0gcn6Wz UINw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=N9d1v31ZFrK1taEeBW4cki6qKb1Ahw+DaMaq2NiPk54=; fh=K9ep9+N1LzXt5vzQnHgjio+czShM0uiT8BewBAccyC4=; b=gCr2fPlRl4S97YwhzkrokF5QYZM3QLx8bJSMRlDqrAh+DddsDthlt3sh98J1PMPDl3 4z3CYj4Vl8zC6kuX6EX8tgflADzyh/E4bwjUudvyrT0+oUVX7zsclfBuAN6BNAVx/pRs Xm/CxJSavHSN8L9tVoW9wQJyopJxkb8qjvp77R0d+z62KvIa+Znr38Wot72MvRK+PF1G 4z956TuioLVZzLybxkaOw30q+bx+JBW/hzRtaTZKVHN0SSz5p7acmPAe33UJpkgMRZfS SjsWNeOyrTd0fYjDl1tthaGEO3DtYYrVXNZQ9LKrG6wJerO2JjUgE73+qgFIbtikEAwt Am2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qSdJ+ycd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190937-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18a830esi82091321cf.256.2024.05.27.07.50.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:50:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qSdJ+ycd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190937-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190937-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B8B531C21655 for ; Mon, 27 May 2024 14:50:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04BE9169AC5; Mon, 27 May 2024 14:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qSdJ+ycd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06C3E15FA70; Mon, 27 May 2024 14:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819584; cv=none; b=tRH5O4FK07n1jmcRT6U+KvqRN7T6yJBFFMbsw9l7vV+yKIO38+yp/lFBkQUOx6WpNG6YLu5BDBlHiRIVPsI/9vkUeh6M0wn7zR6u3WDcnjWfA3vrQf+FMeAipFz4nkYC9z8H9XIxlUbVkLhf0h4KeOWQmyTl2+LhAjXZdmT4Cv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819584; c=relaxed/simple; bh=Z5T0gu59/dQrO1Cfehp1ybI1Sur9v7U7wxLbsRARcmA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gutGe14iFGzAGn8/nPuOS3hf+OLChfwZbO/3aOCtGJbCDaw3YvDG1+s2SFRqPaWGkCpLakwLT2YN6AgW5aho1yEZ5aonjPmZlMO3dpXV5nGkavSJDNTXtMWyC7vbPoaOkNYKIJCTp53taSRG6Ss7cEgFmhSZJhSpS2W8PN7s+Q8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qSdJ+ycd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B30FC4AF07; Mon, 27 May 2024 14:19:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716819583; bh=Z5T0gu59/dQrO1Cfehp1ybI1Sur9v7U7wxLbsRARcmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qSdJ+ycdrkohU4p+nzSryBxVHc6uo0gVNfssofwruSG4jLoY8/hLSGWKPOoDWgo8S PqF6yQtgGEYBSZSgHr5lkB5fV3jdJFdFapHaQr/+m2MG2hyd2gDwadIWZD+dP8f2Ag 6sT/BrvdsF7MHjUjr1q38tQeIiBdFFvbwmRohvymry907NvBxIxpvjI0CIFb/o6k/x WsrQx4KgaNwvIC+owUclQI7/PSpRunQik99cWVFP7EfZkiacfPPynex0ukPFQsFZRc xq80pqORXn3uFkaGCBITKS7QgEavbTsRHDD2MezpsO3ZaWIAyIXNSm8lFoDaZWqvNf 2rh3JkTUsD5KQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Uri Arev , Luiz Augusto von Dentz , Sasha Levin , marcel@holtmann.org, luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 13/13] Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl Date: Mon, 27 May 2024 10:18:50 -0400 Message-ID: <20240527141901.3854691-13-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240527141901.3854691-1-sashal@kernel.org> References: <20240527141901.3854691-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.218 Content-Transfer-Encoding: 8bit From: Uri Arev [ Upstream commit 68aa21054ec3a1a313af90a5f95ade16c3326d20 ] This fixes some CHECKs reported by the checkpatch script. Issues reported in ath3k.c: ------- ath3k.c ------- CHECK: Please don't use multiple blank lines + + CHECK: Blank lines aren't necessary after an open brace '{' +static const struct usb_device_id ath3k_blist_tbl[] = { + CHECK: Alignment should match open parenthesis +static int ath3k_load_firmware(struct usb_device *udev, + const struct firmware *firmware) CHECK: Alignment should match open parenthesis + err = usb_bulk_msg(udev, pipe, send_buf, size, + &len, 3000); CHECK: Unnecessary parentheses around 'len != size' + if (err || (len != size)) { CHECK: Alignment should match open parenthesis +static int ath3k_get_version(struct usb_device *udev, + struct ath3k_version *version) CHECK: Alignment should match open parenthesis +static int ath3k_load_fwfile(struct usb_device *udev, + const struct firmware *firmware) CHECK: Alignment should match open parenthesis + err = usb_bulk_msg(udev, pipe, send_buf, size, + &len, 3000); CHECK: Unnecessary parentheses around 'len != size' + if (err || (len != size)) { CHECK: Blank lines aren't necessary after an open brace '{' + switch (fw_version.ref_clock) { + CHECK: Alignment should match open parenthesis + snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s", + le32_to_cpu(fw_version.rom_version), clk_value, ".dfu"); CHECK: Alignment should match open parenthesis +static int ath3k_probe(struct usb_interface *intf, + const struct usb_device_id *id) CHECK: Alignment should match open parenthesis + BT_ERR("Firmware file \"%s\" not found", + ATH3K_FIRMWARE); CHECK: Alignment should match open parenthesis + BT_ERR("Firmware file \"%s\" request failed (err=%d)", + ATH3K_FIRMWARE, ret); total: 0 errors, 0 warnings, 14 checks, 540 lines checked Signed-off-by: Uri Arev Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- drivers/bluetooth/ath3k.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 759d7828931d9..56ada48104f0e 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c @@ -3,7 +3,6 @@ * Copyright (c) 2008-2009 Atheros Communications Inc. */ - #include #include #include @@ -129,7 +128,6 @@ MODULE_DEVICE_TABLE(usb, ath3k_table); * for AR3012 */ static const struct usb_device_id ath3k_blist_tbl[] = { - /* Atheros AR3012 with sflash firmware*/ { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 }, @@ -203,7 +201,7 @@ static inline void ath3k_log_failed_loading(int err, int len, int size, #define TIMEGAP_USEC_MAX 100 static int ath3k_load_firmware(struct usb_device *udev, - const struct firmware *firmware) + const struct firmware *firmware) { u8 *send_buf; int len = 0; @@ -238,9 +236,9 @@ static int ath3k_load_firmware(struct usb_device *udev, memcpy(send_buf, firmware->data + sent, size); err = usb_bulk_msg(udev, pipe, send_buf, size, - &len, 3000); + &len, 3000); - if (err || (len != size)) { + if (err || len != size) { ath3k_log_failed_loading(err, len, size, count); goto error; } @@ -263,7 +261,7 @@ static int ath3k_get_state(struct usb_device *udev, unsigned char *state) } static int ath3k_get_version(struct usb_device *udev, - struct ath3k_version *version) + struct ath3k_version *version) { return usb_control_msg_recv(udev, 0, ATH3K_GETVERSION, USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, @@ -272,7 +270,7 @@ static int ath3k_get_version(struct usb_device *udev, } static int ath3k_load_fwfile(struct usb_device *udev, - const struct firmware *firmware) + const struct firmware *firmware) { u8 *send_buf; int len = 0; @@ -311,8 +309,8 @@ static int ath3k_load_fwfile(struct usb_device *udev, memcpy(send_buf, firmware->data + sent, size); err = usb_bulk_msg(udev, pipe, send_buf, size, - &len, 3000); - if (err || (len != size)) { + &len, 3000); + if (err || len != size) { ath3k_log_failed_loading(err, len, size, count); kfree(send_buf); return err; @@ -426,7 +424,6 @@ static int ath3k_load_syscfg(struct usb_device *udev) } switch (fw_version.ref_clock) { - case ATH3K_XTAL_FREQ_26M: clk_value = 26; break; @@ -442,7 +439,7 @@ static int ath3k_load_syscfg(struct usb_device *udev) } snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s", - le32_to_cpu(fw_version.rom_version), clk_value, ".dfu"); + le32_to_cpu(fw_version.rom_version), clk_value, ".dfu"); ret = request_firmware(&firmware, filename, &udev->dev); if (ret < 0) { @@ -457,7 +454,7 @@ static int ath3k_load_syscfg(struct usb_device *udev) } static int ath3k_probe(struct usb_interface *intf, - const struct usb_device_id *id) + const struct usb_device_id *id) { const struct firmware *firmware; struct usb_device *udev = interface_to_usbdev(intf); @@ -506,10 +503,10 @@ static int ath3k_probe(struct usb_interface *intf, if (ret < 0) { if (ret == -ENOENT) BT_ERR("Firmware file \"%s\" not found", - ATH3K_FIRMWARE); + ATH3K_FIRMWARE); else BT_ERR("Firmware file \"%s\" request failed (err=%d)", - ATH3K_FIRMWARE, ret); + ATH3K_FIRMWARE, ret); return ret; } -- 2.43.0