From: Takashi Iwai <tiwai@suse.de>
To: "Juan José Arboleda" <soyjuanarbol@gmail.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
perex@perex.cz, tiwai@suse.com
Subject: Re: [PATCH 2/2] ALSA: usb-audio: reduce checkpatch issues in quirks-table.h
Date: Tue, 13 Aug 2024 08:57:09 +0200 [thread overview]
Message-ID: <87cymcdi62.wl-tiwai@suse.de> (raw)
In-Reply-To: <6dabfd5c05c04b0e4fc00a708cc65d691af4e267.1723518816.git.soyjuanarbol@gmail.com>
On Tue, 13 Aug 2024 05:31:28 +0200,
Juan José Arboleda wrote:
>
> Reduced checkpatch errors from 185 to 2, and warnings from 4 to 1 in
> sound/usb/quirks-table.h.
>
> Remaining issues were reviewed and considered non-blocking.
>
> Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Honestly speaking, I don't find it's much improvement from the code
readability POV. (And you don't have to "correct" the spaces in
comment lines :)
That is, if the reason of the changes is only about the complaint from
checkpatch, we can simply ignore it. Above all, applying space-only
fixes would make the stable backports more difficult.
OTOH, if we really want to improve the code readability, maybe it'd be
better to introduce some macros to simplify the definitions. e.g.
/* Quirk driver_info, use like QUIRK_DRIVER_INFO { ... } */
#define QUIRK_DRIVER_INFO \
.driver_info = (unsigned long)&(const struct snd_usb_audio_quirk)
/* Quirk data entry for struct audioformat */
#define QUIRK_DATA_AUDIOFORMAT \
.data = &(const struct audioformat)
/* Quirk data entry for struct snd_usb_midiendpoint_info */
#define QUIRK_DATA_MIDI_EP_INFO \
.data = &(const struct snd_usb_midi_endpoint_info)
and replace accordingly.
But again, I'm not sure whether it's worth. Macros might be good from
the code safety as the open code is error prone, though.
thanks,
Takashi
next prev parent reply other threads:[~2024-08-13 6:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 3:31 [PATCH 0/2] ALSA: usb-audio: Support Yamaha P-125 and cleanup Juan José Arboleda
2024-08-13 3:31 ` [PATCH 1/2] ALSA: usb-audio: Support Yamaha P-125 quirk entry Juan José Arboleda
2024-08-13 6:44 ` Takashi Iwai
2024-08-13 3:31 ` [PATCH 2/2] ALSA: usb-audio: reduce checkpatch issues in quirks-table.h Juan José Arboleda
2024-08-13 6:57 ` Takashi Iwai [this message]
2024-08-13 15:43 ` Takashi Iwai
2024-08-13 16:04 ` Juan José Arboleda
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=87cymcdi62.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=soyjuanarbol@gmail.com \
--cc=tiwai@suse.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