All of lore.kernel.org
 help / color / mirror / Atom feed
* [FIRST-PATCH] staging : greybus : gb-beagleplay.c : fixing the checks as first-patch
@ 2025-04-16 12:17 rujra
  2025-04-16 13:43 ` Ayush Singh
  2025-04-16 13:51 ` Johan Hovold
  0 siblings, 2 replies; 5+ messages in thread
From: rujra @ 2025-04-16 12:17 UTC (permalink / raw)
  To: ayushdevel1325, johan, elder, gregkh, greybus-dev, outreachy
  Cc: linux-kernel, rujra

added comments on spinlocks for producer-consumer model, rearranged the
lines on function calls where it should not end with "(" this bracket,
also removed white-spaces and aligned the arguments of function calls.

Signed-off-by: Rujra Bhatt <braker.noob.kernel@gmail.com>

>8------------------------------------------------------8<

 drivers/greybus/gb-beagleplay.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/greybus/gb-beagleplay.c b/drivers/greybus/gb-beagleplay.c
index 473ac3f2d382..fa1c3a40dd0b 100644
--- a/drivers/greybus/gb-beagleplay.c
+++ b/drivers/greybus/gb-beagleplay.c
@@ -73,7 +73,9 @@ struct gb_beagleplay {
        struct gb_host_device *gb_hd;

        struct work_struct tx_work;
+       //used to ensure that only one producer can access the shared
resource at a time.
        spinlock_t tx_producer_lock;
+       //used to ensure that only one consumer can access the shared
resource at a time.
        spinlock_t tx_consumer_lock;
        struct circ_buf tx_circ_buf;
        u16 tx_crc;
@@ -642,8 +644,8 @@ static int cc1352_bootloader_wait_for_ack(struct
gb_beagleplay *bg)
 {
        int ret;

-       ret = wait_for_completion_timeout(
-               &bg->fwl_ack_com, msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
+       ret = wait_for_completion_timeout(&bg->fwl_ack_com,
+
msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
        if (ret < 0)
                return dev_err_probe(&bg->sd->dev, ret,
                                     "Failed to acquire ack semaphore");
@@ -680,9 +682,8 @@ static int cc1352_bootloader_get_status(struct
gb_beagleplay *bg)
        if (ret < 0)
                return ret;

-       ret = wait_for_completion_timeout(
-               &bg->fwl_cmd_response_com,
-               msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
+       ret = wait_for_completion_timeout(&bg->fwl_cmd_response_com,
+
msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
        if (ret < 0)
                return dev_err_probe(&bg->sd->dev, ret,
                                     "Failed to acquire last status semaphore");
@@ -765,9 +766,8 @@ static int cc1352_bootloader_crc32(struct
gb_beagleplay *bg, u32 *crc32)
        if (ret < 0)
                return ret;

-       ret = wait_for_completion_timeout(
-               &bg->fwl_cmd_response_com,
-               msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
+       ret = wait_for_completion_timeout(&bg->fwl_cmd_response_com,
+
msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
        if (ret < 0)
                return dev_err_probe(&bg->sd->dev, ret,
                                     "Failed to acquire last status semaphore");
--
2.43.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-16 17:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 12:17 [FIRST-PATCH] staging : greybus : gb-beagleplay.c : fixing the checks as first-patch rujra
2025-04-16 13:43 ` Ayush Singh
2025-04-16 13:45   ` Julia Lawall
2025-04-16 13:51 ` Johan Hovold
     [not found]   ` <CAG+54DbMYHDRMs+P1GcSYdqKJn+EBNA2xxXZfeWCX4DK+b31+g@mail.gmail.com>
2025-04-16 17:11     ` [greybus-dev] " Jeff Johnson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.