Received: by 10.223.185.116 with SMTP id b49csp4166409wrg; Tue, 13 Feb 2018 14:01:17 -0800 (PST) X-Google-Smtp-Source: AH8x226FWHqfASEmcyp31ACLF4WenkoW/4dIRhR+aSX1ld/05Q5+KL6gEePm9CkD4ul9lj0PUQq7 X-Received: by 10.98.156.71 with SMTP id f68mr2631015pfe.193.1518559277836; Tue, 13 Feb 2018 14:01:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518559277; cv=none; d=google.com; s=arc-20160816; b=OAIF0gpIrxlDoPjLFCE85nDlKDsprP1tTrX+eK2g8wbxE064N6cEa5gf58OUmoWyM2 yYUvcLJMYLMn21Dg20yMJM++I3Sw0XAXNK2AiTzywlgrafo2NwrQrCxBO9qCFrlCTUqz uSctnMRzs+prGbYBecCHP4AtZq8lSK2Ihe08EGJIAMGX3ok8LPaIdon859k505P73bSj E/iK1HLxOo2RbvusNZYAfZADCPMdx6BpW3heIuALHh4BL8dJ4kdhAR4p9fiXR3ERYark LRWpQrwx+8JTHGX+N/BKjuJAN4DWkm+dIZtPweyg8U1epR8kpqBT1DFt2WRCg0vdxQYH LEZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:arc-authentication-results; bh=IVF8BiWxVTRJKNm9XLIaQ9jz3kC/h3yH2Qop4rr1tNI=; b=Hb8/zkgbTAr+fk4YlDRlTPBXNexWjYwiFo6snPaYWtWQ+zuEkyTBXo865OYMP5qppQ zN+8lFKjaEoW0WbYFIJODz3GlAtpxF/grtPTpcE11BPOuE6+Js4l3FLs9hXW8H68bUom giD1U8hDd8A+LhycGR+2i7Yg4PMx8Jk5fj6jUqqmNdyLDUI6PD7bWKzVkuytqanrJRvR 72POdKvfVTJ1Ooq8KaQrsvn+o4tG9NsTOLvM1j/3jRQOl3ICRcQm/DrVNk65OV5ErtZ0 FtEPF0C9wzXnF4R4qQy0j0FitGygmMxYoOIPZDrwaXnxkX+2Eih3Y6KiHSbKa1NegYO/ Bp7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 90-v6si450329plb.428.2018.02.13.14.01.01; Tue, 13 Feb 2018 14:01:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965950AbeBMWAA (ORCPT + 99 others); Tue, 13 Feb 2018 17:00:00 -0500 Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:5859 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965865AbeBMV76 (ORCPT ); Tue, 13 Feb 2018 16:59:58 -0500 Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g9t1613g.houston.hpe.com (Postfix) with ESMTPS id 2755F60406; Tue, 13 Feb 2018 21:59:58 +0000 (UTC) Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 715B282; Tue, 13 Feb 2018 21:59:57 +0000 (UTC) Received: from anatevka.americas.hpqcorp.net (anatevka.americas.hpqcorp.net [10.34.81.6]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id C008D40; Tue, 13 Feb 2018 21:59:56 +0000 (UTC) Date: Tue, 13 Feb 2018 14:59:56 -0700 From: Jerry Hoemann To: Guenter Roeck Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, rwright@hpe.com, maurice.a.saldivar@hpe.com Subject: Re: [PATCH v2 03/11] watchdog/hpwdt: Update nmi_panic message. Message-ID: <20180213215956.GC22295@anatevka.americas.hpqcorp.net> Reply-To: Jerry.Hoemann@hpe.com References: <20180212052111.12010-1-jerry.hoemann@hpe.com> <20180212052111.12010-4-jerry.hoemann@hpe.com> <20180213174135.GA22401@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180213174135.GA22401@roeck-us.net> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 13, 2018 at 09:41:35AM -0800, Guenter Roeck wrote: > On Sun, Feb 11, 2018 at 10:21:03PM -0700, Jerry Hoemann wrote: > > + unsigned int mynmi = hpwdt_my_nmi(); > > + static char panic_msg[] = > > + "00: An NMI occurred. Depending on your system the reason " > > + "for the NMI is logged in any one of the following resources:\n" > > + "1. Integrated Management Log (IML)\n" > > + "2. OA Syslog\n" > > + "3. OA Forward Progress Log\n" > > + "4. iLO Event Log"; > > + > > + if ((ulReason == NMI_UNKNOWN) && !mynmi) > > return NMI_DONE; > > > > if (allow_kdump) > > hpwdt_stop(); > > > > - nmi_panic(regs, "An NMI occurred. Depending on your system the reason " > > - "for the NMI is logged in any one of the following " > > - "resources:\n" > > - "1. Integrated Management Log (IML)\n" > > - "2. OA Syslog\n" > > - "3. OA Forward Progress Log\n" > > - "4. iLO Event Log"); > > + panic_msg[0] = hexdigit((mynmi>>4)&0xf); > > + panic_msg[1] = hexdigit(mynmi&0xf); > > No need to reinvent the wheel. > > panic_msg[0] = hex_asc_hi(mynmi); > panic_msg[1] = hex_asc_lo(mynmi); > > or even better > hex_byte_pack(panic_msg, mynmi); > > There are matching _upper functions if you prefer A..F instead of a..f. > > Guenter Will do. thanks -- ----------------------------------------------------------------------------- Jerry Hoemann Software Engineer Hewlett Packard Enterprise -----------------------------------------------------------------------------