From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v4 1/2] eal: add uevent monitor for hot plug Date: Sun, 3 Sep 2017 09:14:39 -0700 Message-ID: <20170903091439.7c40d04f@xeon-e3> References: <1498712510-44217-2-git-send-email-jia.guo@intel.com> <1504453785-15735-1-git-send-email-jia.guo@intel.com> <1504453785-15735-2-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: bruce.richardson@intel.com, dev@dpdk.org, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com, jblunck@infradead.org, helin.zhang@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, thomas@monjalon.net, jingjing.wu@intel.com To: Jeff Guo Return-path: Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 156A858F6 for ; Sun, 3 Sep 2017 18:14:41 +0200 (CEST) Received: by mail-pf0-f172.google.com with SMTP id r187so12058680pfr.3 for ; Sun, 03 Sep 2017 09:14:41 -0700 (PDT) In-Reply-To: <1504453785-15735-2-git-send-email-jia.guo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sun, 3 Sep 2017 23:49:44 +0800 Jeff Guo wrote: > + char buf[RTE_EAL_UEVENT_MSG_LEN]; > + > + memset(uevent, 0, sizeof(struct rte_eal_uevent)); > + memset(buf, 0, RTE_EAL_UEVENT_MSG_LEN); Please don't initialize everything all the time; you are even initializing receive data. > + ret = recv(fd, buf, RTE_EAL_UEVENT_MSG_LEN - 1, MSG_DONTWAIT); > + if (ret > 0) > + return rte_eal_uev_parse(buf, uevent); > + else if (ret < 0) { else is unnecessary after return. Checkpatch would have told you that if you ran it. > + RTE_LOG(ERR, EAL, > + "Socket read error(%d): %s\n", > + errno, strerror(er Please indent arguements to match the first line: RTE_LOG(ERR, EAL, "Socket read error ...