Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1697814pxu; Thu, 8 Oct 2020 19:35:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu4e57Hwf8ho/CCBxn3bJYV00jxGJ9VEgl4VL3XYdXKVOdLLYyjYPYSwrnAFlyP2Tovn1s X-Received: by 2002:a17:907:435e:: with SMTP id oc22mr12517224ejb.485.1602210933685; Thu, 08 Oct 2020 19:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602210933; cv=none; d=google.com; s=arc-20160816; b=SZpDWop3+cBlSWEC/5t7PynxTyI5cVuKoNJLQYGj/ThMYrzdoThpx15yhnKRHIIXrE LT9cWBRoKn0OOQoJXry2OjepiV6V8pDbDv/VM+xuH42ujUBl3Vwwkhc0L+oL4VJ68TTM sXyRUcltFYYUI2mwVmu2/LNQ/wIrmPbLMkwqP7cmFzF3og6o/I3ugJabv3ZsVklniSW1 cGPgxUKulJrceP7UCEYNffAEpOEGK1COz4oUVQWYNHzM0OutIZm8oh4PgA0FXe1rvlKr UwuXPgpefN/uetMs4q02UEMwltgKF0gR0nRYM5j4bEnS9mnQW//tPox/L4O5II/vqwRj NK6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=b3eC80cU37oVexsERv1RLvxgy0Ip+ba6vrmYt/kkXmw=; b=v6hxj7KFf06UAyOhNHALqkEjYeT1owAuq1M9eFjgzItV/aR3yXBS3JMdvp3GI6pgZc /9u50ZOkN/QMft1W5GjLiIJCjYREiJ9nVF1uIa2dWnwjkf1PPwZJWGxMlhVThLA9iev8 JBTRDCd2bMDqAbQ1YQ7EaDI/7GGUth5g5kmz2/u77IeGysTDcJi5lVlaQb9jQYgfpS6l fSedOS8CDcJyAg/tDKT+JzqtNSo8JJw5qs/AU8SYxklbBREfEcrJs7J2sipm3rshAvZh WjN08k9LlbF5RVF/OA58727C9sXpxLMw7Z2B/rGQCaVPJ+sH1HZhoqCW8hmBNOYYqWb0 DS1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZqDRnMyG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qo22si5190862ejb.178.2020.10.08.19.35.10; Thu, 08 Oct 2020 19:35:33 -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=@gmail.com header.s=20161025 header.b=ZqDRnMyG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731145AbgJIAOT (ORCPT + 99 others); Thu, 8 Oct 2020 20:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbgJIAOS (ORCPT ); Thu, 8 Oct 2020 20:14:18 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B527DC0613D2; Thu, 8 Oct 2020 17:14:18 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id d23so3582254pll.7; Thu, 08 Oct 2020 17:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=b3eC80cU37oVexsERv1RLvxgy0Ip+ba6vrmYt/kkXmw=; b=ZqDRnMyGL6Rq4n5SeNN4zTe++ETsnoc/SjQ+fPuALikouX1rs4vkOTkrw1cvXkg0N9 CHd6ztVui8CCzcq9oJqjY/sNZNuNHHbPOLDYyymSmYboH8MhlUJa+3/los62vrNlfvlg Ao0AC2Z9bt+2M9y+WMAx/vCz1KypyVY/zLZKXEltu5zVRBVUCLG8Dtn+6mgVohMk4jSS yyq5WIWpxJ87hJSgiNjoyGs0cY0YQ4hCxW0lgQ0O+hn3qSMKYKrNvAKIgKUutVbUGx6w IzQ7S0cnoEauX8jXb2xmHUlKi15w0G6T7MpJv7fkAHH/daLtjvgPcPyv8QItjJU8BjM1 7EqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=b3eC80cU37oVexsERv1RLvxgy0Ip+ba6vrmYt/kkXmw=; b=S4RIZ7oxCLz7aZ4AWAEKMaoCnia9K69efZXKbgDseKQHIXTYqHY64McariqfzHg4+U slfBHavwRc3ZDVA8JmoIgkwvBtCLsAzDz3M+J6WfswwleS5kUwvLmQqHzP4CCiJLCGI/ 3HiRzPU3bv8D0PeHFLvQiQhD1zUtdwkrE5ywdkSCXM1raRPb7YFWgVdYQmkGEQ0VM5HD IiuJLK2q6JsSWEYgVEqGDnhbSNLTwp6LNIC54bQbG8KWOD7kP96kDLpQC6jeDj4YIsE2 0tIl5vEXh/G1jARWscj56ggxuflDmxzJO27Hax8XkF3hHZiP0fEL4S8vM2LFktYVyZ5q 5NXQ== X-Gm-Message-State: AOAM530YjUeNcFOtEa+xgCzfcoBVVs/+LRX0Oo2yOxKOL0Q95F0AiihN l/ahMivFvnzs8V//kysXAGo= X-Received: by 2002:a17:902:cd07:b029:d3:9be0:2679 with SMTP id g7-20020a170902cd07b02900d39be02679mr9957750ply.68.1602202458345; Thu, 08 Oct 2020 17:14:18 -0700 (PDT) Received: from localhost ([2001:e42:102:1532:160:16:113:140]) by smtp.gmail.com with ESMTPSA id x10sm8419333pfc.88.2020.10.08.17.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 17:14:17 -0700 (PDT) From: Coiby Xu X-Google-Original-From: Coiby Xu Date: Fri, 9 Oct 2020 08:14:11 +0800 To: Dan Carpenter 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: <20201009001411.yi37d25uyqkzaccw@Rk> References: <20201008115808.91850-1-coiby.xu@gmail.com> <20201008115808.91850-3-coiby.xu@gmail.com> <20201008133940.GC1042@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201008133940.GC1042@kadam> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2020 at 04:39:40PM +0300, Dan Carpenter wrote: >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; >> + > Thank you for the suggestion! >regards, >dan carpenter -- Best regards, Coiby