diff mbox series

[v5,1/5] virt: vmgenid: rearrange code to make review easier

Message ID 20240417081212.99657-2-bchalios@amazon.es (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show
Series virt: vmgenid: Add devicetree bindings support | expand

Commit Message

Babis Chalios April 17, 2024, 8:12 a.m. UTC
From: Sudan Landge <sudanl@amazon.com>

Rearrage the functions of vmgenid to make the next commit,
which re-implements vmgenid as a platform driver, easier to review.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
---
 drivers/virt/vmgenid.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

Comments

Alexander Graf April 17, 2024, 8:35 a.m. UTC | #1
On 17.04.24 10:12, Babis Chalios wrote:
> From: Sudan Landge <sudanl@amazon.com>
>
> Rearrage the functions of vmgenid to make the next commit,
> which re-implements vmgenid as a platform driver, easier to review.
>
> Signed-off-by: Sudan Landge <sudanl@amazon.com>


You can't sign off on behalf of someone else. The SoB here needs to be 
yours. If you are taking over this code from Sudan, I'd suggest to take 
over full ownership of it and put your own name as author and SoB in all 
patches.


Alex





Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Babis Chalios April 17, 2024, 9:05 a.m. UTC | #2
On 17/4/24 10:35, Alexander Graf wrote:
>
> On 17.04.24 10:12, Babis Chalios wrote:
>> From: Sudan Landge <sudanl@amazon.com>
>>
>> Rearrage the functions of vmgenid to make the next commit,
>> which re-implements vmgenid as a platform driver, easier to review.
>>
>> Signed-off-by: Sudan Landge <sudanl@amazon.com>
>
>
> You can't sign off on behalf of someone else. The SoB here needs to be 
> yours. If you are taking over this code from Sudan, I'd suggest to 
> take over full ownership of it and put your own name as author and SoB 
> in all patches.
>

I thought about it and it seemed weird to me that I take over SoB and 
authorship since I only touched one line in one of
the patches, but I will be taking over the patches, so I can do that if 
that's the way we things are done.

Does it make sense to at least add "Co-authored-by Sudan Landge 
<sudanl@amazon.com>" here?

>
> Alex
>
>
Alexander Graf April 17, 2024, 9:12 a.m. UTC | #3
On 17.04.24 11:05, Babis Chalios wrote:
>
>
> On 17/4/24 10:35, Alexander Graf wrote:
>>
>> On 17.04.24 10:12, Babis Chalios wrote:
>>> From: Sudan Landge <sudanl@amazon.com>
>>>
>>> Rearrage the functions of vmgenid to make the next commit,
>>> which re-implements vmgenid as a platform driver, easier to review.
>>>
>>> Signed-off-by: Sudan Landge <sudanl@amazon.com>
>>
>>
>> You can't sign off on behalf of someone else. The SoB here needs to 
>> be yours. If you are taking over this code from Sudan, I'd suggest to 
>> take over full ownership of it and put your own name as author and 
>> SoB in all patches.
>>
>
> I thought about it and it seemed weird to me that I take over SoB and 
> authorship since I only touched one line in one of
> the patches, but I will be taking over the patches, so I can do that 
> if that's the way we things are done.
>
> Does it make sense to at least add "Co-authored-by Sudan Landge 
> <sudanl@amazon.com>" here?


You can certainly do that, yes.


Alex





Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Jason A. Donenfeld April 17, 2024, 12:42 p.m. UTC | #4
On Wed, Apr 17, 2024 at 11:05:27AM +0200, Babis Chalios wrote:
> 
> 
> On 17/4/24 10:35, Alexander Graf wrote:
> >
> > On 17.04.24 10:12, Babis Chalios wrote:
> >> From: Sudan Landge <sudanl@amazon.com>
> >>
> >> Rearrage the functions of vmgenid to make the next commit,
> >> which re-implements vmgenid as a platform driver, easier to review.
> >>
> >> Signed-off-by: Sudan Landge <sudanl@amazon.com>
> >
> >
> > You can't sign off on behalf of someone else. The SoB here needs to be 
> > yours. If you are taking over this code from Sudan, I'd suggest to 
> > take over full ownership of it and put your own name as author and SoB 
> > in all patches.
> >
> 
> I thought about it and it seemed weird to me that I take over SoB and 
> authorship since I only touched one line in one of
> the patches, but I will be taking over the patches, so I can do that if 
> that's the way we things are done.
> 
> Does it make sense to at least add "Co-authored-by Sudan Landge 
> <sudanl@amazon.com>" here?

Wait, what? No. If you didn't write these patches, you're not the
author. Sudan is the author. However, if they passed through you, it's
fine to add your S-o-b. You can even mention the trivial change you made
between Sudan's S-o-b and your own.

Anyway, if there doesn't wind up being a need for another patchset, I
can fix this up upon committing to the tree.

Jason
Krzysztof Kozlowski April 17, 2024, 1:19 p.m. UTC | #5
On 17/04/2024 14:42, Jason A. Donenfeld wrote:
> On Wed, Apr 17, 2024 at 11:05:27AM +0200, Babis Chalios wrote:
>>
>>
>> On 17/4/24 10:35, Alexander Graf wrote:
>>>
>>> On 17.04.24 10:12, Babis Chalios wrote:
>>>> From: Sudan Landge <sudanl@amazon.com>
>>>>
>>>> Rearrage the functions of vmgenid to make the next commit,
>>>> which re-implements vmgenid as a platform driver, easier to review.
>>>>
>>>> Signed-off-by: Sudan Landge <sudanl@amazon.com>
>>>
>>>
>>> You can't sign off on behalf of someone else. The SoB here needs to be 
>>> yours. If you are taking over this code from Sudan, I'd suggest to 
>>> take over full ownership of it and put your own name as author and SoB 
>>> in all patches.
>>>
>>
>> I thought about it and it seemed weird to me that I take over SoB and 
>> authorship since I only touched one line in one of
>> the patches, but I will be taking over the patches, so I can do that if 
>> that's the way we things are done.
>>
>> Does it make sense to at least add "Co-authored-by Sudan Landge 
>> <sudanl@amazon.com>" here?
> 
> Wait, what? No. If you didn't write these patches, you're not the
> author. Sudan is the author. However, if they passed through you, it's
> fine to add your S-o-b. You can even mention the trivial change you made
> between Sudan's S-o-b and your own.
> 

It is not "fine" but it is a must. Regardless if you changed something
or not, you *must* provide your SoB since you generated the patch.
Babis, please read carefully submitting patches. Especially the DCO
part, but entire document is important.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/virt/vmgenid.c b/drivers/virt/vmgenid.c
index b67a28da4702..a167ccfad299 100644
--- a/drivers/virt/vmgenid.c
+++ b/drivers/virt/vmgenid.c
@@ -21,6 +21,20 @@  struct vmgenid_state {
 	u8 this_id[VMGENID_SIZE];
 };
 
+static void vmgenid_notify(struct acpi_device *device, u32 event)
+{
+	struct vmgenid_state *state = acpi_driver_data(device);
+	char *envp[] = { "NEW_VMGENID=1", NULL };
+	u8 old_id[VMGENID_SIZE];
+
+	memcpy(old_id, state->this_id, sizeof(old_id));
+	memcpy(state->this_id, state->next_id, sizeof(state->this_id));
+	if (!memcmp(old_id, state->this_id, sizeof(old_id)))
+		return;
+	add_vmfork_randomness(state->this_id, sizeof(state->this_id));
+	kobject_uevent_env(&device->dev.kobj, KOBJ_CHANGE, envp);
+}
+
 static int vmgenid_add(struct acpi_device *device)
 {
 	struct acpi_buffer parsed = { ACPI_ALLOCATE_BUFFER };
@@ -65,25 +79,12 @@  static int vmgenid_add(struct acpi_device *device)
 	return ret;
 }
 
-static void vmgenid_notify(struct acpi_device *device, u32 event)
-{
-	struct vmgenid_state *state = acpi_driver_data(device);
-	char *envp[] = { "NEW_VMGENID=1", NULL };
-	u8 old_id[VMGENID_SIZE];
-
-	memcpy(old_id, state->this_id, sizeof(old_id));
-	memcpy(state->this_id, state->next_id, sizeof(state->this_id));
-	if (!memcmp(old_id, state->this_id, sizeof(old_id)))
-		return;
-	add_vmfork_randomness(state->this_id, sizeof(state->this_id));
-	kobject_uevent_env(&device->dev.kobj, KOBJ_CHANGE, envp);
-}
-
 static const struct acpi_device_id vmgenid_ids[] = {
 	{ "VMGENCTR", 0 },
 	{ "VM_GEN_COUNTER", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(acpi, vmgenid_ids);
 
 static struct acpi_driver vmgenid_driver = {
 	.name = "vmgenid",
@@ -97,7 +98,6 @@  static struct acpi_driver vmgenid_driver = {
 
 module_acpi_driver(vmgenid_driver);
 
-MODULE_DEVICE_TABLE(acpi, vmgenid_ids);
 MODULE_DESCRIPTION("Virtual Machine Generation ID");
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>");