From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="JrKv1s73" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D71A191 for ; Mon, 4 Dec 2023 02:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701685355; x=1733221355; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=4u4lrx+P6PHxIIV2DHGygciIoa/jQYSB3t+WHNzVJcY=; b=JrKv1s73kJjtKOPhebfslZKbJIKH6R7DrcMkrtRSxsRshoXC9QVugA3t PGjJgJ6aAuNO8OkjSW5lnv8KvttLeHcr5P4ZVrvU2WVqdDf87EkgBDg35 a+h8goOPWaEEq3STU71dBzYwrOSb/GHfTtUjtdDdDgj+5598OFYlsq89b TW6tKtHyHkhQaG2hd25gWEbYGtpRqb7u8Hd0DpIDtK4m+riDhjBFIkMJX pacWKqLWys+AtEhOXn961i4DJbWDb9I68UCHQHURq/t4q+kCEchM295+c mVcjKt/uX4tz701EgatFOOAIVXUf1sa3vm35kLzNfi1MXzwrmtCfmVpR4 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="384115376" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="384115376" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 02:22:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="804858816" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="804858816" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.199]) ([10.237.72.199]) by orsmga001.jf.intel.com with ESMTP; 04 Dec 2023 02:22:32 -0800 Message-ID: Date: Mon, 4 Dec 2023 12:23:51 +0200 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Content-Language: en-US To: David Laight , 'Andy Shevchenko' Cc: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" References: <20231201150647.1307406-1-mathias.nyman@linux.intel.com> <20231201150647.1307406-9-mathias.nyman@linux.intel.com> From: Mathias Nyman Subject: Re: [PATCH 08/19] xhci: dbc: Use sizeof_field() where it makes sense In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2.12.2023 17.50, David Laight wrote: > From: Andy Shevchenko >> Sent: 01 December 2023 19:08 >> >> On Fri, Dec 01, 2023 at 05:31:52PM +0000, David Laight wrote: >>> From: Mathias Nyman >>>> Sent: 01 December 2023 15:07 >> >> ... >> >>>> - memset(dbc->eps, 0, sizeof(struct dbc_ep) * ARRAY_SIZE(dbc->eps)); >>>> + memset(dbc->eps, 0, sizeof_field(struct xhci_dbc, eps)); >>> >>> Isn't that just: >>> memset(dpc->eps, 0, sizeof (dpc->eps)); >>> perhaps better written as: >>> memset(&dpc->epc, 0, sizeof (dpc->eps); >> >> Maybe... >> You can send a patch, so it gets tested for regressions! > > Any patch I write will conflict with v2 of this series. > I'll drop this 8/19 patch as it's just a one liner cleanup that does no harm, but apparently doesn't really help either. David, I'll be happy to take a patch for this from you, but still need to run it through some testing I'll send v2 of this series Thanks Mathias