Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1487162imm; Sat, 6 Oct 2018 04:28:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV62iXD4XPDZ+xJdmXNp8uQ5Wzk1wuloyxRi1sS+iK9M9smSwQkFcZDZhTT43OB93AZE7vNju X-Received: by 2002:a63:7506:: with SMTP id q6-v6mr13664822pgc.137.1538825307918; Sat, 06 Oct 2018 04:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538825307; cv=none; d=google.com; s=arc-20160816; b=YRc3GNC3c9JpGdYzrhRVPE928ygOEzsVKSaoGD17DJTueK0Q1PhHOfDglfTjbkx5tQ d4/ttdMt522DkBykatYJTAYRm2A6gkxMNNA3wnN5xyNl6LPp+hng3+8oMVfnRFHUE9AN Cxq1WFj8xvhOMFsJZEQX1yoCZOuBpZ3wQZYVSSboiN5kphjpYwfWPM8c9n+ahOi171Vx uIF6CNIq40nkupqICZf0lH1FWmDeCvRLsoRxNeqTlwdooIiIQiRLDLVlYLaBRtzBBpPY goUzux8pXiigsPECElt4aNhxT9+8OB4+lEqFcKZDV2OZwOkznZY3ZsB+zZqSBMBeUVxQ z9qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=6Kbr9ku654MtH3NJtI3PLbalGMoV/ffoL2H55REEU+Y=; b=XNI62s/6OwBMgt1uesHv03NhFcTODiBgbqcNrOp6WcFHORuCL2UClAm14KIAVluldn aR7OBto4DUDJ1n636r4zgf+tigxhTx2pLV6KNJsBOJc9n0HZHlo51Jh3fbgWM0amYEpj d1XeIz9mg2K7Cq2HFgbXavpyB6h7ywWLn9jVOf+8VokFykd7yz0JmW0Mgqfb7lIRHBvE UDaBctPVxleTbqjmad3x+qqSZbhA7E358Pqig7R6d6TefYXqxNOyjjtPvQblNsMAxu+S 4yQF8DXx/cBmbFbymrB06s8YCkYtgZxzXoGFB9VypEbSfpdxWBl1en55Sk8KNNmM8v6z 0oHA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10-v6si9830099plh.439.2018.10.06.04.28.12; Sat, 06 Oct 2018 04:28: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727784AbeJFSaY (ORCPT + 99 others); Sat, 6 Oct 2018 14:30:24 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:51644 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727161AbeJFSaY (ORCPT ); Sat, 6 Oct 2018 14:30:24 -0400 Received: from [192.168.122.135] (helo=_) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1g8kk3-0005v1-Dl; Sat, 06 Oct 2018 12:27:27 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 06 Oct 2018 12:27:27 +0100 From: Ben Dooks To: David Miller Cc: netdev@vger.kernel.org, David.Laight@aculab.com, oneukum@suse.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel@lists.codethink.co.uk Subject: Re: [PATCH] usbnet: smsc95xx: simplify tx_fixup code In-Reply-To: <20181005.142412.601607260441380535.davem@davemloft.net> References: <59988ed22559410881addfecf58335eb@AcuMS.aculab.com> <20181002165602.21033-1-ben.dooks@codethink.co.uk> <20181005.142412.601607260441380535.davem@davemloft.net> Message-ID: <40033993674bb8b5ef33ac33f28f3aff@codethink.co.uk> X-Sender: ben.dooks@codethink.co.uk User-Agent: Roundcube Webmail/1.1.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-10-05 22:24, David Miller wrote: > From: Ben Dooks > Date: Tue, 2 Oct 2018 17:56:02 +0100 > >> - memcpy(skb->data, &tx_cmd_a, 4); >> + ptr = skb_push(skb, 8); >> + tx_cmd_a = cpu_to_le32(tx_cmd_a); >> + tx_cmd_b = cpu_to_le32(tx_cmd_b); >> + memcpy(ptr, &tx_cmd_a, 4); >> + memcpy(ptr+4, &tx_cmd_b, 4); > > Even a memcpy() through a void pointer does not guarantee that gcc will > not emit word sized loads and stores. > > You must use the get_unaligned()/put_unaligned() facilities to do this > properly. Thanks, got a new version of the series just being tested with this. Should it go into the original, or as a separate change? > > I also agree that making a proper type and structure instead of using > a void pointer would be better.