Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4059932rwn; Sun, 11 Sep 2022 04:25:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR5pX8G/PJe+pWp3UKMfZOucBJrDFmN1QGxG68qpEhkdjHeRObjlfJzycP5zhClKvnW6Z4ym X-Received: by 2002:a17:906:a0d3:b0:73d:be5b:2b52 with SMTP id bh19-20020a170906a0d300b0073dbe5b2b52mr15877187ejb.727.1662895554174; Sun, 11 Sep 2022 04:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662895554; cv=none; d=google.com; s=arc-20160816; b=ij6mz8ZjpVFQ1M9ZxYTl3x66eOp1d/1NcQVJjPcR7SNOFaonYhT+1OSJdVYZ6T7lng uEE6gLhoD06wbc5Eelr+QZd5wW1xE2zHuE3X/548aGsHg4Hsq9aOma8xcdtkAHtvb94Y HKnn3DnYggjAnM4bK9la6t01U7UdxCToYBTyufxSGOodmGJhzeP0pkwFCvSOsK2aEnyD S4ykqK4iEDFbdpTJhfDkwFUzVKH3JnHV7MYUZ9Bd00EfRS0JbCugaHvayHuX4WIxlP9G K7FuBxwIbndszwkL1Fxrc/lw04g+0Tj1BRytw+VYFwi6HjDI+On+VmBq0IgtMYXc1XW1 gXyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=gp3UgaatVvujanlcL6wYXQCbjciFqKB9PuAksoUMUQ4=; b=BAXMk8ZnIZl/n8ElvMS97YZvCNwFg+MleM5+sJ9YIvTUIC2oxiK5/DD4XN2bwBov3V 87Tp7FxC+zKIcSYLikmhoejos8B5JvJAq2v6lA8NCafEnddSm4OzSosyC0mYRK3DbuwQ O0m/LBcUirvwt/HCoHI3A9AJBQk8KGzO4+/OMpsbWcni3kJoaU0Lg3KgJ4rzKa/pVfU5 m+pj5kExu7RlJhHZOrO2IhMWKejvhLVs3JLOP3e3bb12f04zvw7BJ1fHRzIaI0WPM2Gx b0oQQlq4zoZ1pzCgXhH0M6w8Y2KfQVfYa4xCFddcjOl2NNPiLXA0j7ypGj6qR7Hbwkhv F0kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qhKxEiK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go38-20020a1709070da600b00730a1f063fasi4546958ejc.132.2022.09.11.04.25.28; Sun, 11 Sep 2022 04:25:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qhKxEiK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230237AbiIKKq0 (ORCPT + 99 others); Sun, 11 Sep 2022 06:46:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbiIKKqK (ORCPT ); Sun, 11 Sep 2022 06:46:10 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F40C826128 for ; Sun, 11 Sep 2022 03:46:07 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id o25so10882920wrf.9 for ; Sun, 11 Sep 2022 03:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date; bh=gp3UgaatVvujanlcL6wYXQCbjciFqKB9PuAksoUMUQ4=; b=qhKxEiK3HRYyBRAy3vY3BcKyHfU77EAYHoMRZG9LlIH/U9XRRKbxPeCeSplBw/Yr1R dkmjbztA6a4m56WoWNJsgdXplWvP4mQ7/uU5U2Go2m1muINB2bIwZxe1Q+y3ReYa6BYn aPnFLJ6l3BPra8/R/RCB+vE5x65JKNGLfyFH2ac75Q/M4503NVb5/ty+iK7WJQZ6quCc 8FzUkEQIMnHpThS6Pcx6fiN188/+jiEPlaHbqdN/ifDf7kQIfS3pEnuJyX75OJXggsmL CJg9zVO6PXf7OxgiO3VJ7LOEI6MmBgwVqPYo1ES9oBCLhfDTdNwtX4zMyt/29CWN7Ym1 wjYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=gp3UgaatVvujanlcL6wYXQCbjciFqKB9PuAksoUMUQ4=; b=QkkSZMTfkjvvyBTOndjxmRS/5+xoKIQNPvIBCWbtKLE2WVefFlBUI4l/a8T43N0JgY fH2C62eZNSeqS8fx9HA2rIKnQWbir+4W7YN/eUsrqyHmcIYCgSdpmuLhvZOQUE8yWHdc U8Mw5sRVOWAykXGUfjV563h57krwAFxB/ZJYtVie2QdS0a7HAuM6snTNnuSBTWQQvbQ1 /zSQkfP5V6g3hCqZtsGml57sTcDvxqrXEn9zf/FerKFAO+gkF7v/ORFTpL++YSzoVEmO f1i6WXo5bmi7q13ITiCgkU9bHmDGBMg0eTmB206Pk9wzg89KNf2Fgx1bZUMptTA5GlHh ihqA== X-Gm-Message-State: ACgBeo2UzrIdJ9JeuS0CBE4lOEWM0pLU/kZx8r1ywwr0LG8JClE628b7 knMYlBo7jaH3bouqOSD1cUm8SOWzi70= X-Received: by 2002:a5d:6da7:0:b0:226:e081:941a with SMTP id u7-20020a5d6da7000000b00226e081941amr12121197wrs.642.1662893166500; Sun, 11 Sep 2022 03:46:06 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p57ba2cf5.dip0.t-ipconnect.de. [87.186.44.245]) by smtp.gmail.com with ESMTPSA id l5-20020a05600c1d0500b003b477532e66sm3478029wms.2.2022.09.11.03.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 03:46:06 -0700 (PDT) Date: Sun, 11 Sep 2022 12:46:04 +0200 From: Philipp Hortmann To: Forest Bond , Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset Message-ID: <540a684266610f7618b3ef6000d4699d065c8e6f.1662890990.git.philipp.g.hortmann@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename function MACbSafeSoftwareReset to vt6655_mac_save_soft_reset and abyTmpRegData to tmp_reg_data to avoid CamelCase which is not accepted by checkpatch.pl. Remove return value bRetVal as it is unused by the calling functions. Remove unnecessary declaration of function and make function static. Change declaration of tmp_reg_data to shorten code. Signed-off-by: Philipp Hortmann --- drivers/staging/vt6655/mac.c | 17 +++++++---------- drivers/staging/vt6655/mac.h | 1 - 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index b1aa5fbe4430..f292a34c23dd 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -293,23 +293,20 @@ bool MACbSoftwareReset(struct vnt_private *priv) * Return Value: true if success; otherwise false * */ -bool MACbSafeSoftwareReset(struct vnt_private *priv) +static void vt6655_mac_save_soft_reset(struct vnt_private *priv) { - unsigned char abyTmpRegData[MAC_MAX_CONTEXT_SIZE_PAGE0 + MAC_MAX_CONTEXT_SIZE_PAGE1]; - bool bRetVal; + u8 tmp_reg_data[MAC_MAX_CONTEXT_SIZE_PAGE0 + MAC_MAX_CONTEXT_SIZE_PAGE1]; /* PATCH.... * save some important register's value, then do * reset, then restore register's value */ /* save MAC context */ - vt6655_mac_save_context(priv, abyTmpRegData); + vt6655_mac_save_context(priv, tmp_reg_data); /* do reset */ - bRetVal = MACbSoftwareReset(priv); + MACbSoftwareReset(priv); /* restore MAC context, except CR0 */ - vt6655_mac_restore_context(priv, abyTmpRegData); - - return bRetVal; + vt6655_mac_restore_context(priv, tmp_reg_data); } /* @@ -443,12 +440,12 @@ bool MACbSafeStop(struct vnt_private *priv) if (!MACbSafeRxOff(priv)) { pr_debug(" MACbSafeRxOff == false)\n"); - MACbSafeSoftwareReset(priv); + vt6655_mac_save_soft_reset(priv); return false; } if (!MACbSafeTxOff(priv)) { pr_debug(" MACbSafeTxOff == false)\n"); - MACbSafeSoftwareReset(priv); + vt6655_mac_save_soft_reset(priv); return false; } diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h index 25247b0bf039..5dd8644749ec 100644 --- a/drivers/staging/vt6655/mac.h +++ b/drivers/staging/vt6655/mac.h @@ -554,7 +554,6 @@ void vt6655_mac_set_short_retry_limit(struct vnt_private *priv, unsigned char re void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit); bool MACbSoftwareReset(struct vnt_private *priv); -bool MACbSafeSoftwareReset(struct vnt_private *priv); bool MACbSafeRxOff(struct vnt_private *priv); bool MACbSafeTxOff(struct vnt_private *priv); bool MACbSafeStop(struct vnt_private *priv); -- 2.37.3