Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp983158ybl; Wed, 4 Dec 2019 14:32:26 -0800 (PST) X-Google-Smtp-Source: APXvYqyP9AcLToeK3pwpLqXyVJWO5a3j/yPOM7xUcsy7Txp/zNdb8RpQmTR/b7vE9l45LfKOFPzQ X-Received: by 2002:aca:b10b:: with SMTP id a11mr4793929oif.138.1575498746548; Wed, 04 Dec 2019 14:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575498746; cv=none; d=google.com; s=arc-20160816; b=CZ/H/Y4X9ydx6uLHPCznZFWr9OL4uR9qzTZTw5B1eL3jTWVSQHRbIFLP13gPIqaOzO HHyzhQMz3Ol8/un5eLQt8fEZvZNGUQoxHL5tbvTDFajF2+Sa/0DRDw/w8OAatFyYmsSn IbX+IrGVJIeA8nLXsMfDraGSKGWQpZiBDhFCGqNqKqQq64ANW19U9Wdil1j34c5m6+qy d10y20b1s+12v9EFRLrzJ4DGrfelyT+O/tFpP76L0Sh4yf+vnyWw+D65N7mmoEAJxDgv PJyiwAAt5IKz+hc9+jmMJCYB52gUQd1nzWZBoq9rkbQE07V+l5nSw7yIT8RQexc2fKD3 KXtw== 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:dkim-signature; bh=VBLNFoYH92TCdemsAO1idBbzBiJrRygvmZ7BuKbQYOk=; b=OlukskznJbY00qN6v3rhb1z0hfwGpnqti1FzHS012r7FcEfvrkLpiTXHec+Bf5D3rN 4NdoU3wB+OEawAb3dauXppcxJMsBZzeYpOMvKXgXjujcw5Ms6HfcFImp7jOvIp95qkSJ QY5Umh4nv6aIY7+Vt3IF2t1Fq3ze9yXsILWwC6lVyDthaCFBP97iZz3O8OLnn0ThzIV/ NrZw5zWOPl6v7WHkMIJRWiLt4X47U9HQ4Vp5U2yEcdYmp8ErOB+gpV0S6bX784GwsY+F 9cg5e1ZwyP96j9jRca/6Ay9qlKTC7UbtgvZHSLYGt+cE7VZskcIHcIAijP80ziHznw65 ZltQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hEz2cc1O; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si3563425oiq.128.2019.12.04.14.32.13; Wed, 04 Dec 2019 14:32:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hEz2cc1O; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728467AbfLDWa1 (ORCPT + 99 others); Wed, 4 Dec 2019 17:30:27 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42707 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728071AbfLDWa1 (ORCPT ); Wed, 4 Dec 2019 17:30:27 -0500 Received: by mail-pf1-f194.google.com with SMTP id 4so538804pfz.9; Wed, 04 Dec 2019 14:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VBLNFoYH92TCdemsAO1idBbzBiJrRygvmZ7BuKbQYOk=; b=hEz2cc1OzGElGCqF71IPxvuQ/Dp5NDujl9DXvfTc3l1VUlaBVTVt6xbcaXBQHEq2Ta 04JsDOSM55IY4V8ZMSa+3b3XokW+U3NNSJPYZGRIZfNq7qFBUYcCkVGykg/IXeIg+f58 AhxGoFA79YWBaaabUdQp9a3mBuL2+Gx1AQWCVUxtYIMthXx9eUpZshoNNhf0hApK7Mma /KoIm/eYe+oMc0FHjnTR5ZCQ3h57by0blGzU+V0D07VEC3duxz2BA1/JA4CQ5aGjEPBD 7o3ppQKKOHgx+6IxqLEbHhfVgphUBKZDQfStGS5hkZnPtZafuHiGfX9syT8KJ/+r3tJb y+HA== 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=VBLNFoYH92TCdemsAO1idBbzBiJrRygvmZ7BuKbQYOk=; b=JylNhTNrRfEdTbO7FVRxUOYo6oEpCDnBGFdgw2gBGLmUgKedCefKp3t7XfDFtNoAzo riNQYitCcO1L2ZE6su42TtJv+Jjr0LT04xTN33ysRtDZAvKRewaUG1gT0BLY9yHzxeq5 oUPXC6QNfO47Fpy0dXyCNMFwu+GolnLQqGL/sE3u0FDVUiGYV8/jAavmR5036x0Dqz4G Vg32M304XbYK3gnJU/UDnw/nMb7OBfDHvpmo3k0Ry96sHWl+Ke0ZmAdgd3bpn6io06Ef aTelihyz5PgVn8pkrYL4piJ1gRzaxMk2U/Q72ysLfkh6BBtD1MXcNNGTFAqRrfIL7sQU zQCA== X-Gm-Message-State: APjAAAUv2sCxE6mK/yWynuo+Wp//CpEjtJL/NrzV102mcHujpKGnDiC5 u1qhM4j8NPtgHnDyx87CdXShnr3A7G77ZpirQOQ= X-Received: by 2002:a62:1944:: with SMTP id 65mr5970627pfz.151.1575498626804; Wed, 04 Dec 2019 14:30:26 -0800 (PST) MIME-Version: 1.0 References: <20191204155912.17590-1-brgl@bgdev.pl> <20191204155912.17590-10-brgl@bgdev.pl> In-Reply-To: <20191204155912.17590-10-brgl@bgdev.pl> From: Andy Shevchenko Date: Thu, 5 Dec 2019 00:30:15 +0200 Message-ID: Subject: Re: [PATCH v2 09/11] gpiolib: provide a dedicated function for setting lineinfo To: Bartosz Golaszewski Cc: Kent Gibson , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Bartosz Golaszewski 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 On Wed, Dec 4, 2019 at 6:02 PM Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > We'll soon be filling out the gpioline_info structure in multiple > places. Add a separate function that given a gpio_desc sets all relevant > fields. > + if (desc->name) { > + strncpy(info->name, desc->name, sizeof(info->name)); > + info->name[sizeof(info->name) - 1] = '\0'; > + } else { > + info->name[0] = '\0'; > + } > + > + if (desc->label) { > + strncpy(info->consumer, desc->label, sizeof(info->consumer)); > + info->consumer[sizeof(info->consumer) - 1] = '\0'; > + } else { > + info->consumer[0] = '\0'; > + } I think we have to fix GCC warnings first and then do whatever this patch does. -- With Best Regards, Andy Shevchenko