Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1120738rdb; Sun, 1 Oct 2023 22:25:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIRPvN2JS2sDxgBv5/lVEGunhKB1RySFqYZ8794RWynoDDNNyUf9TLhNGS/z9gzVfWXrR4 X-Received: by 2002:a05:6a00:2d0d:b0:690:c306:151a with SMTP id fa13-20020a056a002d0d00b00690c306151amr9752320pfb.0.1696224355136; Sun, 01 Oct 2023 22:25:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696224355; cv=pass; d=google.com; s=arc-20160816; b=yGT0vhRy27CpWOv05WfwCpCAoF0O7oCRIvJsmqA6vp68nYlRTx8i8YoFqXVAvklk9H Q8ftl+KpSegDFpm+VCRyBOzr8jvIoJsOKX8XHZ6EVS39UXmV23y/gtsbJpe/TjFDxtc0 jyIXoK0swpTA3qLVS6eob6eRdxLJR96jz9yI2PlNcGkb3LdNzrMyvKF2wVDjPkGN9dkl PcxaIy+0NoKS5aAv1jEuKkl+CZcH62P4/DgYdCmFn9g8+8aIkKEPWB5zoUP0smqHvYeT Ifm0ynmTbDYp9CN8sssH8v3bnH4bpGKq1f2lt0/xC3n4iUZ4/loVwzIA4I4E/SHyOQkP TMsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=7VR12+22R6sOqaNgzDEOC0yBSWf9Y2Pmk0f1Fo7RvKY=; fh=2M2GDi+mRP0Se45CfluNPnC6t1BkRWWcxMd07Cdgasw=; b=GFjYr7FuHtDvSo8DbcEqNONugLt7wfpeAxNVzNVcAPx9UhucMyp+1/gGnwkTQ2WKTa Yo1zj6kUaOFwd9NdQG88wGWZIaCUm50MyV3jN2dLX2f3O6SYvhPuUqVMwwHFi6E5wy5v 34V1Mzb7JxnCkQuy7Pk4BJC26B3xHM1m5reLw9foTPFsG5xSXwG490j6C6haaRmJMOWu 4m570MoIPcu5actkPuTFL/3zKaokd1I9mBQ/oSlr1xYsvgZKxIS9k2LUhhZDCLktg5e0 4OYIpubTJT+qudP7K9Q4oiBdS8MO89SUSjnHWZTw2UXVAGfzmAYG847A8ZemusmQit0S 8csQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@aspeedtech.com header.s=selector2 header.b=LLolZ7sY; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=aspeedtech.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ct27-20020a056a000f9b00b0068e48477befsi27293902pfb.211.2023.10.01.22.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 22:25:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@aspeedtech.com header.s=selector2 header.b=LLolZ7sY; arc=pass (i=1 spf=pass spfdomain=aspeedtech.com dkim=pass dkdomain=aspeedtech.com dmarc=pass fromdomain=aspeedtech.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=aspeedtech.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B9A9F809E71D; Sun, 1 Oct 2023 20:22:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234639AbjJBDWI (ORCPT + 99 others); Sun, 1 Oct 2023 23:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbjJBDWG (ORCPT ); Sun, 1 Oct 2023 23:22:06 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2111.outbound.protection.outlook.com [40.107.117.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA4B4C6; Sun, 1 Oct 2023 20:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XV0cNgvWOEEU9cMKcOzLHqOj/AV+nx9X1f+RAsxt//wpqzcVlVetdpSYXhaTGLxZZWTGGSdQOXH4upkBHIOcsZhSrwHNslCDVYtQ3TTFzglX2L6VpqFmkaSlOEaCxod176LF1dAaS5Hf7BZKUPCTAuehLVby7h/wGhUoKLQbmu6pjiJySz3bKBwhQMuBtOllCSQinWVFscFvt1usjCxg99vE/gM9yplS919e2IhRduNhhBYufc8OpSsptwtTe+lKEGFeg2Axv6MUeEX1wJCRfnmbb16U67EeFhVJpoQ0sEZrPXi9kBvz3m8mTm4XWT/d2O6JDJBmJZqSM/KJGPBM4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7VR12+22R6sOqaNgzDEOC0yBSWf9Y2Pmk0f1Fo7RvKY=; b=In5DZW4+x5A0wsxOJ7iicoV2c7nCfbMp5GUuYGd5Qr9j6zsKHJdLSy/WhmtxttQiixDBieSZXfrMaXdNOvqa7gvzxBQrKiBR8DuWEhIuEaZaw1tfa34YR8k58+jbeoMCcJomoaoPUOsCop687n+9GwXPessKDYG7XbDS21yBkaZ1P530k+agHHoOgpnVd76ERqUB7iMaBvFDaNijvcngG0OKCiiZOjEusEMaOiLE2SVTXThwsBosncRlMlWfzTtlu9vNRsGV4bxh+1EBuJ+AtPwFE92X/5t2+pXzVZYvbv0oV63DZdFeGFtSWXGJKOpy93aDHMGBbKH/rZNeu76nWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7VR12+22R6sOqaNgzDEOC0yBSWf9Y2Pmk0f1Fo7RvKY=; b=LLolZ7sY2zmKlEas0VoEuJSuodhvBK5Gh3i16a2w1hdiI2e3wiI0Opj+Z9AP1YFuZ/hzUWuz9XjQLyn+lF4ewlvNu5Fe6qkwvcIzlpC7oFv755qqp+1yEO1u56cXpCI3TTdb8mjGJHSbc5G0mDkQ3rtUVZoerUS3mP7SnoLoX+vLYuCa722pcnkJaU4MgRiFzfB/WxhAPv7/AeB/0HuyDhZVtUHyLdQMbLSYA+6SEJXY/fOCK96hZ1nQmFo8Fdj/M0JjzCFHIn48YQJJVAnD/MnIowfTiW5doT+O8cz3jxRX8KP9+FzDAp5R/4o69gafcCYOLJpPEzhAS2HLAg2apg== Received: from TYZPR06MB6770.apcprd06.prod.outlook.com (2603:1096:400:45e::12) by KL1PR06MB6297.apcprd06.prod.outlook.com (2603:1096:820:ee::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.29; Mon, 2 Oct 2023 03:21:56 +0000 Received: from TYZPR06MB6770.apcprd06.prod.outlook.com ([fe80::1ed6:569e:e826:62c2]) by TYZPR06MB6770.apcprd06.prod.outlook.com ([fe80::1ed6:569e:e826:62c2%4]) with mapi id 15.20.6838.029; Mon, 2 Oct 2023 03:21:56 +0000 From: Neal Liu To: Corentin Labbe , "andrew@aj.id.au" , "davem@davemloft.net" , "herbert@gondor.apana.org.au" , "joel@jms.id.au" , "john.allen@amd.com" , "thomas.lendacky@amd.com" CC: "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] crypto: Move akcipher_request_cast helper to crypto header Thread-Topic: [PATCH] crypto: Move akcipher_request_cast helper to crypto header Thread-Index: AQHZ9KPWRcGTiWTCyUK/D0jNMoSECrA11bZg Date: Mon, 2 Oct 2023 03:21:56 +0000 Message-ID: References: <20231001201357.2052949-1-clabbe@baylibre.com> In-Reply-To: <20231001201357.2052949-1-clabbe@baylibre.com> Accept-Language: en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB6770:EE_|KL1PR06MB6297:EE_ x-ms-office365-filtering-correlation-id: a80daac7-d270-4c76-fe64-08dbc2f6bb4f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uj7SHwJVo+Xy+AXzvNGy7vD3QwaNTZA7HCdFPq+KcHRpr8qPwGQH2Vs3UtSi/PhMOJaLi63fx1iIrI2NUx33Oo9Tb8aHiVfZSKP12+ITtfFsZz9At9NMUgeH+iA642keyb73/bTLrRK9eMS64dKHun6D9e+uo+4wXIgywjoL5xaR1yzaxvpU2NYVHiiN3wmZ9a+UMhMkvd6+znu3+sE8PhPPL5a5wmH2attQQ23cJgtgx6vrjTlbHkCFzMpnKNvF4+nRutE9262F7vNV+Xs0ZMqNnQvlqgukJFQBwJnREwWS7UVAYGxSOwm5uEZHAeamzoC7/ABPXmP8FwaBVivSHPEhPd7WJCVs0+9kJt1oGGEsJ+2rXR4DiGuPEtLox9JosAInwyS13xCLBuubJ4fNDeMoWuD9wyGqjVN/t/mLPmRi0+qS8+GIXRyLhOzll2MBwuqovIoBOEVRWW8mTKC2nA9A3cqNQxObIvPXOc8DocCTKRDqFPrbqY+yKDzmsK9r/b7grcElHTT/KP3q3fACL5IS4q1wROIt35ySd+2+0T8gwxRq4m8VfUJqbnzS+nZRGzIowW+hL5m3hNvT/3+NDziVnQ3OvLKYfohmGx1EwWm1QMidAH5pPxt3lKM/QfXt x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB6770.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39840400004)(346002)(396003)(366004)(136003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(7696005)(6506007)(53546011)(71200400001)(2906002)(55016003)(26005)(9686003)(66446008)(110136005)(66476007)(8936002)(4326008)(64756008)(54906003)(76116006)(66946007)(316002)(52536014)(5660300002)(86362001)(8676002)(33656002)(122000001)(38070700005)(38100700002)(41300700001)(7416002)(478600001)(66556008)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XrPOdXYJM0o6v+mhhSYPJI4lKEfG3t4wODB4Mc7oWg79kXQw4NzbrtDbFMk2?= =?us-ascii?Q?Fp/sJ88Rxuq6CA+PDzovUQMw9gJOnRWciRlIukeTjYbiw8umucia3G/2xiJD?= =?us-ascii?Q?3vo3RyfGFz6avL/E84YTZlfhERq0/AlSm1kF+VOoUCfPdxC8oy/wyL4DEIQW?= =?us-ascii?Q?cqkMqEbVIgcjKIfNvqDcX0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us-ascii?Q?VixxF+CzR5pFPDRT+D9wejZGJKpZyg+E1k/wkG+juKop4bE44r1rmMD52rf1?= =?us-ascii?Q?nqwGvs85xrBZV22Lsuur/F46//dOt4bfPz0P8xsZ/GtUOPXOjWRyvcTPSfSS?= =?us-ascii?Q?r5skRQ6zLq5YAuSQL0kMZD/Xw3qNFKZY46nSveoRqf+o7F/3WSNyOWkk+Kbc?= =?us-ascii?Q?dBW1X7YSYGWyCW6z/0655NI0NsAlSKlAEaiI0cUow/I1L0yVrOZ13RUku6HH?= =?us-ascii?Q?a3By51A1dMZswNR+Onum4pN4RXiUzidNqyte9BwjytN9QvX8M58MgzlY26Lo?= =?us-ascii?Q?74/cft6JKDIIWT12iv3iFTo26W5sgMjRa1qrX+8HeXvNI2kkWup1IoblvyUq?= =?us-ascii?Q?Hqpzhtb5AvTKX/4Q6W9Gi5PvzV0mZ9WzcJwiEIlmtLzGKum3gdrt8SwN5uD9?= =?us-ascii?Q?dF62cwXmzVno/xjB2nff9HIk+EBcDk9v12Is7u9sX1iCUllOMAu2fcx4bUqN?= =?us-ascii?Q?EydByR3DpVE65ajvfdwgbj0jmCc+kLz1Vnd9vZFZ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6770.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a80daac7-d270-4c76-fe64-08dbc2f6bb4f X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2023 03:21:56.3246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 56r+V8lwcYhFyabpTPPXwlivq9/d5qLQo+bxIiZaYxZsq6bkAn8WrF+AdDwO2wsFlS8bLT2tBjps3QSfcq4NBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6297 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 01 Oct 2023 20:22:50 -0700 (PDT) > -----Original Message----- > From: Corentin Labbe > Sent: Monday, October 2, 2023 4:14 AM > To: andrew@aj.id.au; davem@davemloft.net; herbert@gondor.apana.org.au; > joel@jms.id.au; john.allen@amd.com; Neal Liu ; > thomas.lendacky@amd.com > Cc: linux-arm-kernel@lists.infradead.org; linux-aspeed@lists.ozlabs.org; > linux-crypto@vger.kernel.org; linux-kernel@vger.kernel.org; Corentin Labb= e > > Subject: [PATCH] crypto: Move akcipher_request_cast helper to crypto head= er >=20 > There is already 2 driver implementing their own akcipher_request_cast. > In the future there will be also rockchip and allwinner driver that will = need > this. > This is sufficient to move it in crypto headers. >=20 > Signed-off-by: Corentin Labbe Reviewed-by: Neal Liu Thanks. > --- > drivers/crypto/aspeed/aspeed-acry.c | 6 ------ > drivers/crypto/ccp/ccp-crypto-rsa.c | 6 ------ > include/crypto/akcipher.h | 7 +++++++ > 3 files changed, 7 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/crypto/aspeed/aspeed-acry.c > b/drivers/crypto/aspeed/aspeed-acry.c > index 247c568aa8df..ecb6e984367b 100644 > --- a/drivers/crypto/aspeed/aspeed-acry.c > +++ b/drivers/crypto/aspeed/aspeed-acry.c > @@ -137,12 +137,6 @@ enum aspeed_rsa_key_mode { > ASPEED_RSA_DATA_MODE, > }; >=20 > -static inline struct akcipher_request * > - akcipher_request_cast(struct crypto_async_request *req) > -{ > - return container_of(req, struct akcipher_request, base); > -} > - > static int aspeed_acry_do_fallback(struct akcipher_request *req) { > struct crypto_akcipher *cipher =3D crypto_akcipher_reqtfm(req); diff --= git > a/drivers/crypto/ccp/ccp-crypto-rsa.c b/drivers/crypto/ccp/ccp-crypto-rsa= .c > index a14f85512cf4..32c9f524f3d5 100644 > --- a/drivers/crypto/ccp/ccp-crypto-rsa.c > +++ b/drivers/crypto/ccp/ccp-crypto-rsa.c > @@ -19,12 +19,6 @@ >=20 > #include "ccp-crypto.h" >=20 > -static inline struct akcipher_request *akcipher_request_cast( > - struct crypto_async_request *req) > -{ > - return container_of(req, struct akcipher_request, base); > -} > - > static inline int ccp_copy_and_save_keypart(u8 **kpbuf, unsigned int *kp= len, > const u8 *buf, size_t sz) > { > diff --git a/include/crypto/akcipher.h b/include/crypto/akcipher.h index > 670508f1dca1..4b6e610db18d 100644 > --- a/include/crypto/akcipher.h > +++ b/include/crypto/akcipher.h > @@ -498,4 +498,11 @@ static inline int crypto_akcipher_set_priv_key(struc= t > crypto_akcipher *tfm, >=20 > return alg->set_priv_key(tfm, key, keylen); } > + > +static inline struct akcipher_request * > + akcipher_request_cast(struct crypto_async_request *req) { > + return container_of(req, struct akcipher_request, base); } > + > #endif > -- > 2.41.0