Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4423104yba; Mon, 29 Apr 2019 20:36:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRUBeXfCPqxtX0Xa2+8B/buFx9I7y9nuAkz5aQ0SFlFNUX5y31Fjyob20h/hGA0nMr9z0B X-Received: by 2002:aa7:8c84:: with SMTP id p4mr49399095pfd.164.1556595387497; Mon, 29 Apr 2019 20:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556595387; cv=none; d=google.com; s=arc-20160816; b=hyJV6jy/mMx6lSrwcug4WDK0XpHhYBL4Y66uwOYeYxku6p0CcQQVqDSOhN6dfHhkSm PUG3olsZCunU/mRrhb9LelUtUEGWsm0Yg3llqfel51Eu2a/SO+zhPOYTBgNIGwpJamKJ qN757kEFc6EKa49n2bxkQDwW6d5XiYuUIw4fVlwU+SKdGQ/IcDhHclxLEBifNv+uQIcu Damlot6PPFpShKNmrYtUM0ngqZltRMtT557yAnG4tmZ67I09ULLFbOARN7uxKiF7kzDJ 3QB4WUBCA3vHJWJPWEEjYBvsKzXPmTIX0uwl7Fexh5HR/1rdjor4hU/DYLu8J9lvJYBV pnHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3sc7HBf1vbQLpa59VHf8IleR0IkFzAVnAvQO89gar2k=; b=nqdxaaN3828cptiulJ7uCaNi2IJx0HburhIj6ZdLKOBg3G71U+APGruWjRVbpy1pPU xehPjOhxjCQrRU3X5+njjXbOwNmiLfS4jL9B0Kf0WcYv4OxIbY5dAZdqaWLJfzuNPSOs oAO7YnEauyNGfFIw4yLUx8+wofyvXt/0elC3k+HzlnlPMVFzgxv34BXiDelXytQL2ib/ mdXd4QYIJ62vT3Ih2B4O/OgqHOJ0KEeq3IVQRSIIE+MWmtEPyYX74HV+q+e1qyyv92oG n7R4aOJ55mR2dKXkuB33aPcTvCxsKBqdtKjz542+KcF88QPzp5onOGYoGMyOXWHT/CMV rQTA== 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 h66si33770259pgc.418.2019.04.29.20.36.11; Mon, 29 Apr 2019 20:36:27 -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 S1730035AbfD3DeF (ORCPT + 99 others); Mon, 29 Apr 2019 23:34:05 -0400 Received: from 178.115.242.59.static.drei.at ([178.115.242.59]:33269 "EHLO mail.osadl.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729933AbfD3DeF (ORCPT ); Mon, 29 Apr 2019 23:34:05 -0400 Received: by mail.osadl.at (Postfix, from userid 1001) id DE4EE5C0355; Tue, 30 Apr 2019 05:33:10 +0200 (CEST) Date: Tue, 30 Apr 2019 05:33:10 +0200 From: Nicholas Mc Guire To: Al Viro Cc: Sven Van Asbroeck , Nicholas Mc Guire , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Linux Kernel Mailing List Subject: Re: [PATCH V2] staging: fieldbus: anybus-s: force endiannes annotation Message-ID: <20190430033310.GB23144@osadl.at> References: <1556517940-13725-1-git-send-email-hofrat@osadl.org> <20190430022238.GA22593@osadl.at> <20190430030223.GE23075@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190430030223.GE23075@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 30, 2019 at 04:02:23AM +0100, Al Viro wrote: > On Tue, Apr 30, 2019 at 04:22:38AM +0200, Nicholas Mc Guire wrote: > > On Mon, Apr 29, 2019 at 10:03:36AM -0400, Sven Van Asbroeck wrote: > > > On Mon, Apr 29, 2019 at 2:11 AM Nicholas Mc Guire wrote: > > > > > > > > V2: As requested by Sven Van Asbroeck make the > > > > impact of the patch clear in the commit message. > > > > > > Thank you, but did you miss my comment about creating a local variable > > > instead? See: > > > https://lkml.org/lkml/2019/4/28/97 > > > > Did not miss it - I just don't think that makes it any more > > understandable - the __force __be16 makes it clear I believe > > that this is correct, sparse does not like this though - so tell > > sparse. > > ... to STFU, 'cause you know better. The trouble is, how do we > (or yourself a year or two later) know *why* it is correct? > Worse, how do we (or yourself, etc.) know if a change about to be > done to the code won't invalidate the proof of yours? > > > The local variable would need to be explained as it is > > functionally not necessary - therefor I find it more confusing > > that using __force here. > > What's confusing is mixing host- and fixed-endian values in the > same variable at different times. Treat those as unrelated > types that happen to have the same sizeof. > > Quite a few of __force instances in the tree should be taken out > and shot. Don't add to their number. ok - my bad thn - I had assumed that using __force is reasonable if the handling is correct and its a localized conversoin only like var = be16_to_cpu(var) which evaded introducing additinal variables just to have different types but no different function. But the long-term issue of hiding bugs by __force makes sesne to me - will give it another shot at scripting this in coccinelle. thx! hofrat