Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1364642pxu; Thu, 8 Oct 2020 09:41:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQPMb2LD/K8N16U3c/9rJkwBI+uPSb7o+Gz7NcHYaPXNC7wOqwp55JLbKOtKzSznSzgNli X-Received: by 2002:a17:906:1b01:: with SMTP id o1mr10108540ejg.539.1602175300788; Thu, 08 Oct 2020 09:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602175300; cv=none; d=google.com; s=arc-20160816; b=DJ2Iy+cc5qWQQLp6fjAs0CbNj07y2xfRxuRT5WappviicHqe8J0ZDHOOLpR1hdqJFE fxHcKH1hgdYy2tQxsxf0S9Kh0dJZzWHN+9Hed0M3lGfzAfwpeW0XXZx1e5hucd4ekL8x 3Cp764T/Q0gtgpcYteAIyr+HcZbwNKX++Y/w0u+DW3cToff8DHuB7K7BCkaIOqBh0wsJ JHZDneNOUEypTZsjmxebv/zs8Fv8t4T+aWHJ4xPQuWkRgpQIt8QECFxk+L72yMVNlZ9q pfTrPFzyrS/1x2Sv6d9h3q3v9zPfsozRDrkgRJ0fzDYAvM38TNbjhsfhd05vvWFPx4NT Gzzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jzmATnldS38FX6jEZg2vEDqAzZxWXVdxseVpsaZlnC8=; b=ByuAJoIj6V/2UEcjclMjlgrynvJV7G4xK6729tLoIdOGxv1Yu2OwglMVMMRVe6oDib QY8KpE7of9vtBP425T/MCW4lpm+cLr0aX2nF6fTH/JE6GOkqqiqtdjTh6C3ecG8jDSQV AI+yxCODfdhgyLGX/W0UkfgWjohH6hmORr+DA3pOxgCTGnclXR9tClZJasfInZj7xJ7Q Lpe0dkBtN293lKwMN3MyxHsu47ePXaJre6Yu+6h0WOLrKNuwJGIQ8E2FLes+UKjRs9L4 HOd3wJC0e+xwRKZFX5pl3r3sYzdxJithRU61e1BGmSVIJvn99IC9XWpBXArntF8sw6PQ /Tbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b="OKyaTN/i"; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si3917486edw.591.2020.10.08.09.41.17; Thu, 08 Oct 2020 09:41: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=@oracle.com header.s=corp-2020-01-29 header.b="OKyaTN/i"; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730342AbgJHNmA (ORCPT + 99 others); Thu, 8 Oct 2020 09:42:00 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48710 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbgJHNl7 (ORCPT ); Thu, 8 Oct 2020 09:41:59 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 098DYA7v010515; Thu, 8 Oct 2020 13:41:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=jzmATnldS38FX6jEZg2vEDqAzZxWXVdxseVpsaZlnC8=; b=OKyaTN/isCszNAy9nplOB7QenruZlYnrbOy7JdxYwW0Xwulz9vAs1G6uN5oiDUCJ5pnk vpd1Kkh1qycNPwLLp+/yaBROpDdCOTAlrO4zm5hGqnCJbFbCab3XYtwxbVZBl0aGcXvX 8t7EgD+GxSlJYCdl48mjFZ4F/ikTgIKTh+2lhsPLmGGRsDWlNWZ6EAb71ZFNluspMtgZ 4wLCH8FGBd37gwYs45bn+0abSoVAHm+oRYyElqHLQ3oYObcAYfd5EZTpswPgS3t1kdwC 8QBDFRFyMwraE3qMohpcDsv90F2xQyq3Y9huP4eITv2z4dVn9WWKAu1k02XzLGZ7XVTh OA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 33xhxn7nb7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 08 Oct 2020 13:41:49 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 098DZMha191619; Thu, 8 Oct 2020 13:39:48 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 33y2vr250p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 08 Oct 2020 13:39:48 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 098DdlbO007679; Thu, 8 Oct 2020 13:39:47 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 08 Oct 2020 06:39:47 -0700 Date: Thu, 8 Oct 2020 16:39:40 +0300 From: Dan Carpenter To: Coiby Xu Cc: devel@driverdev.osuosl.org, "supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER" , Manish Chopra , "open list:QLOGIC QLGE 10Gb ETHERNET DRIVER" , Shung-Hsi Yu , open list , Benjamin Poirier , Greg Kroah-Hartman Subject: Re: [PATCH v1 2/6] staging: qlge: coredump via devlink health reporter Message-ID: <20201008133940.GC1042@kadam> References: <20201008115808.91850-1-coiby.xu@gmail.com> <20201008115808.91850-3-coiby.xu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201008115808.91850-3-coiby.xu@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9767 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010080102 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9767 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010080102 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2020 at 07:58:04PM +0800, Coiby Xu wrote: > -static int > -qlge_reporter_coredump(struct devlink_health_reporter *reporter, > - struct devlink_fmsg *fmsg, void *priv_ctx, > - struct netlink_ext_ack *extack) > +static int fill_seg_(struct devlink_fmsg *fmsg, > + struct mpi_coredump_segment_header *seg_header, > + u32 *reg_data) > { > - return 0; > + int i; > + int header_size = sizeof(struct mpi_coredump_segment_header); Please use the sizeof() directly in the code. Don't introduce indirection if you can help it. > + int regs_num = (seg_header->seg_size - header_size) / sizeof(u32); > + int err; > + regards, dan carpenter