From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_50,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0FD7C433E0 for ; Fri, 31 Jul 2020 01:33:03 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF1502076B for ; Fri, 31 Jul 2020 01:33:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YGILJ8fy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF1502076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8359587D1A; Fri, 31 Jul 2020 01:33:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hMX8LiOiqaOX; Fri, 31 Jul 2020 01:33:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A9AB487C5A; Fri, 31 Jul 2020 01:33:02 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D359E1BF599 for ; Fri, 31 Jul 2020 01:33:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C9F0487C5A for ; Fri, 31 Jul 2020 01:33:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CvvXnZaI0CQW for ; Fri, 31 Jul 2020 01:33:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3A2F787C55 for ; Fri, 31 Jul 2020 01:33:01 +0000 (UTC) Received: by mail-ot1-f65.google.com with SMTP id z18so1086409otk.6 for ; Thu, 30 Jul 2020 18:33:01 -0700 (PDT) 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=q2T/qHYh0SZe6VHrMdVk8rJ3NpXcbd7edisixd4s0yM=; b=YGILJ8fyfHDDZ1IGVGVPA6Ee4kpxoLOTLExaHDeAttoX8Ppa0u1CxHR1ikyeweE37m 4DbmtrWfJdvJ8XEeaA6Wnn16NGiX+ha+i2QKrBpwIHoMCdt4HVkaparnSgs9U3oqUkq9 tCMvvrlYEXDha/2MySetbsMfc/fewrhK137l9f611aifk7P10buoRN7t+u4UHATmnDyL r8uGiqyV39YnJPLmL3mW1X8xBoX81Wor7kYvG/zshdpKJo9qbF96cG6CjSXCyc1jBNp5 DrdI9tXtsRWRHuKpFp5o+qbrAZyTrxyDwZ85X55eXqOiZDp8Opfe6JmO8mLkHBrkAScq +4+w== 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=q2T/qHYh0SZe6VHrMdVk8rJ3NpXcbd7edisixd4s0yM=; b=kQ6qzbGynEnWG2e7raitLis5e4lTcH2yU64cfgz4NWyXVr/EOqoDU29A+jiRuWluu1 1VMCDDIAzIR4usp6G/dt5Alb1auyCXOdKzDAVv1u6Z3NfQm7rBhkIynGqq1PgvN/3TsO ZRzJnVYQpiwp6UUmj9UGsoTMjv2dM0LSOsnTVfKONV377apYCTFWubDMeT2gsybmi51P ox2tQMS6tO0TGSEEYHdXSx/eg6PGJkD6lyJquq5saAzkQn6BjIhBYdiI28iB4z5LWIXb bL4emqYSTdNVQV3kOt1Z1IR4ypMyDpabaBnDIxZZT9qiPZ0v1fqLKNH/ZQoHG7qIc/Ji M8aA== X-Gm-Message-State: AOAM531MMsJ4LXxC7OgZ53ozGTVTrjVgx17/ZJAZzOtRs/Qk27rbZYC6 SupNfZ4dV7kf7gahwr4AYwlXlvbgijYJJFwxayo= X-Google-Smtp-Source: ABdhPJwtwhTz4ctEBLOqMB6s6sM5KYTftA2UXRhHH6CsQCLoUcMQ0cj4mmIGeCOvepoJF49+xlUeez8/1Nf53vkY7L4= X-Received: by 2002:a9d:60d:: with SMTP id 13mr1182884otn.232.1596159180255; Thu, 30 Jul 2020 18:33:00 -0700 (PDT) MIME-Version: 1.0 References: <20200730152724.39250-1-andriy.shevchenko@linux.intel.com> In-Reply-To: <20200730152724.39250-1-andriy.shevchenko@linux.intel.com> From: Sven Van Asbroeck Date: Thu, 30 Jul 2020 21:32:49 -0400 Message-ID: Subject: Re: [PATCH v1] staging: fieldbus: Use %pM format specifier for MAC addresses To: Andy Shevchenko X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" Hi Andy, thank you for the patch ! See below. On Thu, Jul 30, 2020 at 11:27 AM Andy Shevchenko wrote: > > -struct msg_mac_addr { > - u8 addr[6]; > -}; I would prefer to keep this structure. It's conceptually important, because it describes the binary layout of a message going to a peripheral. Perhaps you can still print using %pM by doing: printf("%pM\n", response.addr) ? > @@ -59,17 +55,13 @@ static int profi_id_get(struct fieldbus_dev *fbdev, char *buf, > size_t max_size) > { > struct profi_priv *priv = container_of(fbdev, struct profi_priv, fbdev); > - struct msg_mac_addr response; > + u8 mac[ETH_ALEN]; > int ret; > > - ret = anybuss_recv_msg(priv->client, 0x0010, &response, > - sizeof(response)); > + ret = anybuss_recv_msg(priv->client, 0x0010, &mac, sizeof(mac)); Should the address-of operator (&) be present in &mac ? _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel