From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758577AbbIDJHw (ORCPT ); Fri, 4 Sep 2015 05:07:52 -0400 Received: from smtp-out6.electric.net ([192.162.217.183]:52485 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757579AbbIDJHt convert rfc822-to-8bit (ORCPT ); Fri, 4 Sep 2015 05:07:49 -0400 From: David Laight To: "'Marcel Holtmann'" , Linus Torvalds CC: "David S. Miller" , Lorenzo Bianconi , Johannes Berg , Andrew Morton , Network Development , Linux Kernel Mailing List Subject: RE: [GIT] Networking Thread-Topic: [GIT] Networking Thread-Index: AQHQ5ozaNImZkGppQ0GaUzqEuW5EZZ4sE2Uw Date: Fri, 4 Sep 2015 09:07:00 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CB8D542@AcuExch.aculab.com> References: <20150902.223522.1792493140210966693.davem@davemloft.net> <20150903.104032.767889134756094076.davem@davemloft.net> <62408D76-2E53-4914-97A9-32B65B167F9B@holtmann.org> In-Reply-To: <62408D76-2E53-4914-97A9-32B65B167F9B@holtmann.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I find them useful as syntactic sugar. We have not used them a lot, but there are cases in our crypto > handling code where we have fixed size array inputs/outputs and there we opted to use them. They make > it easy to remember what the expected sizes of input and output are without having to read through the > implementation (of course we never even tried to use sizeof on these pointers). > > static int smp_ah(struct crypto_blkcipher *tfm, const u8 irk[16], > const u8 r[3], u8 res[3]) Expect that it looks like you are passing arrays by value, but instead you are passing by reference. Explicitly pass by reference and sizeof works. The object code will be the same. David