Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2567459pxa; Mon, 17 Aug 2020 12:59:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3GF9fcyT7mnaj+sXUMGTgecnNaeMeexd+uqBzUoYN4hvFqxPgyV+VY/2W3NeVaUQAwTXA X-Received: by 2002:a17:906:811:: with SMTP id e17mr17602558ejd.549.1597694380145; Mon, 17 Aug 2020 12:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597694380; cv=none; d=google.com; s=arc-20160816; b=FX2eT+TRroKl3J5lfIVyZZa7AtqBP0P4SwzSkR7YIU0C2L53fX5+XE6eHEQqgygDk9 U2LqPWHCsodHHBVYuRt5TR8vldMcr9iQlwkQl0eEjC8wWTojH7+V7BTpAaro5MlH15iR nQaT48ioBYgXfxmnWXbdS6w/O/jOYFlVrBkEoKabCRyDtjMLC9NLiW0WdpqlpxhMoJtv kOWBwvK0fI7vJLiypJZL5d6TFTWFJWz19sRcmDBc/GGH2pJUleC5Av+6Vsr8dZBvA30+ Ec5+2o0UZJHlEk3he3EUzy2vFJBRMtjFp2h+O2smkk+6vRcEPGZ2IVQ2ljgfKj+AsNNf OHLA== 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:mime-version :references:in-reply-to:date:cc:to:reply-to:from:subject:message-id :dkim-signature; bh=QXJRfHN9mmsNDk6QsxgcWobeI8TPkD80t9GisADyH1o=; b=H+T1jhoWFnV3mtyuFPVVQn8UCwWFeGjjYwrGiwwOvBOWc7NEWWG3OJLaMAtrDwq3iK KsKl7e4dEWaicw2/6PyQVrouk7xlD2DSdjdS30V+HZTIvf95WrjJoQ3HhAsOh3fvJPlQ AoptU9PFlXmAFK4T40ykUQJS/IvXbMFOcMlXecD16hOV/Onvw7hHoVWZMFfCw8XSyw6X W2MOy0dSDZdu8pshEsFehtKwr5Bnp+uHVN35IDl3RXWfoqkRSprubUJ1xiYxNeSOygsl klTDzxuvmoNc/Q7tcqK9tU00C8lyCVRL3KFHR2Tr74SIWIdKb93i6G9p3FGl5XkF81LJ 7n7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=o3bJlhjD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si12022046ejr.456.2020.08.17.12.59.17; Mon, 17 Aug 2020 12:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=o3bJlhjD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729779AbgHQT56 (ORCPT + 99 others); Mon, 17 Aug 2020 15:57:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:26564 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729118AbgHQT55 (ORCPT ); Mon, 17 Aug 2020 15:57:57 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07HJVarS069185; Mon, 17 Aug 2020 15:57:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : reply-to : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=QXJRfHN9mmsNDk6QsxgcWobeI8TPkD80t9GisADyH1o=; b=o3bJlhjDSSSEg4dGq9I4xGGrKMsrAoSBn41x6Llja9uWHRqZro1eS3ir0chvo9yl73GM QICyBow0LVqNyrgllx9sZHk4OUUVncBWVBWr6P9tHLQgTOYlkdSi265KWBJLHsEbj3mG 7iAEoK6D5aeallb/jHWED5ghWzWHAFlrVH6Lf2QFS5zDEKKOVZadYgBvoZOEzYGjbbqr OALsAKxmd3To6cp1GT3u1ktlaefTZ1QmRo9TevoftrOb+qByAmG3x84MnJLU67/sV5ww IXpfATGvrAxCKTLUbu2loUgZR7LsSDiJ1PuzTkZViDdUfByh9Ayu4wZhzV9HAI24Lkhy IA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 32y7nhdu77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 15:57:41 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 07HJVcGI069350; Mon, 17 Aug 2020 15:57:40 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com with ESMTP id 32y7nhdu6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 15:57:40 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07HJsWfR004287; Mon, 17 Aug 2020 19:57:39 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma05wdc.us.ibm.com with ESMTP id 32x7b8ued3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Aug 2020 19:57:39 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07HJvaiW62718344 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Aug 2020 19:57:36 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1676378060; Mon, 17 Aug 2020 19:57:39 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D176F78066; Mon, 17 Aug 2020 19:57:33 +0000 (GMT) Received: from [153.66.254.174] (unknown [9.80.233.55]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 17 Aug 2020 19:57:33 +0000 (GMT) Message-ID: <1597694252.22390.12.camel@linux.ibm.com> Subject: Re: [PATCH 0/8] scsi: convert tasklets to use new tasklet_setup() From: James Bottomley Reply-To: jejb@linux.ibm.com To: Kees Cook Cc: Allen Pais , martin.petersen@oracle.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, megaraidlinux.pdl@broadcom.com, Allen Pais Date: Mon, 17 Aug 2020 12:57:32 -0700 In-Reply-To: <202008171227.D3A4F454D8@keescook> References: <20200817085409.25268-1-allen.cryptic@gmail.com> <1597675318.4475.11.camel@linux.ibm.com> <202008171227.D3A4F454D8@keescook> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-17_14:2020-08-17,2020-08-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-08-17 at 12:28 -0700, Kees Cook wrote: > On Mon, Aug 17, 2020 at 07:41:58AM -0700, James Bottomley wrote: > > On Mon, 2020-08-17 at 14:24 +0530, Allen Pais wrote: > > > From: Allen Pais > > > > > > Commit 12cc923f1ccc ("tasklet: Introduce new initialization > > > API")' introduced a new tasklet initialization API. This series > > > converts all the scsi drivers to use the new tasklet_setup() API > > > > I've got to say I agree with Jens, this was a silly obfuscation: > > > > +#define from_tasklet(var, callback_tasklet, tasklet_fieldname) \ > > + container_of(callback_tasklet, typeof(*var), > > tasklet_fieldname) > > > > Just use container_of directly since we all understand what it > > does. > > But then the lines get really long, wrapped, etc. I really don't think that's a problem but if you want to add a new generic container_of that does typeof instead of insisting on the type, I'd be sort of OK with that ... provided you don't gratuitously alter the argument order. The thing I object to is that this encourages everyone to roll their own unnecessary container_of type macros in spite of the fact that it's function is wholly generic. It's fine if you're eliminating one of the arguments, or actually making the macro specific to the type, but in this case you're not, you're making a completely generic macro where the name is the only thing that's specific to this case. > This is what the timer_struct conversion did too (added a > container_of wrapper), so I think it makes sense here too. I didn't see that one to object to it ... James