Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3310393yba; Sun, 28 Apr 2019 23:12:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzN38K7NPI3mfh08N1FxV9Dwai4SjR6oXwMBfv2yphzDBJx77kc7sOlOuqUYUa9u6wLFdkt X-Received: by 2002:a17:902:6b8b:: with SMTP id p11mr14122852plk.225.1556518359121; Sun, 28 Apr 2019 23:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556518359; cv=none; d=google.com; s=arc-20160816; b=G5iwggulk41MI7qiFBJpp9mJwnqOmU2tpAIJw7XENyDfeXAR0KfV8ODIaLp9/5UYyK UtOIUihsIQsp0DUnbVbuWHTSCcRRDGS5RKF0zgq0zRPvFQqIWo0Bh8PEjlEEoUrpvXKN ZLxHLD4ES5SqLNpNERLODETDptOHPKHThK2MWYHkFCKWYEy0S8HNHC8l9tRU4HJaEWSO +pSCIkjh5EYpwnoso5q6OU0IijmKhaPTsdHfQu5Cv3Q7ydqeXHuLLfvTqxN2a24q3V+5 1k7z3UcPYkkwt6H6c5MzSql5BOEgXfUth6Vk2xIY+N6YfhydkjRL2zMXgLmnAUQawowq rFmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=dwlYtQRapXxe+m8hGhCoT5p0/H9nbC0ozsL58/ofEN0=; b=xuhRsR2kGDd7Fqd9YsXuC+u2JfkCMeiHKPBfGTw6f0rHza9Leys11taaHEia9+M3Jf /CGHV9WWPluqXjpNWReY3Pno3Mj4asiL453/S2q1dUr68kpDdkyRjBZXSQWo7rqCxN32 npT8TJmFvC/RELqDS2+f5ooKAUvaFItWqhWa3OyBKqEFik1E8iI9VB2wsPST8XYh3zGQ QwAPkA9hJcHi1sS9ouCdWE+robgWGTt3Qrv5bEZpNDg58/WgG7HZQ4OkBnm/HPifZRfN NI/0GJfgieDsm2x9/7cMg5VpThXB8IG7e0BUr1rbsPkmd52EbspiqBlFitaC4ByPSomU JqdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay11si2822914plb.423.2019.04.28.23.12.23; Sun, 28 Apr 2019 23:12:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727337AbfD2GLb (ORCPT + 99 others); Mon, 29 Apr 2019 02:11:31 -0400 Received: from www.osadl.org ([62.245.132.105]:41113 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbfD2GLb (ORCPT ); Mon, 29 Apr 2019 02:11:31 -0400 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3T6BEma005090; Mon, 29 Apr 2019 08:11:14 +0200 From: Nicholas Mc Guire To: Greg Kroah-Hartman Cc: Sven Van Asbroeck , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH V2] staging: fieldbus: anybus-s: force endiannes annotation Date: Mon, 29 Apr 2019 08:05:39 +0200 Message-Id: <1556517940-13725-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 X-Spam-Status: No, score=-1.9 required=6.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While the endiannes is being handled correctly sparse was unhappy with the missing annotation as be16_to_cpu() expects a __be16. The __force cast to __be16 makes sparse happy but has no impact on the generated binary. Signed-off-by: Nicholas Mc Guire --- Problem reported by sparse V2: As requested by Sven Van Asbroeck make the impact of the patch clear in the commit message. As far as I understand sparse here the __force is actually the only solution possible to inform sparse that the endiannes handling is ok Patch was compile-tested with. x86_64_defconfig + OF=y, FIELDBUS_DEV=m, HMS_ANYBUSS_BUS=m Verification that the patch has no impact on the binary being generated was done by verifying that the diff of the binaries before and after applying the patch is empty. Patch is against 5.1-rc6 (localversion-next is next-20190426) drivers/staging/fieldbus/anybuss/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fieldbus/anybuss/host.c b/drivers/staging/fieldbus/anybuss/host.c index 6227daf..278acac 100644 --- a/drivers/staging/fieldbus/anybuss/host.c +++ b/drivers/staging/fieldbus/anybuss/host.c @@ -1348,7 +1348,7 @@ anybuss_host_common_probe(struct device *dev, add_device_randomness(&val, 4); regmap_bulk_read(cd->regmap, REG_FIELDBUS_TYPE, &fieldbus_type, sizeof(fieldbus_type)); - fieldbus_type = be16_to_cpu(fieldbus_type); + fieldbus_type = be16_to_cpu((__force __be16)fieldbus_type); dev_info(dev, "Fieldbus type: %04X", fieldbus_type); regmap_bulk_read(cd->regmap, REG_MODULE_SW_V, val, 2); dev_info(dev, "Module SW version: %02X%02X", -- 2.1.4