From: Alexey Dobriyan <adobriyan@gmail.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Jani Nikula <jani.nikula@intel.com>
Subject: Re: [RFC] include/linux/make_type.h: Helpers for making u16/u32/u64 values
Date: Wed, 14 Feb 2024 20:20:55 +0300 [thread overview]
Message-ID: <ffa107dd-23dd-47e0-b3bb-06c60ca3e2e2@p183> (raw)
> +#define make_u16(hi__, lo__) ((u16)(u8)(hi__) << 8 | (u8)(lo__))
Public Service Announcement
Identifiers representing macro arguments generally don't need to be
undescored. They are local to the macro, they don't leak outside.
End of Public Service Announcement
Firstly, make_u16() doesn't return u16.
Secondly,
#define make_u64(hi__, lo__) ((u64)(hi__) << 32 | (u32)(lo__))
doesn't truncate hi, why?
next reply other threads:[~2024-02-14 17:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 17:20 Alexey Dobriyan [this message]
2024-02-14 17:32 ` Andy Shevchenko
2024-02-14 17:39 ` Alexey Dobriyan
2024-02-14 17:42 ` Andy Shevchenko
2024-02-14 17:55 ` Michal Wajdeczko
2024-02-16 6:23 ` Alexey Dobriyan
-- strict thread matches above, loose matches on Subject: below --
2024-02-14 15:54 Michal Wajdeczko
2024-02-14 16:04 ` Andy Shevchenko
2024-02-14 17:02 ` Michal Wajdeczko
2024-02-14 17:15 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ffa107dd-23dd-47e0-b3bb-06c60ca3e2e2@p183 \
--to=adobriyan@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jani.nikula@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.wajdeczko@intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®