From patchwork Sat Jun 25 08:49:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Viso Carrera X-Patchwork-Id: 585077 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8148BC43334 for ; Sat, 25 Jun 2022 09:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbiFYJFD (ORCPT ); Sat, 25 Jun 2022 05:05:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231934AbiFYJFC (ORCPT ); Sat, 25 Jun 2022 05:05:02 -0400 Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D951933E06 for ; Sat, 25 Jun 2022 02:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656146995; cv=none; d=zohomail.com; s=zohoarc; b=eQ8vlQ/mEa0BTElFAADKoVMx03yLeGW9BpCjUAPi5WA/5sTo10Eh3ch2cp/Fh1nj8LRYwAItf/BUK6f2c9WUiwKpIpKN3jgSWzG5QPQY32/NoyZLZmZP+VQ4+id0UIyayLzKbbyDgB6yzcS92DvcaTZBYvpKQxB1ikQRJ1Tttdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656146995; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=73B7q5ose/xpDy9xdiy7dsAKG7gzYSYBRfHb0ImXIXY=; b=hWOIinsJoGtVAHhY6hFjC60zeMiQtgzoM1vrqxjOYoUFWVTDfSpd98X2EfthJhk1RQBtY0b374u61Rw4eUI8wq+zWcJfdQ58SkEdpBNeSAvzQV6HDj4+IPEVLOBoe4HQwjdys//XGmBrw23Sia9xGp43QkVKvHp7syYyC8+JUGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=gvisoc.com; spf=pass smtp.mailfrom=gabriel@gvisoc.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1656146995; s=zoho; d=gvisoc.com; i=gabriel@gvisoc.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=73B7q5ose/xpDy9xdiy7dsAKG7gzYSYBRfHb0ImXIXY=; b=AGLir0qMfZ+8+9RBF74CrrNnsDKka432+iidZEZtUxp0FnmjE5gjOpAsqOLg/Qdv 7Ec8zqQzuidgW2c6D5ouxI3A8ubOnmB5b/60tRzPF52CVajdBaoSGc61vPAggQ1teox lwTH7KyqKtP7bKiC542a/b40mtH1Ghtrj81sYNLE= Received: from localhost (124-171-144-237.tpgi.com.au [124.171.144.237]) by mx.zohomail.com with SMTPS id 1656146993489390.95142231892817; Sat, 25 Jun 2022 01:49:53 -0700 (PDT) From: Gabriel Viso Carrera To: andreas.noever@gmail.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Gabriel Viso Carrera Subject: [PATCH 1/3] staging: Thunderbolt: ctl.c: Fixed 2 literal style coding issues Date: Sat, 25 Jun 2022 18:49:11 +1000 Message-Id: <20220625084913.603556-2-gabriel@gvisoc.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220625084913.603556-1-gabriel@gvisoc.com> References: <20220625084913.603556-1-gabriel@gvisoc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org In lines 1028 and 1054, there were WARN calls with hardcoded literal function name. Replaced with the recommended %s and __func__. Signed-off-by: Gabriel Viso Carrera --- drivers/thunderbolt/ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index e92c658dba1c..4b841fbb3628 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -1025,7 +1025,7 @@ int tb_cfg_read(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, break; default: - WARN(1, "tb_cfg_read: %d\n", res.err); + WARN(1, "%s: %d\n", __func__, res.err); break; } return res.err; @@ -1051,7 +1051,7 @@ int tb_cfg_write(struct tb_ctl *ctl, const void *buffer, u64 route, u32 port, break; default: - WARN(1, "tb_cfg_write: %d\n", res.err); + WARN(1, "%s: %d\n", __func__, res.err); break; } return res.err; From patchwork Sat Jun 25 08:49:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Viso Carrera X-Patchwork-Id: 585265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 989A8C433EF for ; Sat, 25 Jun 2022 09:05:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232395AbiFYJFM (ORCPT ); Sat, 25 Jun 2022 05:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232389AbiFYJFL (ORCPT ); Sat, 25 Jun 2022 05:05:11 -0400 Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E681A33E39 for ; Sat, 25 Jun 2022 02:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656147003; cv=none; d=zohomail.com; s=zohoarc; b=Pljd/awPP1rhutkfPAS31EW6oN+Bp67f/143fcxHSukDwZavKDzNR9WE4vrQJY86mQzE9VcQmZwxmUcrqza3TA1fWKlv0Sd3kWAnewklYD6CYh43JVD5y+tvH4f4BoLfsaKUT2jXuLq3rppXQfHdt6GaqfQgSnQBtjqpO914QMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656147003; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=fnspOYc3t+/42Tg1YX2ErJZ25N1I+LrcKkp6cY76wXA=; b=ew9ls0YoxYguB24N5tRBxPFyi0qch+hfXkSI1qBNe/oiy0CiDrj7d3JlOrpZpos5I7jCAFfdiQwQbv/oBVtyqm/7XsA0HE4JdZ2EI6bVSjTETdlZJ14uwawRf4p98IWJRRIFLs+E1eAGWUfnfceijbSpAR0SOPWhmFE+tLMSjLM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=gvisoc.com; spf=pass smtp.mailfrom=gabriel@gvisoc.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1656147003; s=zoho; d=gvisoc.com; i=gabriel@gvisoc.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=fnspOYc3t+/42Tg1YX2ErJZ25N1I+LrcKkp6cY76wXA=; b=AEWZUBfOEXWdMhCRpFbE7Zi5siZubTR8738E/vwLJIdTDTQZOyzUY05v1tXCC1XU E7CsCGkbDJJHeFo2otzobhmvkrzfYFL9JpFvePVkuR27RGn4hsg0rhjRZfN7eMp/gKE KJEfcuBoj2syq6uFbqu3wh0fEdOuDFsfqYrNC6DY= Received: from localhost (124-171-144-237.tpgi.com.au [124.171.144.237]) by mx.zohomail.com with SMTPS id 165614700268011.66864093033962; Sat, 25 Jun 2022 01:50:02 -0700 (PDT) From: Gabriel Viso Carrera To: andreas.noever@gmail.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Gabriel Viso Carrera Subject: [PATCH 2/3] staging: Thunderbolt: ctl.c: Fixed blank line coding style issues Date: Sat, 25 Jun 2022 18:49:12 +1000 Message-Id: <20220625084913.603556-3-gabriel@gvisoc.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220625084913.603556-1-gabriel@gvisoc.com> References: <20220625084913.603556-1-gabriel@gvisoc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Added blank lines after variable declarations as per checkpatch.pl (all issues of that kind in the file). Signed-off-by: Gabriel Viso Carrera --- drivers/thunderbolt/ctl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 4b841fbb3628..6c973fdf7b36 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -232,6 +232,7 @@ static struct tb_cfg_result decode_error(const struct ctl_pkg *response) struct cfg_error_pkg *pkg = response->buffer; struct tb_ctl *ctl = response->ctl; struct tb_cfg_result res = { 0 }; + res.response_route = tb_cfg_get_route(&pkg->header); res.response_port = 0; res.err = check_header(response, sizeof(*pkg), TB_CFG_PKG_ERROR, @@ -327,6 +328,7 @@ static void tb_ctl_pkg_free(struct ctl_pkg *pkg) static struct ctl_pkg *tb_ctl_pkg_alloc(struct tb_ctl *ctl) { struct ctl_pkg *pkg = kzalloc(sizeof(*pkg), GFP_KERNEL); + if (!pkg) return NULL; pkg->ctl = ctl; @@ -346,6 +348,7 @@ static void tb_ctl_tx_callback(struct tb_ring *ring, struct ring_frame *frame, bool canceled) { struct ctl_pkg *pkg = container_of(frame, typeof(*pkg), frame); + tb_ctl_pkg_free(pkg); } @@ -361,6 +364,7 @@ static int tb_ctl_tx(struct tb_ctl *ctl, const void *data, size_t len, { int res; struct ctl_pkg *pkg; + if (len % 4 != 0) { /* required for le->be conversion */ tb_ctl_WARN(ctl, "TX: invalid size: %zu\n", len); return -EINVAL; @@ -627,6 +631,7 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, int timeout_msec, event_cb cb, { int i; struct tb_ctl *ctl = kzalloc(sizeof(*ctl), GFP_KERNEL); + if (!ctl) return NULL; ctl->nhi = nhi; @@ -700,6 +705,7 @@ void tb_ctl_free(struct tb_ctl *ctl) void tb_ctl_start(struct tb_ctl *ctl) { int i; + tb_ctl_dbg(ctl, "control channel starting...\n"); tb_ring_start(ctl->tx); /* is used to ack hotplug packets, start first */ tb_ring_start(ctl->rx); From patchwork Sat Jun 25 08:49:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Viso Carrera X-Patchwork-Id: 585076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C001CC43334 for ; Sat, 25 Jun 2022 09:05:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbiFYJFP (ORCPT ); Sat, 25 Jun 2022 05:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232399AbiFYJFP (ORCPT ); Sat, 25 Jun 2022 05:05:15 -0400 Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 671B533E9C for ; Sat, 25 Jun 2022 02:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656147009; cv=none; d=zohomail.com; s=zohoarc; b=bckmVqAIFAQNFCUWf9zkVWIKa0qmv+89FpiYMjpbhBlmnKbmeBDKJAuE5vw5IqpGH/UmV61atpzKfOoxKw+awseHSKfl1hQLW4+ADpqpDK61LCoD3obq6tHDegeDeFy4kDpFTJZRjMX5EnVrn9OMCFd+vmgYQOxR5fC+leVPiTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656147009; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=4UMGpmnDr90V/zwk67wYZZmzKHcnh/fQWLLmg0NOGYU=; b=VPw5vwLan2WwXsFO2ylcyH2UswZMYEGl8+axbs2DFzo8JW4CLbgOK3iaMvuMUSrtV3d3h6qz8G57mionxpQYMSHAPJUpRCSR0VDeycCLW7Fs/2jKeOL1bScXqtNBLzQTHjC8RbuRIhOZsD6RPasFzYed/q0mjDaz/SLpBDZkZEA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=gvisoc.com; spf=pass smtp.mailfrom=gabriel@gvisoc.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1656147009; s=zoho; d=gvisoc.com; i=gabriel@gvisoc.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=4UMGpmnDr90V/zwk67wYZZmzKHcnh/fQWLLmg0NOGYU=; b=EFUkmV8grgPqSVH5Dh2CRmTdnNYqeNVWx3VD+W3HLJWLe/REroZ7IOvSr+OOtWG3 2O/xMck3LO8Q6gq0W5Yf78He0JxZyr3gRZMwXNmQCLZ+Ef/mH/G/dqPV2n2foAb5oHw IjsPOOVrRzHMfn6tZz2LoAYtMUiDcKlnJEY5R9sU= Received: from localhost (124-171-144-237.tpgi.com.au [124.171.144.237]) by mx.zohomail.com with SMTPS id 1656147007457304.1853474145885; Sat, 25 Jun 2022 01:50:07 -0700 (PDT) From: Gabriel Viso Carrera To: andreas.noever@gmail.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Gabriel Viso Carrera Subject: [PATCH 3/3] staging: Thunderbolt: ctl.c: Fixed comment coding style issues Date: Sat, 25 Jun 2022 18:49:13 +1000 Message-Id: <20220625084913.603556-4-gabriel@gvisoc.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220625084913.603556-1-gabriel@gvisoc.com> References: <20220625084913.603556-1-gabriel@gvisoc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Fixed a couple of comment aligment & formatting coding style issues. Signed-off-by: Gabriel Viso Carrera --- drivers/thunderbolt/ctl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 6c973fdf7b36..5c6c62867b9c 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -276,7 +276,8 @@ static void tb_cfg_print_error(struct tb_ctl *ctl, switch (res->tb_error) { case TB_CFG_ERROR_PORT_NOT_CONNECTED: /* Port is not connected. This can happen during surprise - * removal. Do not warn. */ + * removal. Do not warn. + */ return; case TB_CFG_ERROR_INVALID_CONFIG_SPACE: /* @@ -402,11 +403,11 @@ static bool tb_ctl_handle_event(struct tb_ctl *ctl, enum tb_cfg_pkg_type type, static void tb_ctl_rx_submit(struct ctl_pkg *pkg) { tb_ring_rx(pkg->ctl->rx, &pkg->frame); /* - * We ignore failures during stop. - * All rx packets are referenced - * from ctl->rx_packets, so we do - * not loose them. - */ + * We ignore failures during stop. + * All rx packets are referenced + * from ctl->rx_packets, so we do + * not loose them. + */ } static int tb_async_error(const struct ctl_pkg *pkg)