Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp987379imm; Tue, 2 Oct 2018 00:18:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ew5J05/Aui/sYKQqNRY8+mrDTtjIsLXqv88eqiBz27vCX9d4phWSKUOQIEgCsvtueL+Il X-Received: by 2002:a62:cac4:: with SMTP id y65-v6mr14968580pfk.27.1538464718826; Tue, 02 Oct 2018 00:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538464718; cv=none; d=google.com; s=arc-20160816; b=Ukxn45zgCPRCnBfjRajpyoJWX7mAmjvF5pmp6fkcBG7B4u4DzhwRRCo6w3Dv09Cd9o WiyuaETNCTBMP2jERw8d3CebJaoEOZ6j1nG8td1Lq4MXhVDwLIPPlJUe965fhm04YAeR OfsZMnB5Npcnx0afrve62qH90lc4301a42FsHOdJBoVYeIQ/DdwOwhIHoG/KVoduW+rZ +luLPrRD+rTlUPkAQCM42BulLNZNwo3nCkj7ILeqOB9N6LeeBj9fwq2nXRp/0gE4K31w NNYxYWbidDLT4XU47+LzjO/P4jk4hdgo24Bfk8g/EWHqQNi+oV135Hxtqt1HlI9jO0ra VfTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=kMUuKzwLUcvDpVBgRrvs/5Hw4J49dkSkUTtdFn5Nzuk=; b=ZOhAIMnLu1bdjCucR/Sbzc3/azzqsc9hXJ2X6vxeflASvXUA09kg/lfJo6729ExNrb i8kTwr17C3YFfuYpJ5gwvLqa2Xju9+LlgrvKQhUd4HllmGP+AH+AlYB9yBYV+uM+Rqv9 i08+91vhYe2WxkHgD4atDhQsSqqxKUCOoQwp9iSkNA5MdruHsap9foROJ5nA7ki+Jo44 VxedSZxTqhqr0Pe+gJ5cyfIrPenib53MKkk9k8G1wgkhF6lQlfBZTofFWvUAjfhCEoN4 8U/StR0pwp5ZU6SCA/Biht/27jMsS8SAn9yV/92b8zJ7RRILGFFvy6NwBojwyx7zW0sM W60g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WU2AsIyd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si13925831pgg.330.2018.10.02.00.18.24; Tue, 02 Oct 2018 00:18:38 -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; dkim=pass header.i=@linaro.org header.s=google header.b=WU2AsIyd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726909AbeJBOAC (ORCPT + 99 others); Tue, 2 Oct 2018 10:00:02 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34540 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbeJBOAB (ORCPT ); Tue, 2 Oct 2018 10:00:01 -0400 Received: by mail-io1-f68.google.com with SMTP id k19-v6so1315828iom.1 for ; Tue, 02 Oct 2018 00:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kMUuKzwLUcvDpVBgRrvs/5Hw4J49dkSkUTtdFn5Nzuk=; b=WU2AsIyd7OklbHOoOrU3ft0tRK4Jvaze0azVafU+z29GrOh9jhzOq9+zL17CrK50Kh Z2nEUiQ/5on/XlMnCL9C01Gs0Yf6YJyUme1T2DY7bKk5TK9qV22oM4X80Jy3KdRGHmxu 8IZkKftsFLfBmwBmJCgBWITyGU/ky3Lz3Mv5M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=kMUuKzwLUcvDpVBgRrvs/5Hw4J49dkSkUTtdFn5Nzuk=; b=W6eNoXWdLaj5Z7R7jxjpx+pqlgApazC/eGAWDOt/qJXebXZ9nQ2ShlXrqMt0W2g7sn ERLvGm/FYs2c+otQdhb7zhDQFeIeazrNwm1LVQCiv/Z1VEfHYLeqwrtn6XDBs72fj/7F itxldUnIoJu20+fHl0iBAQV+MdnmhMLABGk33kZWSY+dr+NqGnsPwidOy24mJ/lpDVxI GSzvIKjMPG+2/+oM9xrFw9aEIynGalkVYkHnE0iAdUJB61n0u8JRW5u/s29eLpqu2zD4 xTrMPMqNqisx1iOaS9mjPWV/Kvzi1kjZbyxPUOMvrs5rlS9lGl8rCcM+xibzxU6TXch5 G4lA== X-Gm-Message-State: ABuFfoh7DAeYx14kUjm9kBhk9hm+NTEWgmMFd75gtSTu1Dqava2GofMO M4c3DQn8PextdppISZEEMW8NO3WikLDWv+XYiG5bEw== X-Received: by 2002:a6b:5d12:: with SMTP id r18-v6mr9432188iob.170.1538464692997; Tue, 02 Oct 2018 00:18:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:5910:0:0:0:0:0 with HTTP; Tue, 2 Oct 2018 00:18:12 -0700 (PDT) In-Reply-To: References: <20180925145622.29959-1-Jason@zx2c4.com> <20180925145622.29959-2-Jason@zx2c4.com> <8afdd3b1c51587708db6ae878eb0a7e9f8b5673a.camel@perches.com> <3E9E1888-026E-45C1-8AA7-DADA211EDBDF@amacapital.net> From: Ard Biesheuvel Date: Tue, 2 Oct 2018 09:18:12 +0200 Message-ID: Subject: Re: [PATCH net-next v6 01/23] asm: simd context helper API To: "Jason A. Donenfeld" Cc: Andy Lutomirski , Joe Perches , LKML , Netdev , Linux Crypto Mailing List , David Miller , Greg Kroah-Hartman , Samuel Neves , Andrew Lutomirski , Thomas Gleixner , linux-arch Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1 October 2018 at 03:43, Jason A. Donenfeld wrote: > On Sun, Sep 30, 2018 at 7:35 AM Andy Lutomirski wro= te: >> >>>>>>> Oh, and another thing (and I'm surprised checkpatch.pl didn't co= mplain >> >>>>>>> about it): the use of typedef in new code is strongly discourage= d. >> >>>>>>> This policy predates my involvement, so perhaps Joe can elaborat= e on >> >>>>>>> the rationale? >> >>>>>> >> >>>>>> In case it matters, the motivation for making this a typedef is I >> >>>>>> could imagine this at some point turning into a more complicated >> >>>>>> struct on certain platforms and that would make refactoring easie= r. I >> >>>>>> could just make it `struct simd_context` now with 1 member though= ... >> >>>>> >> >>>>> Yes that makes sense >> >>>> >> >>>> The rationale for it being a typedef or moving to a struct now? >> >>> >> >>> Yes just switch to a struct. >> >> >> >> Okay. No problem with that, but will wait to hear from Joe first. >> > >> > Why do you need to hear from me again? >> > >> > As far as I know, the only info about typedef avoidance are in >> > Documentation/process/coding-style.rst section 5. >> > >> > >> >> I personally prefer it with the typedef. If this were my code, I=E2=80= =99d say the coding style is silly for opaque tiny structs like this. > > I'll stick with a typedef. Reading the style guide, this clearly falls > into 5.a, 5.b, and maybe 5.c. For 5.a, at some point this will > possibly contain architecture specific blobs. For 5.b, it is just an > enum (integer) right now. I can live with that, but other may still object. In any case, since you are using the enum member as a bitfield, it would be better to typedef it to int instead, and retain the enum definition only for the symbolic constants.