Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp323178yba; Wed, 24 Apr 2019 01:39:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyo3NTReaKmroTFHP1vaPDTT2DbWNy6Jcc5IakdUotg/R3aF7WJzrjtvHILMDsZ47G4V3bW X-Received: by 2002:aa7:97b0:: with SMTP id d16mr8646639pfq.233.1556095183216; Wed, 24 Apr 2019 01:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556095183; cv=none; d=google.com; s=arc-20160816; b=V1+BsqIN78RoZ3o+/dFWMI8YHSrJu/MA8cS3uogEh1bCGjhAYhGpktJZWmknoFB9Mr KsseSA1oI9Yn7kttLBpF4E+xPPDqFvkIJyDiDnej7VVyRJccxDAF3vT8jEh+1O2Aj2oS E5GcgkVgt9n7bpx2uNKjKLMT6xEbq9HkNYqXtWi6kpdBW4087BxYKodaKp44+yMa2Q7r 6FOoYwkClSq8EBQZWRIfqfUJe7ky+rGd/lt7dMlM0pGBSrrFRydjsN6Ri+sOrwk31YU3 sVzfvdOD2mVpXKCowUcM3hqj2JJMrYG70zcnMlDpMGfZezNkwODGrNZ7Rg0OMQ6Puw35 ii6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=eti/tTB27Ml+YHh2VBfgUmyRk/nhT5Vw5BKmsSU8uxE=; b=EpZv+7EzLoL7U2ASAEH8Oq1+yn0/+0ixkkXKkE4Z3EP0PkkutNJq/z/UUu/NVIHY/I QhfNt3U5gk9BdeHx+pW/WeZJypIdSIML5XX1D/fzURdGtNSqDty9VhbEP6vzKqW9cwRp ZMTWKZinHO5Pg5bsmQ2ge9pDSp5RIAP+q+orTfX+xfMxvLRzveqlmMBkm+NF/4TjniKa RiLux+MVWqXBjvT0TXwbpKfEiHroUQJWk3yVs+4mb/dbyR5USAgjb7/1O50+1sY02t49 96W00xaYG5xn+J2fuiYXlOJjgjN/UtDnQNzUf+NZE5p5EgY6F881qZygwGy529Z6kxUx l9jg== 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 b68si18891626plb.351.2019.04.24.01.39.27; Wed, 24 Apr 2019 01:39:43 -0700 (PDT) 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 S1727866AbfDXIiU (ORCPT + 99 others); Wed, 24 Apr 2019 04:38:20 -0400 Received: from mail-ua1-f68.google.com ([209.85.222.68]:45176 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbfDXIiU (ORCPT ); Wed, 24 Apr 2019 04:38:20 -0400 Received: by mail-ua1-f68.google.com with SMTP id o33so541450uae.12; Wed, 24 Apr 2019 01:38:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eti/tTB27Ml+YHh2VBfgUmyRk/nhT5Vw5BKmsSU8uxE=; b=W0jmzlD/NTfwVcuThjURHIcb3U1aBM6b/29ixS+GjCgSFNM4Q91Rt2BNqL7P+pchlg 5uq9a9kc8XxZ/wFo+bH6q4dqzmhhuEdo4lFcnv6T90HyRHDVnwRrPgAc+zSYyj6xHiQd zxGyrMkP4P3n8vWpDtg+lPxE9RBBFGZ9GJg31XZHk06p4WKGjmlE4Jfmiwj9mfKPtRka j5aIzeWKcABCubxEjk4HANSo21ah7tWObFjuOH4BJcg3BpdvmEquklMt6cnr8W4N5ygR bt6mtO4wBBoZBNRUgtZ1/20ZvHPAYZcTqaHMhiumOnDu17IckomrXal/pbkgPBTTH8/T E2SA== X-Gm-Message-State: APjAAAVlYH23dFfQ2cJhYwS3WfQ7LO0w300m4TTjE2vCCak0U3/J0M1F OhT3T20TmblyXy1hZ4s9y78tkwms/JptvwW99DY= X-Received: by 2002:ab0:6419:: with SMTP id x25mr15670661uao.86.1556095099247; Wed, 24 Apr 2019 01:38:19 -0700 (PDT) MIME-Version: 1.0 References: <20190416102515.12269-1-wsa+renesas@sang-engineering.com> <20190416102515.12269-7-wsa+renesas@sang-engineering.com> <20190416203431.GA20072@anatevka> <20190416204814.GA26442@roeck-us.net> <20190416205533.GB8268@kunai> <20190416212046.GC26442@roeck-us.net> <20190416221702.GC8268@kunai> <20190416223813.GA744@roeck-us.net> <20190417194528.xwivkyubhxyfrx4m@ninjato> In-Reply-To: <20190417194528.xwivkyubhxyfrx4m@ninjato> From: Geert Uytterhoeven Date: Wed, 24 Apr 2019 10:38:07 +0200 Message-ID: Subject: Re: [PATCH v2 06/16] watchdog: hpwdt: drop warning after calling watchdog_init_timeout To: Wolfram Sang Cc: Guenter Roeck , Jerry Hoemann , Wolfram Sang , Linux Watchdog Mailing List , Linux-Renesas , Wim Van Sebroeck , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfram, On Wed, Apr 17, 2019 at 9:46 PM Wolfram Sang wrote: > > Yes, that works as well. Note that it will actually print something like > > "watchdog: : ..." due to the pr_fmt() at the top of watchdog_core.c. > > I guess that should be ok. > > I have the following diff applied on top of patch 2. Works with and > without a parent device. I am not super happy casting 'identity' but > since its u8-type is exported to userspace, I think we can't avoid it. > Guenter, is this cast safe? Here is the diff: > > diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c > index cd3ca6b366ef..62be9e52a4de 100644 > --- a/drivers/watchdog/watchdog_core.c > +++ b/drivers/watchdog/watchdog_core.c > @@ -115,6 +115,8 @@ static void watchdog_check_min_max_timeout(struct watchdog_device *wdd) > int watchdog_init_timeout(struct watchdog_device *wdd, > unsigned int timeout_parm, struct device *dev) > { > + const char *dev_str = wdd->parent ? dev_name(wdd->parent) : > + (const char *)wdd->info->identity; struct watchdog_info { ... __u8 identity[32]; /* Identity of the board */ }; Is identity[] guaranteed to be NUL-terminated? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds