Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2286808pxb; Tue, 23 Feb 2021 03:25:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWYUutCfA49QyRGudpOM7L0O3pi5sqowAwHGngxP0xdm/BP237GqmpS+CDizSvcTJLwYMw X-Received: by 2002:a17:906:5655:: with SMTP id v21mr24764031ejr.264.1614079508240; Tue, 23 Feb 2021 03:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614079508; cv=none; d=google.com; s=arc-20160816; b=tCQ24hfqwbo2lJrXcChoblyGIenGZ3vzWdDmC16uXi7EScmAHpoNXaN5b/bzWEifUd eDLQA/MFJJzW1j/0DhDQ+1haD38PD68xUXY77ZehU4bYIzU0VYsJfpPPfmwGQD9gXoE1 6dhuOcovUod8xntCG968rDu6ewUwz+ttXBcT13uqApEzs3FzV0mfewU3QocuUV5BPJAY 7jT/6FJrVFscGma6lbfJ0+mTKFp6xU0ZRAkNh84M4VBiT2qNgJsF3AvIvXvRmONoFyye al4Gp4SbprcVFhMfQjhiB0Dc07+sAuUnd0Po0I2ars6YPk/DzWcvr+wI5n6PK7YScTdH 2YUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Pa1aUEH3kibylqnLMVL0OGf1HMOeIF7nNkyZwVDBePs=; b=T29UpM3/KPoXr0YSpaFTPkFf3BMqLShNGR+AX70kxRPUxaeXimmKJAJ3hLe92WFazL VmgMBR3uNzUgus7r6TAsOIVPKomxeGhr61ore1LjQr0c729bOqqwkIe2upLzi2KIiq6N OKTWHLqhCNDuZFNPnuhMZjtFDNy6BAPpaHJ3NH+svZhlSZtDzhIJYD3Q3STwVS3f3fYj ZesVNGUxeXdKSsEUdRoObtaDES8ChCfvvQ7OXhRXRMsRCAcECje1cmJxrgNaLdDH83Bx BXTl90ozRJgzF90JVdXuoEijeLGzHKHnp19gnhqRP/10N4o5sPQ61MUo1EDIIFEo9NEL FDtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do1si3137438ejc.732.2021.02.23.03.24.43; Tue, 23 Feb 2021 03:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231865AbhBWLUy (ORCPT + 99 others); Tue, 23 Feb 2021 06:20:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbhBWLUw (ORCPT ); Tue, 23 Feb 2021 06:20:52 -0500 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A241C061786 for ; Tue, 23 Feb 2021 03:20:07 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:254f:253d:debc:790b]) by xavier.telenet-ops.be with bizsmtp id YbL52400V1v7dkx01bL55Y; Tue, 23 Feb 2021 12:20:06 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lEVjZ-0011vc-9r; Tue, 23 Feb 2021 12:20:05 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lEVjY-009KOx-Sv; Tue, 23 Feb 2021 12:20:04 +0100 From: Geert Uytterhoeven To: Vladimir Oltean , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] net: dsa: sja1105: Remove unneeded cast in sja1105_crc32() Date: Tue, 23 Feb 2021 12:20:03 +0100 Message-Id: <20210223112003.2223332-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sja1105_unpack() takes a "const void *buf" as its first parameter, so there is no need to cast away the "const" of the "buf" variable before calling it. Drop the cast, as it prevents the compiler performing some checks. Signed-off-by: Geert Uytterhoeven --- Compile-tested only. BTW, sja1105_packing() and packing() are really bad APIs, as the input pointer parameters cannot be const due to the direction depending on "op". This means the compiler cannot do const checks. Worse, callers are required to cast away constness to prevent the compiler from issueing warnings. Please don't do this! --- drivers/net/dsa/sja1105/sja1105_static_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/sja1105/sja1105_static_config.c b/drivers/net/dsa/sja1105/sja1105_static_config.c index 139b7b4fbd0d5252..a8efb7fac3955307 100644 --- a/drivers/net/dsa/sja1105/sja1105_static_config.c +++ b/drivers/net/dsa/sja1105/sja1105_static_config.c @@ -85,7 +85,7 @@ u32 sja1105_crc32(const void *buf, size_t len) /* seed */ crc = ~0; for (i = 0; i < len; i += 4) { - sja1105_unpack((void *)buf + i, &word, 31, 0, 4); + sja1105_unpack(buf + i, &word, 31, 0, 4); crc = crc32_le(crc, (u8 *)&word, 4); } return ~crc; -- 2.25.1